Prefill
A model processes every input token before it answers; you pay for each one and wait for it. dctx answers with exact spans inside an estimated token budget, never whole files by default.
dctx is the context engine for AI-assisted software development. It gives a model the fewest, most relevant bytes of your source code, in an order that stays the same between turns: smaller prompts, prompt caches that hit, and answers built on exact source instead of guesses.
Measured on one Linux x86_64 machine; details and caveats in the benchmark and the stability report.
dctx exists to cut all three costs. The specification turns that belief into five testable constraints: every answer is bounded, deterministic, prefix-stable, non-redundant and honest about its precision.
A model processes every input token before it answers; you pay for each one and wait for it. dctx answers with exact spans inside an estimated token budget, never whole files by default.
Providers serve a repeated prompt prefix for a fraction of the price, but one changed byte breaks it. The same tree and question give dctx the same bytes, and an unrelated edit leaves map answers unchanged.
Answers get worse as irrelevant tokens pile up. dctx ranks syntax-owned spans, never cuts a record in half, and labels every answer with its precision and freshness.
The command line, the MCP server, the library and the desktop preview share one core, one privacy boundary and the same output.
Ten verbs (map, find, neighbors, explain, read, skeleton, grep, hubs, path, export) with stable ids, cursor paging and lexical call and import edges. Up to 2,000 estimated tokens per answer.
A stdio MCP server exposes the map verbs as tools, so any MCP-capable agent can query the same bounded, deterministic answers.
The whole project, or only what changed, as one structured block on stdout or the clipboard. Tree lines carry no timestamps, so a bare touch leaves the page byte-identical.
No chunking, no vector store. dctx answers from a lexical graph of syntax-owned spans and verifies source bytes before it emits them.
Plugin distribution and index verification use Ed25519 signatures. Plugins run out of process with explicit capabilities and consent.
The same engine in a window, for people who prefer one. Free for everyone, including companies. Preview, source only: there is no download yet, so build it from the repository.
Full (symbols and lexical call edges): Rust, JavaScript, TypeScript/TSX, Python, Go, Java, C/C++, C#, Kotlin, Ruby, PHP, Swift, Vue/Svelte/Astro/HTML script blocks, Scala, Dart, Zig, Solidity, Gleam, Fortran, Perl, Groovy, PowerShell, Elixir, Lua, OCaml, R, Julia, Haskell, Erlang, Verilog/SystemVerilog, Terraform/HCL, SQL, Clojure, Common Lisp, Scheme, Emacs Lisp.
Outline (symbols only): JSON/JSONC/TOML/YAML, Shell, Makefile, Dockerfile, Protobuf, Pascal, GraphQL, Nix.
Docs (headed sections): Markdown, plain text, reStructuredText, AsciiDoc, Org, LaTeX.
Call edges come from names, scopes and imports, never from a type checker; heuristic families are labelled guess. Run dctx languages for the tier and confidence of every format.
dctx needs a recent stable Rust toolchain with Cargo. Linux x86_64 is the only tested platform; macOS and Windows builds are untested. There is no crates.io package or prebuilt binary yet.
$ git clone https://github.com/Eris-Margeta/dctx
$ cd dctx
$ cargo build --locked --release -p dctx-cli
$ alias dctx="$PWD/target/release/dctx-cli"The built executable is named dctx-cli; the alias lets you type dctx. cargo install --locked --path crates/dctx-cli installs it into Cargo's bin directory instead.
$ dctx pack . # whole project as one context block
$ dctx pack . --clipboard # straight to the clipboard
$ dctx . -d -c # only what changed since the last snapshot$ dctx map find "SnapshotConfig"
$ dctx map read 's:crates/dctx-cli/src/lib.rs#SnapshotConfig' --json
$ dctx mcp # stdio MCP server with the map verbs as toolsIds come from map and find. See the map mode guide for every verb.
Run 7 on 31 October 2026, against Trail-Code 0.28.0 and graphify 0.9.97 in code-only mode. Tokens are estimated as stdout bytes / 3.5 for every tool.
| Tool | Points /140 | Gold facts /354 | Tokens | Tool calls |
|---|---|---|---|---|
dctx 53f8b6b | 140 | 353 | 29,340 | 105 |
| Trail-Code 0.28.0 | 122 | 312 | 88,923 | 70 |
| graphify 0.9.97, code-only | 96 | 238 | 197,203 | 91 |
Read this before quoting the table. The protocol was designed by the dctx team, so it can favour dctx. An independently selected protocol (repositories picked by seed, gold answers from language servers, questions written without seeing dctx output) is pending, and its result will be published whatever it shows.
dctx took 0.13–1.20 s on the six corpora (median of three runs), against 1.04–52.83 s for Trail-Code and 4.59–59.56 s for graphify, on an Intel Xeon E5-2680 v2 runner.
On 6 November 2026, 33/33 text and 33/33 JSON answers stayed identical after unrelated comment edits across three pinned corpora, and over five runs.
Questions, gold facts, scorer, raw results and scripts: benchmark write-up · raw data · stability report.
Selection happens before any byte is read, hashed, parsed or cached, and is checked again before output leaves the engine.
The release check counts network connect and send calls under strace -f for every map verb, pack, cache status and mcp, and fails on any. dctx decides by file name: a secret pasted into an ordinary source file is not detected.
.gitignore, .dctxignore and a global ignore exclude files before they are opened; .dctxomitcontent lists a file without reading it..git is closed. Never listed or read by the map verbs, never read by pack.O_NOFOLLOW; symlinked directories are never entered.dctx is Apache-2.0, including for commercial use. No feature is held back behind a paid edition. Companies that depend on it can fund security response times and long-term support through a maintenance agreement.
dctx started in 2025 as dircontxt, written in pure C, to give a model the whole project in one structured, versioned block. It was rewritten in Rust in 2026 and grew a privacy-first core, a plugin host, a desktop app and map mode for agents.