@viniraioli/pi-codegraph
v0.1.5
Published
Pi coding agent extension that wires codegraph (tree-sitter knowledge graph) as an MCP sidecar and injects usage instructions into the system prompt
Readme
pi-codegraph
A pi coding agent extension that wires codegraph as an MCP sidecar and injects structured usage instructions into the system prompt.
What it does
When a project has a .codegraph/ index anywhere above the current working directory, this extension:
- Spawns
codegraph serve --mcp --path <project-root>as a sidecar process - Registers all codegraph tools returned by
tools/listdirectly in the session - Injects a
## CodeGraphsection into the base system prompt viaAPPEND_SYSTEM.mdso the instructions are present from session startup — not just on the first agent turn
If the project has no .codegraph/ directory the extension is a no-op.
Requirements
codegraphCLI must be on$PATH- A
.codegraph/index must exist in the project root (runcodegraph init -ito build one)
Install
As a pi package
/add npm:@viniraioli/pi-codegraphManual (git)
/add https://github.com/SeanPedersen/pi-codegraphBuilding the index
codegraph init -i # initial index buildThe file watcher keeps the index current while pi is running.
This package follows the current CodeGraph MCP surface, so broad structural questions should go to codegraph_explore first.
