Reduces API costs by more than 50%, produces better and faster work. Uses Hash anchored parallel edits, AST manipulation and a whole lot of neat optimizations. Fully Open Source.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
It is a well studied phenomenon that any given model's reasoning ability degrades with the context length. If we can keep context tightly curated, we improve both accuracy and cost while making larger changes tractable in a single task.
Dirac is an open-source coding agent built with this in mind. It reduces API costs by 64.8% on average while producing better and faster work. Using hash-anchored parallel edits, AST manipulation, and a suite of advanced optimizations. Oh, and no MCP.
Our goal: Optimize for bang-for-the-buck on tooling with bare minimum prompting instead of going blindly minimalistic.
📊 Evals
Dirac is benchmarked against other leading open-source agents on complex, real-world refactoring tasks. Dirac consistently achieves 100% accuracy at a fraction of the cost. These evals are run on public github repos and should be reproducible by anyone.
🏆 TerminalBench 2.0 Leaderboard: Dirac recently topped the Terminal-Bench-2 leaderboard with a 65.2% score using gemini-3-flash-preview. This outperforms both Google's official baseline (47.6%) and the top closed-source agent Junie CLI (64.3%). This was achieved without any benchmark-specific info or any AGENTS.md files being inserted.
Note on the cost table below: A bug was discovered in Cline, the parent repo, after running these evals ([issue #10314](https://github.com/cline/cline/issues/10314)). We have submitted a [PR #10315](https://github.com/cline/cline/pull/10315) to fix this. This bug caused the evals for Dirac and Cline to slightly underreport the numbers ($0.03 vs $0.05 per million token cache read). Although there won't be a large difference, we will update the evals soon.
All tasks for all models used gemini-3-flash-preview with thinking set to high
Cost Comparison: Dirac is 64.8% cheaper than the competition (a 2.8x cost reduction).
* Expected number of files to be modified/created to complete the task.
See evals/README.md for detailed task descriptions and methodology.
🚀 Key Features
Hash-Anchored Edits: Dirac uses stable line hashes to target edits with extreme precision, avoiding the "lost in translation" issues of traditional line-number based editing.
AST-Native Precision: Built-in understanding of language syntax (TypeScript, Python, C++, etc.) allows Dirac to perform structural manipulations like function extraction or class refactoring with 100% accuracy.
Multi-File Batching: Dirac can process and edit multiple files in a single LLM roundtrip, significantly reducing latency and API costs.
High-Bandwidth Context: Optimized context curation keeps the agent lean and fast, ensuring the LLM always has the most relevant information without wasting tokens.
Autonomous Tool Use: Dirac can read/write files, execute terminal commands, use a headless browser, and more - all while keeping you in control with an approval-based workflow.
Skills & AGENTS.md: Customize Dirac's behavior with project-specific instructions using AGENTS.md files. It also seamlessly picks up Claude's skills by automatically reading from .ai, .claude, and .agents directories.
Native Tool Calling Only: To ensure maximum reliability and performance, Dirac exclusively supports models with native tool calling enabled. (Note: MCP is not supported).
Note: Node.js v25 is currently not supported due to an upstream V8 Turboshaft compiler bug that causes out-of-memory crashes during WASM initialization. Please use Node.js v20, v22, or v24 (LTS versions).
🚀 CLI Quick Start
Authenticate:
dirac auth
Run your first task:
dirac "Analyze the architecture of this project"
Configuration (Environment Variables)
You can provide API keys via environment variables to skip the dirac auth step. This is ideal for CI/CD or non-persistent environments.
... and others (see src/shared/storage/env-config.ts for the full list).
Using Any OpenAI compatible endpoint
You can use any OpenAI-compatible provider (e.g., DeepSeek, DeepInfra, OpenRouter, or your own local proxy) by providing the base URL and model ID.
Environment Variables:
OPENAI_API_BASE: Your API base URL (e.g., https://api.deepseek.com/v1).
OPENAI_API_KEY (or OPENAI_COMPATIBLE_CUSTOM_KEY): Your API key.
CUSTOM_HEADERS: Optional custom headers (e.g., "Authorization=Bearer token,X-Account-Id=123" or JSON format).
CLI Example:
# Using environment variables
export OPENAI_API_BASE="https://api.yourprovider.com/v1"
export OPENAI_API_KEY="your-api-key"
export CUSTOM_HEADERS="Authorization=Bearer XXX"
dirac "explain Dirac Delta function" \
# --provider is now optional if OPENAI_API_BASE is set
--model "your-model-id"