Homework 2

Build your own agent

Due before class on Wednesday, October 14, 2026

In class we took an agent apart: a loop of API calls, where a tool call is just text your program acts on. This week you build that loop yourself: a small program, a harness, that chats with you and runs shell commands. It has exactly one tool, bash. Over the coming weeks it grows: more tools, MCP servers, skills, other agents.

Your AI coding agent writes most of the code with you. You make the decisions, and by the end you can point at the loop and explain every step.

Start

  1. Open an AI coding agentClaude Code, Codex, Cursor, GitHub Copilot, … in a folder under your home directory.
  2. Give it this Read https://class.xhelio.ai/week-2/homework.md and help me with my homework.
  3. Build it togetherIt helps you get a model API, builds the harness with you step by step, tests it, publishes it on GitHub, and opens your pull request.

Your harness

Write the loop yourself: no agent frameworks. A few hundred lines is plenty.

A model API

sub2api can get your account banned. Using a subscription this way may break your provider's terms. OpenAI's Codex lead said in August 2026 that many users flagged by their fraud-prevention systems were using sub2api; Anthropic's and Google's terms also forbid it. If you use it: your own account only, on your own computer, never shared or reachable from the network. Rather not risk it? Use OpenRouter.

What you submit

A pull request adding one file, week-2/submissions/<your-github-username>/SKILL.md: a skill that tells an AI agent how to install your harness from its public repository, configure it, run it, and check that it works.

It counts when the repository is public, the skill works on a fresh computer, and the harness does everything on the list. Say in your pull request which AI helped you, and how.