Design an AI Coding Agent

Harder 6
AI ProductsAccess ControlStreaming

Design the backend for an agentic coding assistant. A developer points it at their repository, types a task, and the system runs a model in a tool-calling loop that reads files, edits them, and runs tests until the task is done or the developer stops it.

Start a session against a repo. Run the agent loop: the model emits tool calls, the backend executes them and feeds results back. Stream every step to the developer's screen as it happens. Prompt for approval before a tool that writes files, installs packages, or reaches the network. Let the developer cancel mid-run. Let the agent fan work out to subagents.

Executed code is untrusted and must not reach your infrastructure or another customer's repo. A session survives a browser refresh. A runaway loop cannot burn unbounded money. Median time from a tool call finishing to the next model token under 2 seconds.

40,000 developers, 8,000 concurrent sessions at peak. A session averages 45 tool calls over 12 minutes and 900,000 input tokens including cache reads. Repos average 400MB. Tool output is frequently over 1MB and occasionally 200MB.

The editor UI, model training, and billing invoices.

System design
Loading editor...