1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →
Design a coding agent like Claude Code or Cursor's agent mode.
30-second answerSay your answer out loud first, then reveal.
Core loop: gather context → plan → act (edit/run) → verify → repeat.

Key design choices
- Agentic search vs pre-built index: grep/glob plus reading files on demand is simple and always fresh, and modern models are good at it. Embedding indexes help in huge monorepos but go stale. Many systems use both.
- Edit format: targeted string replacement or diffs instead of rewriting whole files. Cheaper and fewer accidental deletions. Validate that the edit applied.
- Verification is the secret sauce: run tests, type-checkers and linters after changes, and feed failures back. This gives the agent a ground-truth feedback signal (evaluator-optimizer).
- Sandbox and permissions: containers or OS-level sandboxing, filesystem limits to the project, network allow-lists, approval for destructive commands (
rm -rf,git push --force, deploys). - Context management: sub-agents for exploration, compaction, keeping large command outputs out of context (tail logs).
- Project memory: a file like
CLAUDE.mdorAGENTS.mdholding build commands, conventions and gotchas, loaded every session. - Checkpoints / undo: snapshot file state so a user can roll back an agent's changes.
- Human UX: show diffs, stream progress, allow interruption.
Evaluation: SWE-bench-style tasks (issue → patch → hidden tests), internal task suites, and metrics like task success, iterations, tokens, and how often a human had to intervene.
Risks: prompt injection from repo files, dependencies or web docs; secret leakage; destructive commands. Mitigate with permissions, sandboxing, and secret scanning.
Related
You understood something today that you didn't yesterday.