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 Distribution

graperoot-3.9.84.tar.gz (6.5 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.9.84-cp313-cp313-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 26.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for graperoot-3.9.84.tar.gz
Algorithm Hash digest
SHA256 51d2aad0202e71a99f9423c64b4a2a9786b5a3db6e037683ed5562753a8b38b7
MD5 f39958b984c31e12f20f6c0b769abd46
BLAKE2b-256 35f998c02a53890b0dc32c375db54048c892b7643f6fd438644123d2d5ce1206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.84-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.12.12

File hashes

Hashes for graperoot-3.9.84-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5f79331fa5ae227bbee95728f4b2174a7609195c5b981cdb2b1fb9f8ba490336
MD5 bf9c2987fba14dc40cc9649be63be39e
BLAKE2b-256 17c2cb425ef5ef7c3535b8f543ae64b16922c73cfb105233917f5b2813f12d21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.84-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.12.12

File hashes

Hashes for graperoot-3.9.84-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fe5eee7bbfa745ff2ee4d7d67ad2c127c45f76356c1afc42273d7f2e82140ce9
MD5 76766f2cbbb8f6feebd4489f06aaff62
BLAKE2b-256 932f7ae6bb5e1eb466b5ebb1034de23373f569ae1cd8417ff210fe870c7e04ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graperoot-3.9.84-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 1179f3cef42596249d070b8ca0577b6c1cda580ce87223b17863ec9461b208fa
MD5 71fef43f21c1d3736b26027e1a5aa2b9
BLAKE2b-256 4eb291701110ee8ce43dc14e25cea9ddbf9e5c8238c0805023cb7934fa155013

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.84-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.12.12

File hashes

Hashes for graperoot-3.9.84-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c555ae616c17baae44d4f9fcf42e533f324803f7e7c69a76bd2f271f87d8a9e2
MD5 d726b5ace12d2fd9bdc88433f8884329
BLAKE2b-256 1766b613a315178828f62410b3e023bb33ef54fbcf7373060b2528f2900804c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graperoot-3.9.84-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.12.12

File hashes

Hashes for graperoot-3.9.84-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 58f6d1e93832e962d68c25df604f6776e2f3742c9312c0beda85a4bae9273f93
MD5 6d8ba6142c0923ea99731b94d7973219
BLAKE2b-256 fff6aa835662778d3c504135e9fcabf248e87646a45bf330ab367310ec1b0fcf

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