Inside Claude Code and Codex: Dissecting the Six Core Components of a Coding Agent
The article breaks down the architecture of coding agents like Claude Code and Codex into six essential components—Live Repo Context, Prompt Cache, Tools, Context Management, Session Memory, and Bounded Subagents—explaining how each layer of the Agent Harness transforms similar LLMs into markedly different, more capable systems.
1. LLM, Reasoning Model, and Agent
The author distinguishes three concepts: LLM is the bare next‑token prediction model; a Reasoning Model is an LLM fine‑tuned or prompted to spend extra compute on intermediate reasoning and self‑verification; an Agent adds a control loop that decides which tools to call, how to update state, and when to stop.
Using a car analogy, the LLM is the engine, the reasoning model is a high‑performance engine, and the Agent Harness is the chassis, transmission, and cockpit that turn the engine into a usable vehicle.
2. Why the Harness Creates Competitive Differentiation
The author argues that flagship models (GPT‑5.4, Opus 4.6, GLM‑5) have converging raw capabilities, and the decisive factor for real‑world performance is the surrounding Harness. A strong Harness can make a weaker model feel as capable as a stronger one, and post‑training of the Harness adds further gains (e.g., OpenAI’s GPT‑5.3 and GPT‑5.3‑Codex variants).
This signals a shift in competition from the model itself to the externalization of the model via Harnesses.
3. The Six Core Components of a Coding Agent
Raschka implements a Mini Coding Agent in pure Python, with each component annotated in the code. The components are:
Live Repo Context – gathers a stable workspace summary (branch, repo status, relevant docs) before each turn.
Prompt Shape and Cache – builds a stable prefix (prompt shape) and reuses it across turns, only processing the incremental user request and short‑term memory.
Tools, Validation, Permissions – a predefined list of named tools (list files, read file, search, run shell, write file, etc.) with checks for tool existence, argument format, approval, and path safety before execution.
Context Reduction – clips, deduplicates, and compresses long documents, tool outputs, and logs to avoid context budget overflow.
Transcripts, Memory, Resumption – maintains a full transcript for recovery and a distilled working memory (current task, key files, recent notes) that is actively updated and compressed.
Delegation and Bounded Subagents – splits parallel sub‑tasks to bounded sub‑agents, inheriting sufficient context while enforcing limits on task scope, context size, and recursion depth.
4. Component Details
Live Repo Context
When a user says “fix the tests” or “implement xyz”, the command alone lacks context. The Harness must know whether it is inside a Git repo, which branch is active, and whether project documentation defines test commands. This information guides the Agent to the correct files and helps focus on ongoing changes.
Prompt Cache
Because most of the prompt (agent rules, tool descriptions, workspace summary) remains constant across turns, the Harness caches the stable prefix and only appends the new user request and short‑term memory, dramatically reducing compute and latency.
Tools
Unlike a bare LLM that can only suggest commands in natural language, a Harness‑enabled model can actually execute commands and retrieve results. The tool list is explicit, with clear input‑output contracts, and each invocation passes through validation steps (known tool?, argument format?, user approval?, path safety?) before execution.
Context Management
To prevent context overflow, the Harness employs clipping (truncating overly long fragments), transcript reduction (summarizing recent history while heavily compressing older events), and deduplication of repeated file reads.
Session Memory
The memory is split into two layers: a working memory that holds a distilled state (current task, key files, recent notes) and a full transcript that records every user request, tool output, and LLM response for resumability.
Bounded Subagents
Sub‑agents enable parallelism by delegating bounded tasks (e.g., locating a symbol definition, checking a config, diagnosing a failing test). They inherit enough context to act but are constrained by task scope, context limits, and recursion depth to avoid duplication and infinite spawning.
5. Summary Diagram
https://magazine.sebastianraschka.com/p/components-of-coding-agentSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
