General Agents Are Essentially Coding Agents: The Paradigm Shift from Tool Calling to Code Execution

General AI agents converge on coding agents because code is the most universal, composable, and verifiable action interface.
This article argues that general-purpose AI agents are fundamentally coding agents. Code's Turing completeness, composability, and verifiability make it the ideal action interface—surpassing finite tool sets. The piece traces the paradigm shift from Function Calling to Code as Action (CodeAct), explains why code training data boosts general reasoning, and offers practical guidance for AI Agent builders: invest in execution sandboxes, design generate-execute-feedback loops, and code-ify tools themselves.
A Counterintuitive Yet Logical Observation
A highly insightful perspective has been circulating in the tech community recently: general AI agents are essentially coding agents. This conclusion may seem surprising at first glance, but upon closer examination, it's quite logical. When we deconstruct an agent's capabilities down to the foundational level, we find that the ability to "write and execute code" is precisely the critical path to generality.
This isn't a marketing slogan—it's a consensus that has gradually emerged from AI Agent engineering practice over the past year. As more and more teams attempt to build agents that "can do anything," they ultimately converge on the same starting point: have the model write code, then run the code.
Why General Agents Converge on Code
Code Is the Most Universal Action Interface
For an agent to truly "do things," it must interact with the external world—querying databases, calling APIs, processing files, executing system commands, performing mathematical calculations. The traditional approach is to predefine a "tool" for each capability, then let the model choose from a finite set of tools.
But this approach has an inherent ceiling: the tool set is finite and predetermined, while real-world tasks are infinite and combinatorial. In contrast, code itself is a Turing-complete form of expression. Turing completeness is a core concept in computation theory, referring to a computational system's ability to simulate any Turing machine—meaning it can theoretically execute any task describable by an algorithm. Modern programming languages (such as Python and JavaScript) are Turing complete, meaning that given sufficient time and memory, they can perform any computable operation. By contrast, a predefined tool set is essentially a finite state machine whose capability ceiling is fixed at design time.
As long as an agent can write and execute code, it can theoretically accomplish any computable task—including dynamically calling arbitrary APIs, composing arbitrary logic, and processing arbitrary data structures.
In other words, rather than equipping an agent with a hundred specialized tools, it's better to give it one "meta-tool" that can write code. This is the core logic behind the assertion that "general agents are coding agents."
The Composability and Verifiability That Code Provides
Compared to pure natural language reasoning, code has two irreplaceable advantages:
- Composability: One piece of code can call another; logic can be nested and freely combined. When facing complex tasks, an agent can decompose a large problem into a series of executable code snippets, progressively approaching the goal. This combinatorial ability is known as "abstraction layering" in software engineering—lower-level functions handle atomic operations while higher-level functions orchestrate business logic—which also mirrors how humans solve complex problems.
- Verifiability: Code execution returns definitive results—success, error, or specific output values. This provides the agent with valuable feedback signals, enabling it to self-correct in a "write code → execute → observe results → revise" loop, rather than drifting further into hallucinations as with pure text reasoning. This closed-loop mechanism is called "environment feedback" in reinforcement learning. The code executor serves as a "grounding" mechanism between the agent and the real world, anchoring abstract reasoning to deterministic computational results.
The Paradigm Shift from Tool Calling to Code Execution
The Limitations of Function Calling
Early agent architectures relied heavily on the Function Calling pattern: developers define function signatures, and the model outputs structured call parameters. Function Calling was a key feature introduced by OpenAI in June 2023 alongside the GPT-3.5/GPT-4 API, subsequently adopted widely by major model providers. It works as follows: developers describe available functions' names, parameters, and purposes in JSON Schema format; the model decides during inference whether to call a function and generates structured parameter output; the application layer executes the actual call and returns results to the model. This pattern gave rise to the tool-calling paradigm in early Agent frameworks like LangChain and AutoGPT.
This pattern works excellently in vertical, well-defined scenarios, but becomes cumbersome when tasks are open-ended and require ad-hoc composition of multiple operations. Every new capability requires manually defining tools, writing descriptions, and debugging parameter formats. The more tools there are, the more noise the model faces during selection, actually reducing accuracy. In practice, when tool counts exceed 10-20, model selection accuracy drops significantly, and combinatorial tool invocations require complex orchestration logic, forcing developers to introduce additional mechanisms like "tool routing" or "tool layering" to mitigate the problem.
Code as Action
The new approach lets agents directly generate executable code as their "action." The "CodeAct"-style methods emerging in both academia and industry represent this direction—upgrading the agent's action space from "selecting tools" to "writing code."
CodeAct is a novel agent action paradigm proposed in 2024 by academic institutions (including UIUC and others). This method unifies the agent's action space as Python code generation and execution, rather than traditional JSON-format tool calls. On benchmarks like SWE-bench, the CodeAct paradigm demonstrates significant advantages: models can execute multi-step logic in a single action, use variables to store intermediate state, and employ conditionals and loops to handle complex scenarios. Open-source projects like OpenHands (formerly OpenDevin) are built on this philosophy.
Practice has shown that letting models express intent through code is often more efficient and flexible than piling up tool definitions. A model can complete data retrieval, processing, decision-making, and output all within a single code block, in one fluid motion. This also explains why today's most powerful coding agents (such as Devin, Cursor Agent, Claude's computer use, etc.), when given an execution environment, can actually handle tasks far beyond "writing code" itself—from data analysis to file management, from web operations to system administration, code becomes the unified language of action.
Deeper Implications of This Trend
Coding Ability Is the Lever of General Intelligence
If the core of a general agent is a coding agent, then a model's code capability becomes the key metric for measuring its general action capacity. This partially explains why leading LLM companies place such importance on code training data—code doesn't just improve programming performance; it forges the model's structured reasoning and execution capabilities.
Multiple studies have shown that code data's value in LLM pre-training far exceeds programming tasks alone. Google's PaLM paper was the first to systematically observe that increasing the proportion of code training data also dramatically improved model performance on reasoning tasks (such as mathematics, logical deduction, and chain-of-thought). This is believed to be because code's structural properties—strict syntax, explicit causal relationships, nestable abstraction layers—naturally train a model's structured thinking abilities. The excellent performance of code-focused models like Meta's Code Llama and DeepSeek Coder on general reasoning benchmarks confirms this finding, making code data a core asset in training all current top-tier models.
A model that excels at writing code often also excels at translating vague natural language goals into clear, executable steps—which is itself an essential component of "general intelligence."
Practical Implications for AI Agent Product Builders
For teams building AI Agent products, this observation provides a clear path:
- Prioritize investing in code execution environments rather than endlessly stacking predefined tools. A secure, reliable sandbox execution environment may be worth more than dozens of specialized tools. Current mainstream sandbox approaches include Docker container isolation (such as cloud sandbox services like E2B and Modal), WebAssembly runtimes (such as browser-side Python via Pyodide), and kernel-level isolation technologies like gVisor. An ideal Agent sandbox needs to balance security (preventing malicious code escape), functional completeness (supporting network access and package installation), and performance overhead. Since 2024, infrastructure startups focused on AI code execution, such as E2B and Daytona, have received substantial funding, reflecting the industry's strategic emphasis on this foundational capability.
- Design around the "generate-execute-feedback" closed loop, enabling agents to learn and self-correct from execution results. The quality of this closed loop directly determines agent reliability—the more timely and specific the feedback (such as complete error stack traces and variable state snapshots), the more efficiently the agent can self-correct.
- Code-ify the tools themselves, allowing models to dynamically write and invoke them rather than relying on fixed interfaces. This means shifting from a "pre-registered tool catalog" to a "generate tool code on demand" architecture, giving agents the ability to autonomously create solutions when facing unknown tasks.
Conclusion
The value of the assertion "general agents are coding agents" lies in revealing an essential truth obscured by surface appearances: true generality doesn't come from exhaustive tool coverage, but from a Turing-complete, composable, and verifiable action capability—and code happens to be the most natural carrier of that capability.
When we stop viewing "programming" as one feature of an agent and instead see it as the underlying language of agent action, the path to general agents actually becomes clearer. This cognitive shift perhaps also foreshadows the core competition in the next phase of the AI Agent space: it's no longer about who integrates more tools, but about whose code generation and execution loop is faster, more robust, and more secure.
Related articles

Stakeholders Want High-Level Summaries but Then Drill Into Details? A Data Scientist's Communication Playbook
Data scientists often face the paradox of stakeholders requesting high-level reports then drilling into technical details. This guide reveals the psychology behind this behavior and offers layered communication strategies.

Cobot Fires Its Only Female Salesperson: Termination Four Days After Pay Complaint Sparks Gender Discrimination Controversy
Robotics startup Cobot fired its only female salesperson four days after she filed a pay complaint, sparking retaliation and gender discrimination concerns across the tech industry.

Why Are Users Demanding Kimi K3? A Reddit Rant Reveals the Truth About China's LLM Competition
A Reddit post sparks debate: users demand Kimi K3, citing DeepSeek's low prices. Deep analysis of Chinese LLM iteration speed, pricing strategies, and user loyalty.