Claude Code CLI Consumes 4.7x More Tokens Than OpenCode in Benchmarking Study

A benchmarking study by Systima.ai revealed that Anthropic's Claude Code CLI consumes 33,000 tokens before processing a user's prompt, while the open-source OpenCode CLI uses only 7,000 tokens. The disparity is driven by Claude Code's system prompt and its 27 pre-configured tool schemas, which account for roughly 24,000 tokens of the initial payload. Additionally, Claude Code frequently rewrites its prompt cache mid-session, generating up to 54x more premium-billed cache-write tokens than OpenCode on identical tasks.

Claude Code CLI Consumes 4.7x More Tokens Than OpenCode in Benchmarking Study
Claude Code CLI Consumes 4.7x More Tokens Than OpenCode in Benchmarking Study

A benchmarking study by research firm Systima.ai has revealed that Anthropic’s command-line interface (CLI) tool, Claude Code, consumes significantly more token overhead than its open-source alternative, OpenCode. During baseline tests, Claude Code transmitted roughly 33,000 tokens before a user’s prompt was processed, whereas OpenCode required only about 6,900 tokens—representing an initial payload difference of approximately 4.7 times.

The divergence in baseline token consumption stems primarily from the system prompts and built-in tool configurations packaged inside each CLI client.

Understanding the Token Cost of Agentic Tooling

Tokens are the fundamental units of text—ranging from individual characters to parts of words—that large language models (LLMs) process and generate. When developers use terminal-based AI assistants like Claude Code or OpenCode, the local CLI client does not simply send the developer’s raw prompt (such as “refactor this function”) to the API.

Instead, the client prefaces the message with an extensive system prompt. This prompt instructs the underlying model on how to behave, how to write code, and how to format its output.

Along with these instructions, the CLI sends schemas. These are structured definitions that inform the model of the local system tools it has permission to execute. These tools allow the AI to read files, run terminal tests, and edit codebases.

Each tool schema requires hundreds of tokens to outline its parameters, inputs, and expected responses to the model. Consequently, before any user-written characters enter the stream, a substantial portion of the model’s context window is already filled.

The Source of the 26,000-Token Disparity

In the Systima.ai study, researchers isolated baseline token consumption by issuing a simple prompt asking both harnesses for a one-line reply (“OK”). This first baseline test was pinned to the Claude Sonnet 4.5 model. Under these conditions, the majority of Claude Code’s 33,000-token footprint was traced to its expansive tooling capabilities. Claude Code initiates its sessions with 27 pre-configured tool schemas. These cover core file-editing commands alongside orchestration, background agents, and task monitoring.

These 27 tool schemas, paired with auxiliary user-context blocks and agent-delegation guidelines, account for roughly 24,000 tokens of the initial payload.

OpenCode, by contrast, operates on a lighter framework. It relies on 10 built-in tool schemas and a streamlined system prompt. The tool definitions for OpenCode consume approximately 4,800 tokens, helping keep its total startup payload near 6,900 tokens.

Baseline Token Usage (Claude Sonnet 4.5):
┌───────────────────────────┬──────────────────┬──────────────────┐
│ Component                 │ Claude Code      │ OpenCode         │
├───────────────────────────┼──────────────────┼──────────────────┤
│ Total Startup Payload     │ ~33,000 tokens   │ ~6,900 tokens    │
│ Tool Schemas              │ ~24,000 tokens   │ ~4,800 tokens    │
│ Built-in Tool Count       │ 27 tools         │ 10 tools         │
│ System Prompt (No Tools)  │ ~6,500 tokens    │ ~2,000 tokens    │
└───────────────────────────┴──────────────────┴──────────────────┘

Even when tools are entirely disabled, Claude Code remains the heavier harness. Stripping away all tool schemas isolates the system prompts:

  • Claude Code’s system prompt spans 26,891 characters (approximately 6,500 tokens).
  • OpenCode’s system prompt spans 8,811 characters (approximately 2,000 tokens).

While a 33,000-token baseline means Claude Code consumes a meaningful portion of standard context windows immediately at startup, the research notes that this baseline multiplier is model-dependent. When the researchers re-ran the baseline tests using Anthropic’s Claude Fable 5 model, the gap narrowed to roughly 3.3 times because Claude Code utilizes a significantly smaller system prompt when connecting to that specific model version.

Cache Instability Drives Mid-Session Differences

The study highlighted a second economic difference during ongoing development sessions: prompt caching behavior. Modern LLM providers offer prompt caching, a performance-saving feature where a model’s API remembers the prefix of a request if it remains identical across multiple consecutive API calls. Reading from a warm cache is billed at a heavily discounted rate compared to writing new tokens to the API.

To maximize these discounts, a CLI tool must maintain a byte-identical request prefix throughout a working session. Systima.ai observed that OpenCode’s request prefix remained identical across captured runs, enabling the tool to pay for cache-writing once and read it back cheaply for the rest of the session.

// Stable prompt cache behavior (OpenCode):
[ stable system prompt & tools ] -> Cached on Turn 1 (expensive write)
[ stable system prompt & tools ] -> Reused on Turn 2 (cheap read)

Claude Code, however, was found to frequently rewrite its cache contents mid-session. The CLI tool outputs three distinct classes of requests per session, and its system bytes and scaffolding fluctuate between turns. Additionally, as a conversation progresses, Claude Code appends <system-reminder> blocks, which expand the scaffolding turn-by-turn.

Because the request prefixes are not stable, the API is repeatedly forced to overwrite its cache with tens of thousands of new tokens. On an identical file-summarization task, Claude Code wrote 53,839 cache tokens across five requests, while OpenCode wrote 1,003 cache tokens. This instability caused Claude Code to generate approximately 53.7 times more premium-billed cache-write tokens than OpenCode on the same task.

Where the Gap Closes: Parallel Execution

Though Claude Code proved to be much heavier on a per-request basis, the researchers documented one scenario where its overall token consumption converged with OpenCode’s: multi-step coding tasks.

In a write-run-test-fix loop, the two CLI tools took different architectural paths to achieve the same correct outcome:

  • OpenCode executed sequentially, making nine separate requests to the API and paying its ~6,900-token baseline each time.
  • Claude Code utilized parallel tool calls, batching two file writes and two script executions into a single parallel round trip, requiring only three total API requests.

Because a user’s total token expenditure is determined by multiplying the baseline by the total number of round-trip requests, Claude Code’s ability to batch complex multi-step actions can offset its high per-turn overhead in longer, highly integrated workflows.

Topics
  • #Opensource
Raman V

Author

Raman V

Contributor

Enterprise Solutions Leader is a transformation expert with over 15 years of experience in the IT industry working with Fortune 500 companies. With a solid foundation in large-scale application development and enterprise modernization, he excels at architecting robust, scalable platforms that drive operational efficiency.