Claude Code Benchmark: Dynamic Languages Outperform Static Types in Efficiency and Cost
As AI coding assistants evolve from simple autocomplete tools to full-scale agents, the efficiency of the languages they generate has develop into a critical metric for developers. A recent large-scale benchmark reveals a significant performance gap in how Claude Code (Opus 4.6) handles different programming paradigms, with dynamic languages proving to be faster, cheaper and more stable than their statically typed counterparts.
Key Takeaways
- Dynamic Advantage: Ruby, Python, and JavaScript were the most efficient languages for Claude Code to implement.
- Cost Disparity: Statically typed languages were 1.4 to 2.6 times slower and more expensive to generate.
- Stability: Dynamic languages showed low variance and 100% test pass rates across 40 runs.
- Architectural Edge: Claude Code’s local-first CLI approach leads in accuracy over cloud-based competitors like OpenAI Codex.
The 13-Language Performance Test
Ruby committer Yusuke Endoh conducted a comprehensive benchmark consisting of 600 runs to test how efficiently Claude Code generates working implementations. The task involved creating a simplified version of Git, divided into two phases:
- Phase 1 (v1): Implementing
init,add,commit, andlogfrom an empty directory. - Phase 2 (v2): Extending the project with
status,diff,checkout, andreset.
To ensure a fair comparison and eliminate differences in library dependencies, Endoh used a custom hash algorithm instead of SHA-256. Each language was tested 20 times per phase.
The Winners: Dynamic Languages
Dynamic languages consistently dominated the benchmark in terms of speed, cost, and stability. Ruby, Python, and JavaScript all passed all tests across their 40 runs with minimal variance.
| Language | Average Cost per Run | Average Time |
|---|---|---|
| Ruby | $0.36 | 73.1 seconds |
| Python | $0.38 | 74.6 seconds |
| JavaScript | $0.39 | 81.1 seconds |
The Struggle: Statically Typed Languages
From fourth place onward, the data shows a sharp increase in both cost, and variance. Statically typed languages were significantly more resource-intensive for the AI to implement correctly.
- Go: Averaged $0.50 per run at 101.6 seconds, though it exhibited a high standard deviation of 37 seconds.
- Rust: Averaged $0.54 per run and showed the widest spread of results at 54.8 seconds. Rust was also one of only two languages to experience test failures.
- C: This was identified as the most expensive mainstream language in the benchmark.
Claude Code vs. OpenAI Codex: Local-First vs. Cloud-Based
The broader landscape of 2026 shows a divergence in AI coding paradigms. While Claude Code focuses on a local-first, CLI-based approach with deep codebase awareness, OpenAI Codex operates as an autonomous, cloud-hosted agent powered by GPT-5.2 and GPT-5.3-Codex.
Accuracy benchmarks favor Anthropic’s offering. Claude Code leads with a 92% score on HumanEval (compared to Codex’s 90.2%) and 72.7% on SWE-bench (compared to Codex’s 69.1%). However, Codex maintains an advantage in operational costs and token efficiency, offering roughly 3x better efficiency than Claude Code.
Understanding the Claude Model Hierarchy
Anthropic provides three distinct tiers to balance power, cost, and speed. According to verified benchmarks, the models are categorized as follows:
Opus 4.6 (The Flagship)
Designed for complex tasks, Opus 4.6 is the most capable model. It achieved a 80.8% score on SWE-bench Verified and 91.3% on GPQA Diamond. It supports a 1M token context window with an input price of $15/M and an output price of $75/M.
Sonnet 4.6 (The Workhorse)
Sonnet provides a balance of performance and economy, closing within a few points of Opus on most benchmarks (79.6% on SWE-bench Verified) at 1/5 the cost. Its pricing is $3/M for input and $15/M for output.
Haiku 4.5 (The Speed Tier)
Optimized for high-volume, latency-sensitive work, Haiku 4.5 scored 73.3% on SWE-bench Verified. It features a 200K token context window and is the most affordable tier at $0.80/M for input and $4/M for output.
The Future of AI Skill Refinement
The evolution of these tools isn’t limited to the base models. The introduction of Claude Code Skills 2.0 allows for a more iterative development process. The skill-creator now includes automated evaluations, blind A/B testing, and trigger tuning, enabling developers to self-test and improve the specific “skills” the AI employs during the coding process.
As AI agents move closer to full autonomy, the choice between dynamic and static languages may no longer be based solely on runtime performance or type safety, but on the efficiency and cost of the AI generating the code.