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/rxgVVgCh


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/rxgVVgCh

  • 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.8.56-cp313-cp313-win_amd64.whl (341.2 kB view details)

Uploaded CPython 3.13Windows x86-64

graperoot-3.8.56-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

graperoot-3.8.56-cp313-cp313-macosx_10_13_universal2.whl (750.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

graperoot-3.8.56-cp312-cp312-win_amd64.whl (340.4 kB view details)

Uploaded CPython 3.12Windows x86-64

graperoot-3.8.56-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

graperoot-3.8.56-cp312-cp312-macosx_10_13_universal2.whl (756.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

graperoot-3.8.56-cp311-cp311-win_amd64.whl (356.0 kB view details)

Uploaded CPython 3.11Windows x86-64

graperoot-3.8.56-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

graperoot-3.8.56-cp311-cp311-macosx_10_9_universal2.whl (806.4 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

graperoot-3.8.56-cp310-cp310-win_amd64.whl (355.3 kB view details)

Uploaded CPython 3.10Windows x86-64

graperoot-3.8.56-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

graperoot-3.8.56-cp310-cp310-macosx_10_9_universal2.whl (811.2 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

File details

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

File metadata

  • Download URL: graperoot-3.8.56-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 341.2 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graperoot-3.8.56-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5cccfe0393473aa32ba5e1208f0789a14cc03ed39bae854936cf93b361daad47
MD5 c15e850f22a8db43675eed719915f5be
BLAKE2b-256 d3ca34dc91a56cd7becc69b6d92843518f42b7d1e46dfc75643a40d6a73a8dfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.8.56-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 644b3ec584862b77b2ee3f2be65a8f5f4c13b2b662559659be84785b03054e96
MD5 a05aeee4adaea2a381db4c62fdae9467
BLAKE2b-256 5639641383e2e282099ebb3e19c95a07769a42a16a752f44a5ea8c279701fba6

See more details on using hashes here.

File details

Details for the file graperoot-3.8.56-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for graperoot-3.8.56-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 04dbbf33ea45d3527e9d4d63a309679ec48726086aaa3bc1ca4eda460847ce32
MD5 67a0f2c21cd2aaa0a223e50d99a7f9d1
BLAKE2b-256 42bb711389cafe1355d8978b54a5e37bb8dcab058a4d34bc14d5434d36c332ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.8.56-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 340.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graperoot-3.8.56-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6c8e54e6f2ad4e5070218ac28f3e6c9dafe5543b1d30b71870592a0d1930dfba
MD5 ba234f8f485bd4469225252197760003
BLAKE2b-256 4df5c12b43d9a5b23d96adf00199f9c465b8e6b20ce0aa466d8cb9bd5172c73e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.8.56-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0175305b6fd41f51b2a373db7f07bd9f671318a70c7d58c979d636b16a77de6d
MD5 c5ebd9431190afb4d46e6eb664dfb1a5
BLAKE2b-256 391451821e61707bdd8b222a383ea221067f792c5200a197e13ee000f87250ba

See more details on using hashes here.

File details

Details for the file graperoot-3.8.56-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for graperoot-3.8.56-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 707f1704f039785d015f94936c4d42d7f0f4331968eefc144bedbad5cc433e2b
MD5 80431471d72629a97b16cbcf5b7be88f
BLAKE2b-256 2c2525029887fe4507b056037cbd58a8acd37c19024e58a00373116d882cc42f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.8.56-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 356.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graperoot-3.8.56-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 051f458979696d61529bd20e40680aa1372b4bb4925d29363b32ba1479597673
MD5 e5df3fc6dfaefe43584ce21a0f74ae6d
BLAKE2b-256 dc010b3310062f8f57a1474f9109ad45d328bc5442643bd2ff1ea06fd059fb7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.8.56-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 92eccd9613e9099778e1490492077d6bdbae0271963ced1c69086de5f7269267
MD5 ced55a72567e35efb523c57a12bb080d
BLAKE2b-256 eb4a9330ad0dec4ee7ee1a3d8ee7aa04b420fec01aadc9de48bdc2f953b32552

See more details on using hashes here.

File details

Details for the file graperoot-3.8.56-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for graperoot-3.8.56-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 66e257cbdd24e00e26ac16a43c194a8b6c5f15f443b8419a49a7adc6d94dc774
MD5 ad6b267355ba57cbd4e93b16a23803b1
BLAKE2b-256 7a01694855221b2d29ecbc457f1c8bbceae3557dd276e1fbd90460dabb878c4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.8.56-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 355.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graperoot-3.8.56-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a5b9405abedd59f0aa3d6f9f20314d1d1544e4dccad0109d7eebddfe3e5fc0e0
MD5 eb23f0d232c72cae75675c8bc97a2329
BLAKE2b-256 2d72792c39cb95c5f5313b11711e48e8942b22b74e9337b957e40c75f4446774

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.8.56-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bec1d0dbc8e5911ca08c9540658698a06ecca1a09f8b5a3200ac68b01ca70d7c
MD5 5d86103eb907f05e2938cf08a662ccec
BLAKE2b-256 04f8ab95a92d5e57a0f75c90d0a2a7d1d5bc7a5338878e9dddc742e30bb3db88

See more details on using hashes here.

File details

Details for the file graperoot-3.8.56-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for graperoot-3.8.56-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0823b962d691f71852907259c0b31061919adc40731cfe58d30942dec3cd7ef3
MD5 88ac0dca1282f8996b51ee7e5d0a4d4d
BLAKE2b-256 5ca3666d345535dc06bd96f53540e399db8d6c257c43fd9070cebc65847de284

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