Graft is a context-engineering tool that optimizes prompts sent to coding agents like Claude Code, Cursor, Codex, and Gemini by building a code-graph representation of your codebase.
The tool solves the problem of coding agents working with incomplete or inefficient context, which leads to wasted tokens, slower responses, and lower correctness. Graft builds a knowledge-graph of your codebase using tree-sitter parsing and serves it as an MCP server, allowing agents to query relevant code context on demand rather than including everything upfront. This targeted context delivery reduces token consumption and tool-call overhead while improving the agent's understanding of your specific codebase structure.
Teams using multiple coding agents across their workflow should consider Graft if they want to reduce API costs and latency without sacrificing code quality. It works as a CLI tool and integrates with existing agent workflows through the MCP protocol, making it suitable for projects where agents are already in use. The tool is language-agnostic through tree-sitter support and learns from repeated tasks, building a skill file that improves over time as your team works.
The project maintains active development with regular updates to support new coding agents and LLM providers. The codebase is written in strict TypeScript and includes comprehensive telemetry that users can opt out of. The tool is distributed via npm and has established community channels for support and feedback.