news.volyx.in

Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k (systima.ai)

705 points by systima · 46 days ago · 395 comments on HN

Article summary

The article compares the token usage of Claude Code and OpenCode, two AI coding agents, and finds that Claude Code uses significantly more tokens than OpenCode. The difference is attributed to Claude Code's larger system prompt, tool schemas, and injected scaffolding. The article also explores how different factors, such as instruction files, MCP servers, and subagents, can multiply the token usage. The results suggest that Claude Code's design may be less efficient and more costly than OpenCode's.

Main themes

  • AI coding agents
  • Token usage comparison
  • Efficiency and cost
  • System prompt and tool schemas
  • Instruction files and MCP servers
  • Subagents and scalability

What commenters say

  • The testing methodology used in the article may be flawed due to the use of an old model and a local LLM gateway that affects the results.
  • Some users find that AI coding agents can be overly aggressive in their use of tools and tokens, even for simple tasks.
  • There is a trade-off between performance and cost in AI coding agents, and some agents may prioritize performance over cost efficiency.
  • Writing a custom AI agent can be a viable alternative to using existing agents, allowing for more control over token usage and functionality.
  • The use of pre-commit hooks and other workflow optimizations can help reduce token usage and improve efficiency.
  • Some users prefer a more minimalistic approach to AI coding agents, while others prefer a more full-featured agent with built-in tools and functionality.
  • The security and dependency implications of using AI coding agents with many transitive dependencies are a concern for some users.
  • The article's findings may not be generalizable to all use cases and users, and more research is needed to fully understand the implications of token usage in AI coding agents.