Agentic AI
Research breaks down the architecture behind AI coding agents like Claude Code
A new analysis reveals how modern AI agent systems balance safety, capability, and user control through layered design choices.
A fresh study from arXiv examines the inner workings of Claude Code, an AI agent that executes shell commands, modifies files, and integrates external services at a user's direction. By reverse-engineering the system and comparing it to two open-source competitors, researchers identified the core architectural patterns that distinguish today's agentic AI tools.
The fundamental loop and surrounding systems#
At its heart, Claude Code operates on a deceptively simple mechanism: a loop that queries an AI model, executes the requested tools, and repeats. The complexity, however, lies everywhere else. A permission framework with seven different access modes, powered by machine learning classification, controls what actions the agent can take. A five-stage pipeline compacts and manages context to fit within the model's attention window. Multiple extension points—MCP, plugins, skills, and hooks—let developers add capabilities. The system also supports delegating subtasks to other agents and stores sessions in an append-only format for auditability.
Five design values driving the choices#
The research identifies five underlying principles that shaped these architectural decisions:
- Human decision authority — keeping users in control of what the agent does
- Safety and security — preventing unintended or harmful operations
- Privacy protection — limiting what information flows where
- Reliable execution — ensuring tasks complete as intended
- Capability amplification — letting the agent accomplish more than its base model allows
These values connect to thirteen concrete design principles, which then translate into the specific code patterns and safeguards found in the system.
How competitors take different paths#
The study compares Claude Code with two alternatives—OpenClaw and Hermes Agent—each operating in different deployment contexts. Claude Code emphasizes safety checks at each individual action. OpenClaw prefers to establish a secure perimeter first, then grant broad access within it. Hermes distributes approval checks across multiple surfaces, making safety decisions contextual. At runtime, Claude Code uses a command-line interface, OpenClaw embeds itself within a gateway control plane, and Hermes adapts based on how it's launched. For extensions, Claude Code expands the context window, OpenClaw centralizes capabilities at the gateway level, and Hermes provides pluggable backends for both memory and model selection.

