Ruby, Python, JavaScript: Claude Code's Fastest Languages (Data-Backed)
The Experiment: Measuring Claude Code's Language Efficiency
A developer ran 600 trials with Claude Opus 4.6 (high effort) to implement a simplified Git system across 13 languages. The methodology was straightforward: "Read SPEC-v1.txt, implement it, and make sure test-v1.sh passes." Each language was tested 20 times across two phases: initial implementation and feature extension.
The languages tested included:
- Dynamic: Ruby, Python, JavaScript, Lua
- Static with annotations: Python/mypy, Ruby/Steep
- Static compiled: Go, Rust, Java, C, OCaml, Haskell, TypeScript
The Results: Clear Winners Emerge
Ruby, Python, and JavaScript dominated with:
- 73–81 seconds total completion time
- $0.36–0.39 average cost
- Low standard deviations (stable performance)

From 4th place onward, variance increased sharply. Go averaged 102 seconds with ±37 seconds of spread. Statically typed languages were consistently 1.4–2.6× slower and more expensive.
Why Dynamic Languages Win with Claude Code
1. Less Setup Overhead
In the v1 phase (starting from empty directory), Python, Ruby, and JavaScript only needed to generate a single minigit file. Languages requiring project config files (Cargo.toml, package.json, etc.) incurred additional overhead. Ruby/Steep took 105.0 seconds — 3.2× slower than plain Ruby (33.2 seconds).
2. Fewer Tokens, Faster Generation
Type annotations consume tokens without necessarily improving Claude's understanding. The experiment found no correlation between fewer lines of code and faster generation. OCaml (216 LOC) and Haskell (224 LOC) were compact but mid-to-low in speed and cost efficiency.
3. More Stable Output
Only 3 out of 600 runs failed (0.5% failure rate). The failures were Rust (2) and Haskell (1). In one Rust failure log, Claude claimed "the tests are wrong" — a clear hallucination. Dynamic languages showed remarkable consistency.
What This Means for Your Claude Code Workflow
For New Projects
When starting fresh with Claude Code, choose Ruby, Python, or JavaScript for:
- Prototyping: Get working code fastest
- Budget-conscious work: Minimize Claude API costs
- Time-sensitive tasks: Reduce iteration cycles

For Existing Codebases
If you're working with statically typed languages:
- Expect longer runtimes: Build in extra time for Claude Code tasks
- Monitor for hallucinations: The Rust failure shows statically typed languages may trigger more edge cases
- Consider hybrid approaches: Use dynamic languages for rapid prototyping, then port to static types
The v2 Insight
In the feature extension phase (v2), the performance gap narrowed. Once a project exists, Claude Code works more efficiently across all languages. This suggests the biggest win comes during initial project setup.
Try This Now: Language Selection Strategy
Add this to your CLAUDE.md:
## Language Selection Guidelines
For fastest Claude Code iteration:
1. **New projects**: Default to Python, Ruby, or JavaScript
2. **Existing codebases**: Work in the existing language, but expect 1.4-2.6x longer runtimes for static types
3. **When type safety matters**: Use Python with mypy or Ruby with Steep as compromise
4. **Avoid**: Starting from scratch with C, OCaml, or Haskell unless absolutely necessary

## Cost Optimization
- Dynamic languages: ~$0.36-0.39 per substantial task
- Static languages: ~$0.50-1.00+ per same task
- Factor this into project estimates
The Bottom Line
This data-driven experiment confirms what many Claude Code users have suspected: dynamic languages are Claude Code's native tongue. The token efficiency, simpler project structures, and Claude's training distribution (heavily weighted toward Python, JavaScript, and Ruby) create a significant performance advantage.
For maximum Claude Code efficiency, default to Python, Ruby, or JavaScript. Save statically typed languages for when their benefits outweigh the 1.4-2.6x time and cost penalty.






