Skip to main content

GrapeRoot — graph-based context engine for AI coding agents

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

graperoot-3.9.80-cp313-cp313-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.13Windows x86-64

graperoot-3.9.80-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

graperoot-3.9.80-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

graperoot-3.9.80-cp312-cp312-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.12Windows x86-64

graperoot-3.9.80-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

graperoot-3.9.80-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

graperoot-3.9.80-cp312-cp312-macosx_26_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

graperoot-3.9.80-cp311-cp311-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.11Windows x86-64

graperoot-3.9.80-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

graperoot-3.9.80-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

graperoot-3.9.80-cp310-cp310-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10Windows x86-64

graperoot-3.9.80-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

graperoot-3.9.80-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: graperoot-3.9.80-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for graperoot-3.9.80-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 236c97375bd43ce6a7bd6c673cac78767d6a364181fef1c6db0f39ed3b909c16
MD5 4558c8977cc1058dbce1d27059a457cf
BLAKE2b-256 247c02fc164793e58c374c4b8e7276407763aab8f85cf2bc7ec06ca07ad1d673

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.80-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b2fe1ea549fc98bd28b7c881614ba73075232604d3a12407888a186b4d551ce
MD5 b2f35e52f78c1e67b1f0b340f444902d
BLAKE2b-256 00b915e06f6c63d1e542b406f6fc105183474c3badbaacde036333ce7a422bf9

See more details on using hashes here.

File details

Details for the file graperoot-3.9.80-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for graperoot-3.9.80-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bd048ecdac015fad1fb019e6cb8983cd41a1879670f1a478774681e02215e755
MD5 2d65ce6d0387dd70cc20535e5b64bb0c
BLAKE2b-256 665a79b10c2a012c3a5d0bac88d412c4d34f2e10cf349d2a59bc40ee123446c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.80-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for graperoot-3.9.80-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5e99214864d087cb1419ad6a052f0925ee583903522c2dfb9eaf4f07584d751f
MD5 13341203c362bcb34bec350f95112269
BLAKE2b-256 f77643d2bb58c4235fe5c4cd0cf4b3f4856009cf660454c05368dccb3ad335a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.80-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 545aca9e18e28d2c68a0db7ed1d6ecb3954eeac2e32aba3d79ad287b1540fc0f
MD5 c51a24abd66b327f49a48c3cc51d0fe0
BLAKE2b-256 12ebc67af1cdd2ae262270c2bf6c8021a4a3e2cc5a79d0a60643a595703f92b8

See more details on using hashes here.

File details

Details for the file graperoot-3.9.80-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for graperoot-3.9.80-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 09478010541c8b3d94e30d679d431db07e17128821bcef2ef777e2114c83d9c5
MD5 9bcf1bf0e4c3d5aeba018641598f93a5
BLAKE2b-256 dcf979d31f9963cb5b99ae9114a7a45c324e9738e147699622053fa170e5df58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.80-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 9d2004a3548bd78ef5b1cb116990ad1519762933b1f4e57121cbeee40a485128
MD5 56895168af87c1b30930c14deb40027c
BLAKE2b-256 e6ded434786bc05b60a086760644f8ac8f072e2b406dc746fb528ec999964a27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.80-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for graperoot-3.9.80-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5fd055f003c70c67a1d17a5ccec728784e940f9ce79225e0a572695cdecb1817
MD5 28522a936b004c4146d4144d8f4ec2fd
BLAKE2b-256 e3785adf402bbd08b6fde657b1173e788465d24db81e7ec8e011ca27c8c34a4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.80-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3733b9f89e7864711a4df1ec08390ff6c00a173bcaa57be61b4019b7a793fd25
MD5 72969704b54a1de76e7a9ccc2bab4b07
BLAKE2b-256 f2a6155b28b23856a0ae2503dcd47adc2705270f9eede2af43b870770930045e

See more details on using hashes here.

File details

Details for the file graperoot-3.9.80-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for graperoot-3.9.80-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ef6dcf06160fc2d90862f49854a3291f2262bdce0fcde6c13fa1ca0d07a091e4
MD5 4c0c56ae05523de04227e88d6041df07
BLAKE2b-256 546df6d968f7423216a022bc5342de787cead6c79a501cff97b43668c68ace72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.80-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for graperoot-3.9.80-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bd5cab3b47f6183607a03b78a1aaa1ec79eb267f3c237a492d10c291566e68f6
MD5 1e5e138d1df882e992e62cd9dbff7654
BLAKE2b-256 c6d420a6fb30e6f6153572531ffbccc996becadb39bad3e277a5ead85aebb3be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.80-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc36e12574cfdba3160f1b57e88b1e00a4d3875207bd49453f9625c421bccb87
MD5 aa1c346aa181ba929bf38c1e9085b41f
BLAKE2b-256 8cc9246cace8aefa5aead0b910bfd5cfd86ea5fede7685d5d5cc24439a872c9e

See more details on using hashes here.

File details

Details for the file graperoot-3.9.80-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for graperoot-3.9.80-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 74c66eb4b173f9a21fd3fba413b9fe3b05f01adca379d1d5e9a9d9e9506feaf2
MD5 ed66df83bd5ef5cfca48777bcc8f451c
BLAKE2b-256 0592a8de6ad6637cfe48c59cd802b5051602f981749c4f2929674bbbea787614

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page