The Internals of Coding Agents
Focuswhat an LLM actually is and what the agent loop looks like under the hood; the core tool set (read, write, edit, bash) and how tasks flow through it; how production coding agents structure their system prompts and tool definitions.
You buildA 300–500 line terminal agent with four tools and full logging
Core material≈ 3 h 20 min
- 1Video59 minIntro to Large Language ModelsAndrej Karpathy
The best compact conceptual foundation. If you have the time, watch his longer Deep Dive into LLMs like ChatGPT (3 h 31 min) instead for a fuller foundation.
- 2Article + code≈ 60 min with the codeHow to Build an AgentThorsten Ball
A small, legible coding agent with the essential tool loop. Use it as the model for this week's build.
- 3Article25 minBuilding Effective AI AgentsAnthropic
The canonical text on workflows versus agents and the augmented-LLM loop. Barry Zhang's talk below is the video form.
- 4Engineering article20 minUnrolling the Codex agent loopOpenAI
A production-oriented explanation of the loop and its design tradeoffs.
- 5Talk15 minHow We Build Effective AgentsBarry Zhang of Anthropic
The minimal loop, tool use, risk, verification, and debugging from inside an agent's limited context.
Production prompts and tool definitions
Read real system prompts, not summaries of them. These are public and readable:
- Linkfiles named `gpt_5_2_prompt.md`, `gpt_5_codex_prompt.md`, and similarcodex-rs/coreOpenAI Codex CLI is open source. Read the model prompts in
And the compaction prompt under
codex-rs/prompts/templates/compact/. - LinkGemini CLIGoogle's
Keeps its system prompt in
packages/core/src/core/prompts.tsand its MCP prompts inpackages/core/src/prompts/. - Linkopencode
Is a third open-source coding agent whose prompts and tool schemas you can diff against the two above.
- Video1 h 06 minHow Claude Code Works
An independent workshop on prompt-driven architecture, tool calls, subagents, permissions, and evaluations. The best public walkthrough of a production agent's prompt and tool design.
Optional foundation
- Video27 minTransformers, the tech behind LLMs3Blue1Brown
The clearest visual explanation of attention.
- Chip Huyen, AI Engineering — read the sections on foundation models, evaluation, and application architecture.
Deeper material
- LinkHow to build a coding agent: free workshopGeoffrey Huntley
A second from-scratch build with a different design.
- Linkmini-swe-agent
A 100-line agent that scores over 74% on SWE-bench Verified. Read it after your own build to see what you over-engineered.
- Video31 minBuilding Effective Agents with LangGraphLangChain
Routing, parallelization, orchestrator-worker, and evaluator-optimizer patterns.
Additional video track
- Video13 minWhat's next for AI agentic workflowsAndrew Ng
Reflection, tool use, planning, and multi-agent collaboration as the four agentic patterns.
- Video17 minSoftware Development Agents: What Works and What Doesn'tRobert Brennan of OpenHands
The editor, terminal, browser, sandbox, and action loop.
Build
Build a terminal coding agent in roughly 300–500 lines. Give it four tools: list files, read a file, edit a file, and run a shell command. Log every model response, tool call, result, token count, and stop condition. Test it on three tiny repository tasks and manually classify every failure as model, context, tool, or control-loop failure.
Then read one production system prompt (Codex or Gemini CLI) end to end and annotate it: which lines set persona, which set safety boundaries, which shape tool selection, which handle stopping. Compare it with your own prompt.