Context, engineered.

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.

Diagram: many file nodes of a code tree flow into one compact, stable block of tokens, labelled deterministic bytes and stable prefix.

dctx at a glance

140/140
points on our 70-question protocol, against Trail-Code 122 and graphify 96.
0.13–1.20 s
cold index of six benchmark corpora (median of three runs).
50
language families: 36 full, 8 outline, 6 documentation formats.
33/33
text and 33/33 JSON answers byte-identical after unrelated edits.
0
network calls. No telemetry, and dctx never calls a model.

Measured on one Linux x86_64 machine; details and caveats in the benchmark and the stability report.

Why dctx

Every token in front of a model is paid for three times.

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.

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.

Cache misses

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.

Attention

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.

What you get

One engine for every way software is built.

The command line, the MCP server, the library and the desktop preview share one core, one privacy boundary and the same output.

dctx map

Map mode for agents

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.

dctx mcp

MCP server

A stdio MCP server exposes the map verbs as tools, so any MCP-capable agent can query the same bounded, deterministic answers.

dctx pack

Whole-project context

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 embeddings

Zero RAG defects

No chunking, no vector store. dctx answers from a lexical graph of syntax-owned spans and verifies source bytes before it emits them.

Ed25519

Verified plugins and index

Plugin distribution and index verification use Ed25519 signatures. Plugins run out of process with explicit capabilities and consent.

Preview · 0.11

dctx Desktop

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.

Supported languages: 36 full, 8 outline, 6 documentation formats

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.

Install

Build it from source in a minute.

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.

  1. Build the CLI

    zsh
    $ 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.

  2. Pack a project for a chat assistant

    zsh
    $ 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
  3. Give an agent a map

    zsh
    $ 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 tools

    Ids come from map and find. See the map mode guide for every verb.

Measured in the open

More correct answers, with fewer tokens.

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.

70-question protocol, six pinned corpora, one Linux x86_64 runner
ToolPoints /140Gold facts /354TokensTool calls
dctx 53f8b6b14035329,340105
Trail-Code 0.28.012231288,92370
graphify 0.9.97, code-only96238197,20391

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.

Cold index

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.

Byte stability

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.

Security and privacy

Ignored means never read.

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.

  • Ignore rules first. .gitignore, .dctxignore and a global ignore exclude files before they are opened; .dctxomitcontent lists a file without reading it.
  • A built-in deny with no override. Env files, private keys, credential and secrets files are listed by name but never read.
  • .git is closed. Never listed or read by the map verbs, never read by pack.
  • No symlink escapes. Files open with O_NOFOLLOW; symlinked directories are never entered.
  • Local only. No telemetry, no model calls, no network for pack and map.
Open source

Free for any use. Paid maintenance keeps it healthy.

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.

Where it comes from

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.

Read the changelog