Skip to main content

Dual-Graph — Compounding Context for Claude Code & Codex CLI

A context engine that makes Claude Code and Codex CLI 30-45% cheaper without sacrificing quality. It builds a semantic graph of your codebase and pre-loads the right files into every prompt — so Claude spends tokens reasoning, not exploring.

Works on macOS, Linux, and Windows. Supports any project size.

Join the community: discord.gg/ptyr7KJz


How It Works

You run: dgc /path/to/project
         ↓
1. Project scanned → semantic graph built (files, symbols, imports)
2. You ask a question
3. Graph identifies the relevant files → packs them into context
4. Claude gets your question + the right code already loaded
5. Fewer turns, fewer tokens, better answers

Token savings compound across a session. The graph remembers which files were read, edited, and queried — each turn gets cheaper.


Results

Benchmarked across 80+ prompts (5 complexity levels) on a real-world full-stack app:

Metric Without Dual-Graph With Dual-Graph
Avg cost per prompt $0.46 $0.27
Avg turns 16.8 10.3
Avg response time 186s 134s
Quality (regex scorer) 82.7/100 87.1/100

Cost wins on 16 out of 20 prompts. Quality equal or better on all complexity levels.


Install

macOS / Linux:

curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash
source ~/.zshrc   # or ~/.bashrc / ~/.profile

Windows (PowerShell):

irm https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.ps1 | iex

Windows (Scoop):

scoop bucket add dual-graph https://github.com/kunal12203/scoop-dual-graph
scoop install dual-graph

Prerequisites: Python 3.10+, Node.js 18+, Claude Code or Codex CLI. The installer detects missing tools and offers to install them via winget (Windows) or homebrew (macOS).


Usage

Claude Code (dgc)

dgc                              # scan current directory, launch Claude
dgc /path/to/project             # scan a specific project
dgc /path/to/project "fix the login bug"   # start with a prompt

Codex CLI (dg)

dg                               # scan current directory, launch Codex
dg /path/to/project              # scan a specific project
dg /path/to/project "add tests"  # start with a prompt

Windows

dgc .                            # from inside the project directory
dgc "D:\projects\my-app"         # any drive, any path
dg "C:\work\backend"             # Codex CLI

What It Does Under the Hood

  1. Scans your project — extracts files, functions, classes, import relationships into a local graph.
  2. Pre-loads context — when you ask a question, the graph ranks relevant files and packs them into the prompt before Claude sees it. No extra tool calls needed.
  3. Remembers across turns — files you've read or edited are prioritized in future turns. Context compounds.
  4. MCP tools available — Claude can still explore the codebase via graph-aware tools (graph_read, graph_retrieve, graph_neighbors, etc.) when it needs to go deeper.

All processing is local. No code leaves your machine.


Data & Files

All data lives in <project>/.dual-graph/ (gitignored automatically).

File Description
info_graph.json Semantic graph of the project: files, symbols, edges
chat_action_graph.json Session memory: reads, edits, queries, decisions
context-store.json Persistent store for decisions/tasks/facts across sessions
mcp_server.log MCP server logs

Global files in ~/.dual-graph/:

File Description
dgc.ps1 / dg.ps1 Launcher scripts (auto-updated)
venv/ Python virtual environment for dependencies
version.txt Current installed version

Configuration

All optional, via environment variables:

Variable Default Description
DG_HARD_MAX_READ_CHARS 4000 Max characters per file read
DG_TURN_READ_BUDGET_CHARS 18000 Total read budget per turn
DG_FALLBACK_MAX_CALLS_PER_TURN 1 Max fallback grep calls per turn
DG_RETRIEVE_CACHE_TTL_SEC 900 Retrieval cache TTL (15 min)
DG_MCP_PORT auto (8080-8099) Force a specific MCP server port

Context Store

Decisions, tasks, and facts from your sessions are persisted in .dual-graph/context-store.json and re-injected at the start of the next session. This gives Claude continuity across conversations.

You can also create a CONTEXT.md in your project root for free-form session notes.


Token Tracking

A token-counter dashboard is registered automatically with Claude Code:

http://localhost:8899

Usage from inside a Claude session:

count_tokens({text: "<content>"})   # estimate tokens before reading
get_session_stats()                  # running session cost

Self-Update

The launcher checks for updates on every run and auto-updates if a new version is available. No manual intervention needed.

Current version: 3.8.55


Privacy & Security

  • All project data stays local. Graphs, session data, and code never leave your machine.
  • The only outbound calls are:
    • Version check — fetches a version string (no project data).
    • Heartbeat — sends machine_id and platform only. No file names, no code.
    • One-time feedback — optional rating after first day of use.
  • .dual-graph/ is automatically added to .gitignore.

Community

Have a question, found a bug, or want to share feedback?

Join the Discord: discord.gg/ptyr7KJz

  • Get help with setup
  • Report bugs
  • Share workflows
  • Follow releases

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graperoot-3.10.19.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

graperoot-3.10.19-cp313-cp313-win_amd64.whl (773.1 kB view details)

Uploaded CPython 3.13Windows x86-64

graperoot-3.10.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

graperoot-3.10.19-cp313-cp313-macosx_26_0_arm64.whl (937.2 kB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

graperoot-3.10.19-cp312-cp312-win_amd64.whl (773.4 kB view details)

Uploaded CPython 3.12Windows x86-64

graperoot-3.10.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

graperoot-3.10.19-cp312-cp312-macosx_26_0_arm64.whl (941.5 kB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

graperoot-3.10.19-cp311-cp311-win_amd64.whl (826.4 kB view details)

Uploaded CPython 3.11Windows x86-64

graperoot-3.10.19-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

graperoot-3.10.19-cp311-cp311-macosx_26_0_arm64.whl (933.9 kB view details)

Uploaded CPython 3.11macOS 26.0+ ARM64

graperoot-3.10.19-cp310-cp310-win_amd64.whl (826.2 kB view details)

Uploaded CPython 3.10Windows x86-64

graperoot-3.10.19-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file graperoot-3.10.19.tar.gz.

File metadata

  • Download URL: graperoot-3.10.19.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for graperoot-3.10.19.tar.gz
Algorithm Hash digest
SHA256 426a76fc77943caea63fc319f367cbbff53d7ec5a9048170380e6c541141920b
MD5 42adbec6f910cec5245f73e1002bdaab
BLAKE2b-256 886527636097ba591a3181684fb607798cdbf3b8d9bae4d3f1dee0965f8b1f31

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a0fd43ef3d534d93a67904f37cea9a2f7f41ed95de4627a56fbe8c36198d092
MD5 01be84d8e0540701e6f7a736c80d9896
BLAKE2b-256 229f8f13e70ba5f236ca9153c59d1bad3ea2321fda9f71a6747e32cf5bb6bd84

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b5deb3c4e467ce8fbb3f91cf70437844ea143e7b55a278843dd2b45c3732d037
MD5 751826497116e4bff72a97175a9d7809
BLAKE2b-256 7f695e5fb2d389d3ba159a8102b5af9144a9518a7d1c4dec7406f6007aa68af1

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 f134cbbd13b8fc0965633a391bc96997ca9b707af82e514da27ccb22f261ed3c
MD5 61980bd98218c3d064953fff1f88e36a
BLAKE2b-256 7dd2555f8d60c8264e7c4aaf9ac7eb8cf151b475ed49ce85880fd3fc55f8da4f

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 52d57248dc0a172ec1853b416af37e4b026eed4c16f5adac758f422f9b3673e0
MD5 2c981918909ec4ba833f8dd323af1718
BLAKE2b-256 53dd85cedba910c2c547a007a4683ae14424271871284b3cc98e24f38c8d0a70

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 15e81d9468e16fa43b57add7473dcc364807e7eab31a1a3f9def7cb969760784
MD5 09af9aad4ece2faf07d360e82596b1ea
BLAKE2b-256 4ecffb6b553522547bb1c0011b3ca1279042754f11b8ffce31ab5b37fd8ef25e

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 ec0343b93f422986d0c7fcfdb996103d026a2eb2772cccc20b75fc5294cd3f33
MD5 5b780ca0053a2408437cd28afe4f0ab9
BLAKE2b-256 7791159d53a6219cf06aad3716b88f855fd224eec6f078f62214faaede4ecc8a

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c71dc9e443258ed992e5177d1ccf0258b84b87ffc4db977dfafe45b1dd7ed58d
MD5 3b9905a56a05bcc7ba72f999ddbc420b
BLAKE2b-256 98311900beb0df1390cf6baf9e475e26d1c8b7c69c78393a1f0456bd98327ac0

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 338a86bd0ec4a4132eb8cf3b8128818e059ad0754499738057aab8ff332b7825
MD5 f774d45e77dcb3c4a1bfa5a8f17d3b90
BLAKE2b-256 122594e2c8c07f22ecbb9103bd53db991df54befc45f23fbf2c05b8454c8cc1b

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp311-cp311-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp311-cp311-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 ceba0680dd5ee8495a2cdaf86d0454d453ce3589f10d8a2fe8d411ff21efbb11
MD5 1c4afe413e7a03862ac860aa77960d2e
BLAKE2b-256 5f2daf99c073b2b3f8d24a65c5a75f17f15baeddfd7401e512c27e5afac8aba0

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 79f9b5ed7df98f062f8645bb2e278e395b277f99f16541b5c6fb374b0257c03f
MD5 e833bdf2152017d983fa87b90382b783
BLAKE2b-256 894c3cae87aa6443af06bab44aaaaf34a4e2f6bbeed3e0d132f0916d425727c6

See more details on using hashes here.

File details

Details for the file graperoot-3.10.19-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for graperoot-3.10.19-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6d90b63f58dd7bc306784e9b2b12d86c32058bd407b533eecc321cb5f92769dc
MD5 124dda05b17e916c4f3f1b38770fe4e7
BLAKE2b-256 4786e38e904ebc808fd46e864966c30559fcb82c78dc457b70c07e7ecd80de80

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.10.19 This release

12 files

3.10.10

23 files

3.10.8

1 file

3.10.1

25 files

3.9.95

25 files

3.9.92

26 files

3.9.90

25 files

3.9.86

24 files

3.9.85

20 files

3.9.84

6 files

3.9.83

2 files

3.9.82

22 files

3.9.80

13 files

3.9.78

1 file

3.9.74

3 files

3.9.73

3 files

3.9.72

1 file

3.9.69

1 file

3.9.67

3 files

3.9.66

2 files

3.9.65

2 files

3.9.64

2 files

3.9.63

2 files

3.9.62

2 files

3.9.61

2 files

3.9.60

2 files

3.9.59

2 files

3.9.58

2 files

3.9.57

2 files

3.9.56

2 files

3.9.55

2 files

3.9.54

2 files

3.9.53

2 files

3.9.52

2 files

3.9.51

2 files

3.9.50

1 file

3.9.49

1 file

3.9.48

2 files

3.9.47

2 files

3.9.46

2 files

3.9.45

2 files

3.9.44

2 files

3.9.43

2 files

3.9.42

2 files

3.9.41

2 files

3.9.40

2 files

3.9.39

2 files

3.9.38

2 files

3.9.37

1 file

3.9.36

1 file

3.9.35

2 files

3.9.34

2 files

3.9.31

2 files

3.9.30

2 files

3.9.29

2 files

3.9.28

2 files

3.9.27

1 file

3.9.26

2 files

3.9.25

1 file

3.9.24

1 file

3.9.23

1 file

3.9.22

1 file

3.9.21

1 file

3.9.20

1 file

3.9.19

2 files

3.9.18

2 files

3.9.17

2 files

3.9.16

2 files

3.9.15

2 files

3.9.14

2 files

3.9.13

2 files

3.9.12

2 files

3.9.11

2 files

3.9.10

1 file

3.9.8

1 file

3.9.7

2 files

3.9.6

2 files

3.9.4

2 files

3.9.3

1 file

3.9.2

1 file

3.9.1

1 file

3.9.0

2 files

3.8.92

1 file

3.8.91

1 file

3.8.90

1 file

3.8.89

1 file

3.8.88

1 file

3.8.87

1 file

3.8.86

1 file

3.8.85

1 file

3.8.81

1 file

3.8.80

1 file

3.8.79

1 file

3.8.78

1 file

3.8.77

1 file

3.8.76

1 file

3.8.75

1 file

3.8.74

1 file

3.8.73

1 file

3.8.72

1 file

3.8.71

1 file

3.8.70

1 file

3.8.69

2 files

3.8.56

12 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page