Skip to content

Quick start

Graft gives your AI coding agent persistent context about your codebase. This tutorial walks you through installation and your first graph build.

  1. Install Graft globally

    Terminal window
    npm install -g @nanonets/graft

    Prefer not to install globally? npx @nanonets/graft init works the same way.

  2. Initialize in your project

    Navigate to your project directory and run:

    Terminal window
    graft init

    graft init will ask which of your coding agents to wire up, build the graft/ graph from your code, and drop a statusline and hooks into your agent’s config (e.g. .claude/). From the next session on, Graft rides along in your coding agent: it pulls the matching nodes into each prompt and rebuilds the graph in the background after every turn.

    Nothing is written until you pick. Run graft init --dry-run to see every file it would touch first, or graft init --agents claude to skip the prompt and wire Claude Code alone.

    Graft rides along in a Claude Code session

  3. Commit the wiring

    graft build adds graft/ to your .gitignore automatically — the graph is a local, regenerable cache (like node_modules), not something you commit. What you share is the wiring init dropped into .claude/; each teammate runs graft build to generate their own graph:

    Terminal window
    git add .claude && git commit -m "wire in graft"

No daemon, no re-indexing to remember, nothing to run or maintain by default — the graph is just files.