Coding Agent singularly focused efficiency and context curation. Reduces API costs by 50-80% vs other agent AND improves the code quality at the same time. Uses Hash Anchored edits, massively parallel operations, AST manipulation and many many other optimizations. https://dirac.run/
1,489
stars
138
commits
TypeScript
primary language
Sep 10, 2026
updated
Dirac topped the Terminal-Bench-2 leaderboard for
gemini-3-flash-previewwith a 65.2% score!
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 line-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.
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 anyAGENTS.mdfiles being inserted.
Note on the cost table below: A bug was discovered in Cline, the parent repo, after running these evals (issue #10314). We have submitted a PR #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
| Task (Repo) | Files* | Cline | Kilo | Ohmypi | Opencode | Pimono | Roo | Dirac |
|---|---|---|---|---|---|---|---|---|
| Task1 (transformers) | 8 | π’ (diff) [$0.37] | π΄ (diff) [N/A] | π‘ (diff) [$0.24] | π’ (diff) [$0.20] | π’ (diff) [$0.34] | π’ (diff) [$0.49] | π’ (diff) [$0.13] |
| Task2 (vscode) | 21 | π’ (diff) [$0.67] | π‘ (diff) [$0.78] | π’ (diff) [$0.63] | π’ (diff) [$0.40] | π’ (diff) [$0.48] | π‘ (diff) [$0.58] | π’ (diff) [$0.23] |
| Task3 (vscode) | 12 | π‘ (diff) [$0.42] | π’ (diff) [$0.70] | π’ (diff) [$0.64] | π’ (diff) [$0.32] | π’ (diff) [$0.25] | π‘ (diff) [$0.45] | π’ (diff) [$0.16] |
| Task4 (django) | 14 | π’ (diff) [$0.36] | π’ (diff) [$0.42] | π‘ (diff) [$0.32] | π’ (diff) [$0.24] | π‘ (diff) [$0.24] | π’ (diff) [$0.17] | π’ (diff) [$0.08] |
| Task5 (vscode) | 3 | π΄ (diff) [N/A] | π’ (diff) [$0.71] | π’ (diff) [$0.43] | π’ (diff) [$0.53] | π’ (diff) [$0.50] | π’ (diff) [$0.36] | π’ (diff) [$0.17] |
| Task6 (transformers) | 25 | π’ (diff) [$0.87] | π‘ (diff) [$1.51] | π’ (diff) [$0.94] | π’ (diff) [$0.90] | π’ (diff) [$0.52] | π’ (diff) [$1.44] | π’ (diff) [$0.34] |
| Task7 (vscode) | 13 | π‘ (diff) [$0.51] | π’ (diff) [$0.77] | π’ (diff) [$0.74] | π’ (diff) [$0.67] | π‘ (diff) [$0.45] | π’ (diff) [$1.05] | π’ (diff) [$0.25] |
| Task8 (transformers) | 3 | π’ (diff) [$0.25] | π’ (diff) [$0.19] | π’ (diff) [$0.17] | π’ (diff) [$0.26] | π’ (diff) [$0.23] | π’ (diff) [$0.29] | π’ (diff) [$0.12] |
| Total Correct | 5/8 | 5/8 | 6/8 | 8/8 | 6/8 | 6/8 | 8/8 | |
| Avg Cost | $0.49 | $0.73 | $0.51 | $0.44 | $0.38 | $0.60 | $0.18 |
π’ Success | π‘ Incomplete | π΄ Failure
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.



AGENTS.md files. It also seamlessly picks up Claude's skills by automatically reading from .ai, .claude, and .agents directories.Install Dirac from the VS Code Marketplace.
Install the Dirac CLI globally using npm:
npm install -g dirac-cli
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).
dirac auth
dirac "Analyze the architecture of this project"
You can provide API keys via environment variables to skip the dirac auth step. This is ideal for CI/CD or non-persistent environments.
For provider-specific setup (e.g. AWS Bedrock, Google Cloud Vertex AI), see the Provider Settings guide.
Common API Keys:
ANTHROPIC_API_KEYOPENAI_API_KEYOPENROUTER_API_KEYGEMINI_API_KEYGROQ_API_KEYMISTRAL_API_KEYXAI_API_KEY (x.ai)HF_TOKEN (HuggingFace)src/shared/storage/env-config.ts for the full list).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"
CLI Flag Example:
dirac "explain Dirac Delta function" \
--provider "https://api.deepseek.com/v1" \
--model "deepseek-v4-pro" \
--headers "X-Custom-Header=Value"
dirac "prompt": Start an interactive task.dirac -p "prompt": Run in Plan Mode to see the strategy before executing.dirac -y "prompt": Yolo Mode (auto-approve all actions, great for simple fixes).git diff | dirac "Review these changes": Pipe context directly into Dirac.dirac history: View and resume previous tasks.dirac --acp: Run Dirac as an ACP agent for editor integration.Dirac can run as an external coding agent in editors that support the Agent Client Protocol (ACP), including JetBrains IDEs and Zed. Installing from the ACP Registry is recommended so the editor can manage the agent package and updates.
Dirac owns its provider configuration independently of the editor. On first use, choose Configure a Dirac provider to enter a provider, model, and API key. ChatGPT sign-in is optional; you can instead use DeepSeek or another supported provider with your own credentials.
For environment-variable setup, manual dirac --acp configuration, and troubleshooting, see the CLI ACP guide.
npm run install:all
npm run protos
npm run compile
npm run lint
Unit tests require the TS_NODE_PROJECT environment variable set to ./tsconfig.unit-test.json. This is because VS Code's test runner requires CommonJS modules while the main project uses ESM.
# Run all tests (unit + integration)
npm test
# Run only unit tests
npm run test:unit
The test:unit script already sets TS_NODE_PROJECT=./tsconfig.unit-test.json automatically. If you need to run mocha directly, set it manually:
TS_NODE_PROJECT=./tsconfig.unit-test.json npx mocha "src/**/__tests__/*.ts" "src/**/*.test.ts"
Dirac is open source and licensed under the Apache License 2.0.
Dirac is a fork of the excellent Cline project. We are grateful to the Cline team and contributors for their foundational work.
Built with β€οΈ by Max Trivedi at Dirac Delta Labs
TypeScript
96.3%
JavaScript
2.0%
Shell
1.0%
Coding Agent singularly focused efficiency and context curation. Reduces API costs by 50-80% vs other agent AND improves the code quality at the same time. Uses Hash Anchored edits, massively parallel operations, AST manipulation and many many other optimizations. https://dirac.run/
1,489
stars
138
commits
TypeScript
primary language
Sep 10, 2026
updated
Dirac topped the Terminal-Bench-2 leaderboard for
gemini-3-flash-previewwith a 65.2% score!
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 line-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.
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 anyAGENTS.mdfiles being inserted.
Note on the cost table below: A bug was discovered in Cline, the parent repo, after running these evals (issue #10314). We have submitted a PR #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
| Task (Repo) | Files* | Cline | Kilo | Ohmypi | Opencode | Pimono | Roo | Dirac |
|---|---|---|---|---|---|---|---|---|
| Task1 (transformers) | 8 | π’ (diff) [$0.37] | π΄ (diff) [N/A] | π‘ (diff) [$0.24] | π’ (diff) [$0.20] | π’ (diff) [$0.34] | π’ (diff) [$0.49] | π’ (diff) [$0.13] |
| Task2 (vscode) | 21 | π’ (diff) [$0.67] | π‘ (diff) [$0.78] | π’ (diff) [$0.63] | π’ (diff) [$0.40] | π’ (diff) [$0.48] | π‘ (diff) [$0.58] | π’ (diff) [$0.23] |
| Task3 (vscode) | 12 | π‘ (diff) [$0.42] | π’ (diff) [$0.70] | π’ (diff) [$0.64] | π’ (diff) [$0.32] | π’ (diff) [$0.25] | π‘ (diff) [$0.45] | π’ (diff) [$0.16] |
| Task4 (django) | 14 | π’ (diff) [$0.36] | π’ (diff) [$0.42] | π‘ (diff) [$0.32] | π’ (diff) [$0.24] | π‘ (diff) [$0.24] | π’ (diff) [$0.17] | π’ (diff) [$0.08] |
| Task5 (vscode) | 3 | π΄ (diff) [N/A] | π’ (diff) [$0.71] | π’ (diff) [$0.43] | π’ (diff) [$0.53] | π’ (diff) [$0.50] | π’ (diff) [$0.36] | π’ (diff) [$0.17] |
| Task6 (transformers) | 25 | π’ (diff) [$0.87] | π‘ (diff) [$1.51] | π’ (diff) [$0.94] | π’ (diff) [$0.90] | π’ (diff) [$0.52] | π’ (diff) [$1.44] | π’ (diff) [$0.34] |
| Task7 (vscode) | 13 | π‘ (diff) [$0.51] | π’ (diff) [$0.77] | π’ (diff) [$0.74] | π’ (diff) [$0.67] | π‘ (diff) [$0.45] | π’ (diff) [$1.05] | π’ (diff) [$0.25] |
| Task8 (transformers) | 3 | π’ (diff) [$0.25] | π’ (diff) [$0.19] | π’ (diff) [$0.17] | π’ (diff) [$0.26] | π’ (diff) [$0.23] | π’ (diff) [$0.29] | π’ (diff) [$0.12] |
| Total Correct | 5/8 | 5/8 | 6/8 | 8/8 | 6/8 | 6/8 | 8/8 | |
| Avg Cost | $0.49 | $0.73 | $0.51 | $0.44 | $0.38 | $0.60 | $0.18 |
π’ Success | π‘ Incomplete | π΄ Failure
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.



AGENTS.md files. It also seamlessly picks up Claude's skills by automatically reading from .ai, .claude, and .agents directories.Install Dirac from the VS Code Marketplace.
Install the Dirac CLI globally using npm:
npm install -g dirac-cli
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).
dirac auth
dirac "Analyze the architecture of this project"
You can provide API keys via environment variables to skip the dirac auth step. This is ideal for CI/CD or non-persistent environments.
For provider-specific setup (e.g. AWS Bedrock, Google Cloud Vertex AI), see the Provider Settings guide.
Common API Keys:
ANTHROPIC_API_KEYOPENAI_API_KEYOPENROUTER_API_KEYGEMINI_API_KEYGROQ_API_KEYMISTRAL_API_KEYXAI_API_KEY (x.ai)HF_TOKEN (HuggingFace)src/shared/storage/env-config.ts for the full list).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"
CLI Flag Example:
dirac "explain Dirac Delta function" \
--provider "https://api.deepseek.com/v1" \
--model "deepseek-v4-pro" \
--headers "X-Custom-Header=Value"
dirac "prompt": Start an interactive task.dirac -p "prompt": Run in Plan Mode to see the strategy before executing.dirac -y "prompt": Yolo Mode (auto-approve all actions, great for simple fixes).git diff | dirac "Review these changes": Pipe context directly into Dirac.dirac history: View and resume previous tasks.dirac --acp: Run Dirac as an ACP agent for editor integration.Dirac can run as an external coding agent in editors that support the Agent Client Protocol (ACP), including JetBrains IDEs and Zed. Installing from the ACP Registry is recommended so the editor can manage the agent package and updates.
Dirac owns its provider configuration independently of the editor. On first use, choose Configure a Dirac provider to enter a provider, model, and API key. ChatGPT sign-in is optional; you can instead use DeepSeek or another supported provider with your own credentials.
For environment-variable setup, manual dirac --acp configuration, and troubleshooting, see the CLI ACP guide.
npm run install:all
npm run protos
npm run compile
npm run lint
Unit tests require the TS_NODE_PROJECT environment variable set to ./tsconfig.unit-test.json. This is because VS Code's test runner requires CommonJS modules while the main project uses ESM.
# Run all tests (unit + integration)
npm test
# Run only unit tests
npm run test:unit
The test:unit script already sets TS_NODE_PROJECT=./tsconfig.unit-test.json automatically. If you need to run mocha directly, set it manually:
TS_NODE_PROJECT=./tsconfig.unit-test.json npx mocha "src/**/__tests__/*.ts" "src/**/*.test.ts"
Dirac is open source and licensed under the Apache License 2.0.
Dirac is a fork of the excellent Cline project. We are grateful to the Cline team and contributors for their foundational work.
Built with β€οΈ by Max Trivedi at Dirac Delta Labs
TypeScript
96.3%
JavaScript
2.0%
Shell
1.0%