trailhq/Graft

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

What it solves

Coding agents often start every task "blind," spending significant tokens, time, and tool calls re-exploring a codebase to understand its structure and logic. Graft provides a persistent, regenerable context layer that allows agents to onboard to a codebase once rather than every single session.

How it works

Graft builds a graph of the codebase as a set of linked markdown files stored locally in a graft/ folder. It uses a two-pass process:

  1. Structural Analysis: Uses tree-sitter to create a deterministic code graph of symbols and call edges without needing an LLM.
  2. LLM Summarization: An LLM summarizes each file and groups these summaries into curated nodes (subsystems, concepts, or key files) with typed links (e.g., depends_on, implements).

This graph is stored as a local cache (ignored by git) and is automatically refreshed before queries to ensure it reflects the current working tree, including uncommitted edits.

Who it’s for

Developers using AI coding agents such as Claude Code, Cursor, Gemini, or Copilot who want to reduce latency, lower API costs, and improve the correctness of agent-generated patches in large codebases.

Highlights

  • Efficiency Gains: Benchmarks show up to 46% fewer tool calls, 42% fewer tokens, and 60% less latency compared to "cold" agent sessions.
  • Improved Correctness: Increased resolution rate on SWE-bench Verified from 54% to 66%.
  • Vendor Neutral: Supports any LLM provider via API keys (OpenAI, Anthropic, OpenRouter, etc.) or local models.
  • Broad Language Support: Supports 22 languages, with full-fidelity extractors for TypeScript/JavaScript, Python, Go, Java, and R.
  • ** uma Seamless Integration:** One-command setup (graft init) that wires the tool into the native instruction files of popular coding agents.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project