The Grammar of Autonomous Code
A source-level study of how coding agents perceive, decide, act, and verify.
Runtime Flow
A compact view of how a user request becomes model events, tools, observations, and the next turn.
User message enters the session.
Capability Map
A compact comparison of where each runtime places key responsibilities.
| Capability | Codex CLI | Claw Code |
|---|---|---|
| File Search | ||
| File Editing | ||
| Shell Execution | ||
| Extensions | ||
| Multi-Agent | ||
| Permissions |
Chapters
Overview: What Makes a Coding Agent
The runtime loop, core boundaries, and design space behind coding agents
Runtime Architecture
How CLI, runtime, configuration, plugins, MCP, skills, and UI layers fit together
Agent Loop and Turn Execution
How user input becomes model streams, tool calls, observations, validation, and follow-up turns
Tool System and Orchestration
How built-in, plugin, MCP, and skill tools are registered, authorized, and executed
Code Search and Discovery
How agents locate files, search text, rank evidence, and narrow investigations
File Editing and Patch Application
Patch application, string replacement, whole-file writes, and edit safety
Sandboxing and Process Security
Platform containment, filesystem and network boundaries, and defense in depth
Permissions and Approval Flow
Approval modes, command classification, hooks, denials, and user prompts
Context, History, and Compaction
Conversation history, tool-pair integrity, token budgets, and compaction
Prompt Construction and Project Memory
Base instructions, project memory, dynamic context, extensions, and cache-aware prompts
Model Clients, Streaming, and Caching
Provider adapters, streaming events, retries, usage tracking, and prompt caching
Sub-Agents and Delegation
Agent spawning, context inheritance, messaging, roles, waiting, and cleanup