CS2680 Modern AI Systems: Agents and System Optimizations
Assignment 1 — Use an agent

Assignment 1 — Use an agent (10%)

Out Wed Sep 2 · due Sun Sep 20, 11:59pm · individual · all five assignments

Build and deploy an agent console: a small web app on AWS with a task box and a run button in front of claude -p. The browser sends a task, the server runs Claude Code headless in a workspace, and the page returns the result, transcript, and cost. Keep the interface deliberately simple; the system behind it is what the rest of the course measures and replaces. In Assignment 2, your own loop takes over from claude -p behind the same boundary.

The console must:

  • Take a task from the browser and run it with claude -p in a workspace on the server. --output-format json returns the result, the token counts, and the dollar cost in one object — use it.
  • Show what happened: the answer or the diff, the transcript, and the run's numbers — tokens in and out, wall-clock, dollars. If a run costs money, the page says how much.
  • Keep every run — task, transcript, numbers — so the same task can be run again and compared. This is the instrumentation habit Assignment 2 grades.
  • Run on AWS, reachable from your browser. A small EC2 instance is the expected path; anything on AWS that serves your app and can run Claude Code works. Register your account in week one — the AWS setup page has the steps and the two things to get right before you deploy.
  • Isolate the engine. Exactly one boundary in your code invokes claude -p. Assignment 2 swaps your own loop in behind it, so a console with the agent smeared through it is a console you will rebuild in three weeks.

Use Claude Code to build it: stay in the loop, but let the agent do the writing. Any of Claude Code's three interfaces is fine — terminal, desktop app, or the VS Code extension — and the account comes from Harvard FAS, so start that request in week one. There is a pleasing symmetry here: the agent that builds your console is the agent your console runs, so you will meet its failure modes from both sides of the glass.

Claude Code rather than your own favorite, for two reasons: the whole room comparing notes on the same harness at the sharing session is worth more than everyone comparing different ones, and the session files you submit only exist for this tool. If you want to run Cursor or Codex alongside it and write up the comparison, that is a genuinely interesting appendix — but the assignment itself, and the transcripts you submit, are Claude Code.

Run example tasks through it

Then use it. Run at least five example tasks through the deployed console — real tasks, the kind you would hand a working agent: fix a bug in a repo you own, add a small feature, write a script against a file you actually have. Pick tasks whose outcome you can check, because checking is about to become the whole game: these tasks are the seed of Assignment 2's task set, the one your own agent is measured against for the rest of the semester. Keep the task definitions, the transcripts, and the numbers.

The write-up

The console is a deliverable this time — Assignment 2 needs it — but the write-up still carries the judgment. It is a PDF report submitted through Canvas, compact and technical: what you built, how it works, how you evaluated it, what failed, and what the measurements show. In it:

  • Where did the agent fly, and where did it stall — both while building the console and while running your tasks through it?
  • Which failures were the model's, and which were the harness's — missing context, missing tools, no feedback signal to learn from?
  • What did you have to know yourself in order to unblock it? Those moments are exactly where the abstraction leaks, and they are the best preview of the rest of this course.
  • What did it cost — tokens, wall-clock, dollars — to build, and per example task to run? Your console's own numbers answer the second half.
  • Which of your example tasks deserve to survive into Assignment 2's task set, and what the success criterion for each would be — written as something a script could check.

Keep your transcripts. They are the evidence for this write-up, and you will want them again later.

Your console is remote code execution as a service — treat it that way. claude -p on your instance can read files and run commands, and anyone who can reach the page can make it do so. Put something in front of it — a password, a token, or a security group that only admits your own IP — keep credentials off the instance and out of the workspace, and set an AWS billing alarm before you deploy rather than after. An open agent endpoint on a public IP is the kind of mistake this course wants you to understand, not make.
Bring it to the sharing session on Sep 21, the morning after the deadline. Demo the console live — one task the agent handled well, one it failed, and your read on why. Nothing formal and nothing separately graded; it counts toward participation.
Submit three artifacts: your code, your write-up as a PDF report through Canvas, and an archive of your Claude Code session files from ~/.claude/projects/. Session history expires after 30 days by default, so archive before the deadline rather than after — and because those files record every file the agent read and every command it ran, scan them for credentials first.