p.enthalabs

GitHub - dirac-run/dirac: Coding Agent singularly focused efficiency and context curation. Reduces API costs by 50-80% vs other agent AND improves the code qual

GitHub - dirac-run/dirac: 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/ Β· GitHub

Skip to content

Navigation Menu

Toggle navigation

[](https://github.com/)

Sign in

Appearance settings

* Platform

* AI CODE CREATION

- GitHub Copilot Write better code with AI

- GitHub Spark Build and deploy intelligent apps

- GitHub Models Manage and compare prompts

- MCP Registry New Integrate external tools

* DEVELOPER WORKFLOWS

- Actions Automate any workflow

- Codespaces Instant dev environments

- Issues Plan and track work

- Code Review Manage code changes

* APPLICATION SECURITY

- GitHub Advanced Security Find and fix vulnerabilities

- Code security Secure your code as you build

- Secret protection Stop leaks before they start

* EXPLORE

- Why GitHub

- Documentation

- Blog

- Changelog

- Marketplace

View all features

* Solutions

* BY COMPANY SIZE

- Enterprises

- Small and medium teams

- Startups

- Nonprofits

* BY USE CASE

- App Modernization

- DevSecOps

- DevOps

- CI/CD

- View all use cases

* BY INDUSTRY

- Healthcare

- Financial services

- Manufacturing

- Government

- View all industries

View all solutions

* Resources

* EXPLORE BY TOPIC

- AI

- Software Development

- DevOps

- Security

- View all topics

* EXPLORE BY TYPE

- Customer stories

- Events & webinars

- Ebooks & reports

- Business insights

- GitHub Skills

* SUPPORT & SERVICES

- Documentation

- Customer support

- Community forum

- Trust center

- Partners

View all resources

* Open Source

* COMMUNITY

- GitHub Sponsors Fund open source developers

* PROGRAMS

- Security Lab

- Maintainer Community

- Accelerator

- GitHub Stars

- Archive Program

* REPOSITORIES

- Topics

- Trending

- Collections

* Enterprise

* ENTERPRISE SOLUTIONS

- Enterprise platform AI-powered developer platform

* AVAILABLE ADD-ONS

- GitHub Advanced Security Enterprise-grade security features

- Copilot for Business Enterprise-grade AI features

- Premium Support Enterprise-grade 24/7 support

- Pricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback

We read every piece of feedback, and take your input very seriously.

- [x] Include my email address so I can be contacted

Cancel Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

{{ message }}

dirac-run/**dirac**Public

- NotificationsYou must be signed in to change notification settings

- Fork 42

- Star 922

- Code

- Issues 7

- Pull requests 0

- Actions

- Projects

- Security and quality 0

- Insights

Additional navigation options

- Code

- Issues

- Pull requests

- Actions

- Projects

- Security and quality

- Insights

[](https://github.com/dirac-run/dirac)

dirac-run/dirac

master

BranchesTags

[](https://github.com/dirac-run/dirac/branches)[](https://github.com/dirac-run/dirac/tags)

Go to file

Code

Open more actions menu

Folders and files

| Name | Name | Last commit message | Last commit date | | --- | --- | --- | --- | | ## Latest commit ## History 228 Commits [](https://github.com/dirac-run/dirac/commits/master/)228 Commits |

| [.github/workflows](https://github.com/dirac-run/dirac/tree/master/.github/workflows "This path skips through empty directories") | [.github/workflows](https://github.com/dirac-run/dirac/tree/master/.github/workflows "This path skips through empty directories") | | | | [.vscode](https://github.com/dirac-run/dirac/tree/master/.vscode ".vscode") | [.vscode](https://github.com/dirac-run/dirac/tree/master/.vscode ".vscode") | | | | [agent-registry](https://github.com/dirac-run/dirac/tree/master/agent-registry "agent-registry") | [agent-registry](https://github.com/dirac-run/dirac/tree/master/agent-registry "agent-registry") | | | | [assets](https://github.com/dirac-run/dirac/tree/master/assets "assets") | [assets](https://github.com/dirac-run/dirac/tree/master/assets "assets") | | | | [cli](https://github.com/dirac-run/dirac/tree/master/cli "cli") | [cli](https://github.com/dirac-run/dirac/tree/master/cli "cli") | | |

| [docs/providers](https://github.com/dirac-run/dirac/tree/master/docs/providers "This path skips through empty directories") | [docs/providers](https://github.com/dirac-run/dirac/tree/master/docs/providers "This path skips through empty directories") | | | | [evals](https://github.com/dirac-run/dirac/tree/master/evals "evals") | [evals](https://github.com/dirac-run/dirac/tree/master/evals "evals") | | | | [locales](https://github.com/dirac-run/dirac/tree/master/locales "locales") | [locales](https://github.com/dirac-run/dirac/tree/master/locales "locales") | | | | [proto](https://github.com/dirac-run/dirac/tree/master/proto "proto") | [proto](https://github.com/dirac-run/dirac/tree/master/proto "proto") | | | | [scripts](https://github.com/dirac-run/dirac/tree/master/scripts "scripts") | [scripts](https://github.com/dirac-run/dirac/tree/master/scripts "scripts") | | | | [src](https://github.com/dirac-run/dirac/tree/master/src "src") | [src](https://github.com/dirac-run/dirac/tree/master/src "src") | | |

| [standalone/runtime-files](https://github.com/dirac-run/dirac/tree/master/standalone/runtime-files "This path skips through empty directories") | [standalone/runtime-files](https://github.com/dirac-run/dirac/tree/master/standalone/runtime-files "This path skips through empty directories") | | | | [walkthrough](https://github.com/dirac-run/dirac/tree/master/walkthrough "walkthrough") | [walkthrough](https://github.com/dirac-run/dirac/tree/master/walkthrough "walkthrough") | | | | [webview-ui](https://github.com/dirac-run/dirac/tree/master/webview-ui "webview-ui") | [webview-ui](https://github.com/dirac-run/dirac/tree/master/webview-ui "webview-ui") | | | | [.gitignore](https://github.com/dirac-run/dirac/blob/master/.gitignore ".gitignore") | [.gitignore](https://github.com/dirac-run/dirac/blob/master/.gitignore ".gitignore") | | | | [.mocharc.json](https://github.com/dirac-run/dirac/blob/master/.mocharc.json ".mocharc.json") | [.mocharc.json](https://github.com/dirac-run/dirac/blob/master/.mocharc.json ".mocharc.json") | | | | [.nvmrc](https://github.com/dirac-run/dirac/blob/master/.nvmrc ".nvmrc") | [.nvmrc](https://github.com/dirac-run/dirac/blob/master/.nvmrc ".nvmrc") | | | | [.nycrc.unit.json](https://github.com/dirac-run/dirac/blob/master/.nycrc.unit.json ".nycrc.unit.json") | [.nycrc.unit.json](https://github.com/dirac-run/dirac/blob/master/.nycrc.unit.json ".nycrc.unit.json") | | | | [.vscode-test.mjs](https://github.com/dirac-run/dirac/blob/master/.vscode-test.mjs ".vscode-test.mjs") | [.vscode-test.mjs](https://github.com/dirac-run/dirac/blob/master/.vscode-test.mjs ".vscode-test.mjs") | | | | [.vscodeignore](https://github.com/dirac-run/dirac/blob/master/.vscodeignore ".vscodeignore") | [.vscodeignore](https://github.com/dirac-run/dirac/blob/master/.vscodeignore ".vscodeignore") | | | | [AGENTS.md](https://github.com/dirac-run/dirac/blob/master/AGENTS.md "AGENTS.md") | [AGENTS.md](https://github.com/dirac-run/dirac/blob/master/AGENTS.md "AGENTS.md") | | | | [CONTRIBUTING.md](https://github.com/dirac-run/dirac/blob/master/CONTRIBUTING.md "CONTRIBUTING.md") | [CONTRIBUTING.md](https://github.com/dirac-run/dirac/blob/master/CONTRIBUTING.md "CONTRIBUTING.md") | | | | [LICENSE](https://github.com/dirac-run/dirac/blob/master/LICENSE "LICENSE") | [LICENSE](https://github.com/dirac-run/dirac/blob/master/LICENSE "LICENSE") | | | | [README.md](https://github.com/dirac-run/dirac/blob/master/README.md "README.md") | [README.md](https://github.com/dirac-run/dirac/blob/master/README.md "README.md") | | | | [biome.jsonc](https://github.com/dirac-run/dirac/blob/master/biome.jsonc "biome.jsonc") | [biome.jsonc](https://github.com/dirac-run/dirac/blob/master/biome.jsonc "biome.jsonc") | | | | [buf.yaml](https://github.com/dirac-run/dirac/blob/master/buf.yaml "buf.yaml") | [buf.yaml](https://github.com/dirac-run/dirac/blob/master/buf.yaml "buf.yaml") | | | | [esbuild.mjs](https://github.com/dirac-run/dirac/blob/master/esbuild.mjs "esbuild.mjs") | [esbuild.mjs](https://github.com/dirac-run/dirac/blob/master/esbuild.mjs "esbuild.mjs") | | | | [knip.json](https://github.com/dirac-run/dirac/blob/master/knip.json "knip.json") | [knip.json](https://github.com/dirac-run/dirac/blob/master/knip.json "knip.json") | | | | [package-lock.json](https://github.com/dirac-run/dirac/blob/master/package-lock.json "package-lock.json") | [package-lock.json](https://github.com/dirac-run/dirac/blob/master/package-lock.json "package-lock.json") | | | | [package.json](https://github.com/dirac-run/dirac/blob/master/package.json "package.json") | [package.json](https://github.com/dirac-run/dirac/blob/master/package.json "package.json") | | | | [tsconfig.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.json "tsconfig.json") | [tsconfig.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.json "tsconfig.json") | | | | [tsconfig.test.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.test.json "tsconfig.test.json") | [tsconfig.test.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.test.json "tsconfig.test.json") | | |

| [tsconfig.unit-test.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.unit-test.json "tsconfig.unit-test.json") | [tsconfig.unit-test.json](https://github.com/dirac-run/dirac/blob/master/tsconfig.unit-test.json "tsconfig.unit-test.json") | | | | [update_models.js](https://github.com/dirac-run/dirac/blob/master/update_models.js "update_models.js") | [update_models.js](https://github.com/dirac-run/dirac/blob/master/update_models.js "update_models.js") | | | | View all files |

Repository files navigation

- README

- Contributing

- Apache-2.0 license

Dirac - Accurate & Highly Token Efficient Open Source AI Agent

[](https://github.com/dirac-run/dirac#dirac---accurate--highly-token-efficient-open-source-ai-agent)

> **Dirac topped the Terminal-Bench-2 leaderboard for `gemini-3-flash-preview` with 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 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

[](https://github.com/dirac-run/dirac#-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). 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.

πŸš€ Key Features

[](https://github.com/dirac-run/dirac#-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. ![Image 1: Hash-Anchored Edits](https://camo.githubusercontent.com/7c2146782e5ad29e647e51a95f9290c4e5eba1214d0a736d571de7f55cf7a98b/68747470733a2f2f7777772e64697261632e72756e2f7374617469632f696d616765732f6d756c7469706c655f656469742e706e67)

- **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. ![Image 2: AST-Native Precision](https://camo.githubusercontent.com/37d1ad7e29ec1d50a714d80c7d60cf27efbf61514c449b48a0e0948245792a92/68747470733a2f2f7777772e64697261632e72756e2f7374617469632f696d616765732f706172616c6c656c5f4153545f656469742e706e67)

- **Multi-File Batching**: Dirac can process and edit multiple files in a single LLM roundtrip, significantly reducing latency and API costs. ![Image 3: Multi-File Batching](https://camo.githubusercontent.com/17195a2ee334a899e41d17267152feae6df9bb8459a4fac440f063206c4e7ede/68747470733a2f2f7777772e64697261632e72756e2f7374617469632f696d616765732f6d756c74695f66756e6374696f6e5f726561642e706e67)

- **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).

πŸ“¦ Installation

[](https://github.com/dirac-run/dirac#-installation)

VS Code Extension

[](https://github.com/dirac-run/dirac#vs-code-extension)

Install Dirac from the VS Code Marketplace.

CLI (Terminal)

[](https://github.com/dirac-run/dirac#cli-terminal)

Install the Dirac CLI globally using npm:

undefinedshell npm install -g dirac-cli undefined

> **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

[](https://github.com/dirac-run/dirac#-cli-quick-start)

1. **Authenticate**:

undefinedshell dirac auth undefined

2. **Run your first task**:

undefinedshell dirac "Analyze the architecture of this project" undefined

Configuration (Environment Variables)

[](https://github.com/dirac-run/dirac#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.

For provider-specific setup (e.g. AWS Bedrock, Google Cloud Vertex AI), see the Provider Settings guide.

Common API Keys:

- `ANTHROPIC_API_KEY`

- `OPENAI_API_KEY`

- `OPENROUTER_API_KEY`

- `GEMINI_API_KEY`

- `GROQ_API_KEY`

- `MISTRAL_API_KEY`

- `XAI_API_KEY` (x.ai)

- `HF_TOKEN` (HuggingFace)

- ... and others (see `src/shared/storage/env-config.ts` for the full list).

#### Using Any OpenAI compatible endpoint

[](https://github.com/dirac-run/dirac#using-any-openai-compatible-endpoint)

You can use OPENAI_COMPATIBLE_CUSTOM_KEY (or its alias OPENAI_API_BASE) for any provider and model as long as it exposes an OpenAI compatible endpoint. Using these variables requires providing both the model and the provider in the cli

`$ OPENAI_API_BASE="xxx" dirac -y --provider "https://api.deepseek.com/v1" --model deepseek-v4-flash "explain Dirac Delta function"`

Common Commands

[](https://github.com/dirac-run/dirac#common-commands)

- `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.

πŸ› οΈ Getting Started

[](https://github.com/dirac-run/dirac#%EF%B8%8F-getting-started)

1. Open the Dirac sidebar in VS Code. 2. Configure your preferred AI provider (Anthropic, OpenAI, OpenRouter, etc.). 3. Start a new task by describing what you want to build or fix. 4. Watch Dirac go!

πŸ“ˆ Star History

[](https://github.com/dirac-run/dirac#-star-history)

![Image 4: Star History Chart](https://star-history.com/#dirac-run/dirac&Date)

πŸ“„ License

[](https://github.com/dirac-run/dirac#-license)

Dirac is **open source** and licensed under the Apache License 2.0.

🀝 Acknowledgments

[](https://github.com/dirac-run/dirac#-acknowledgments)

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

About

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/

Resources

Readme

License

Apache-2.0 license

Contributing

Contributing

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

**922** stars

Watchers

**3** watching

Forks

**42** forks

Report repository

Releases

No releases published

Packages 0

Uh oh!

There was an error while loading. Please reload this page.

Contributors

* * *

Uh oh!

There was an error while loading. Please reload this page.

Languages

- TypeScript 95.9%

- JavaScript 2.8%

- Shell 0.7%

- CSS 0.4%

- Roff 0.2%

- Python 0.0%

Footer

[](https://github.com/) Β© 2026 GitHub,Inc.

Footer navigation

- Terms

- Privacy

- Security

- Status

- Community

- Docs

- Contact

- Manage cookies

- Do not share my personal information

You can’t perform that action at this time.