Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "zerograph",
"interface": { "displayName": "zerograph" },
"plugins": [
{
"name": "zerograph",
"source": { "source": "local", "path": "./agent/codex" },
"policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" },
"category": "Coding"
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
uses: actions/setup-node@v4
with: { node-version: '20' }
- if: ${{ !cancelled() }}
run: node --test agent/hook.test.mjs agent/claude-code/scripts/mcp.test.mjs npm/zerograph/test/launcher.test.js
run: node --test agent/claude-code/scripts/hook.test.mjs agent/claude-code/scripts/mcp.test.mjs agent/codex/plugin.test.mjs npm/zerograph/test/launcher.test.js

# A default Git for Windows install puts `git` on PATH and not `sh` — the Unix tools are an
# opt-in — so `ask --rerank` looks for one. Route 1: Git's shell directories
Expand Down
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,34 @@ npm install -g zerograph # or: pnpm add -D zerograph
echo .zerograph/ >> .gitignore # the graph is built per checkout
zerograph build # first run downloads the embedding model
zerograph ask cancellation policy # stays fresh with your edits
zerograph install-agent --claude # optional: MCP server + session hook
zerograph install-agent --claude # optional: the Claude Code plugin
```

`install-agent` also takes `--codex`, `--cursor`, `--copilot`, `--gemini` and `--opencode`. On
Windows, see the [Windows notes](docs/install.md#windows-notes).
`install-agent` also takes `--codex` (the Codex plugin), `--cursor`, `--copilot`, `--gemini` and
`--opencode`. On Windows, see the [Windows notes](docs/install.md#windows-notes).

## Claude Code plugin

A status mod for Claude Code puts the index's state under the prompt: `◇ zerograph · in sync`, a
progress bar while a refresh runs, the files behind and whether `serve` answers. `/zerograph`
prints the full `zerograph status` report.
The plugin is how zerograph wires into Claude Code: it starts zerograph's MCP server for the
session, briefs each session and subagent on the index, answers a concept grep from the graph
before it runs, and names the callers an edit can break. A status mod puts the index's state under
the prompt: `◇ zerograph · in sync`, a progress bar while a refresh runs, the files behind and
whether `serve` answers. `/zerograph` prints the full `zerograph status` report.

```
/plugin install zerograph --marketplace devmaxxx/zerograph
```

It is pinned to the latest release, so `claude plugin update zerograph` moves it with zerograph.
It starts zerograph's MCP server for the session and adds `/zerograph:ask`, `/zerograph:impact`,
`/zerograph:trace`, `/zerograph:changes`, `/zerograph:explain`, `/zerograph:status` and
`/zerograph:refresh`, each of which calls that server's tools and reads the top hits. With the
plugin, skip `install-agent --claude`'s MCP server; see [the plugin](docs/install.md#claude-code-plugin).
`zerograph install-agent --claude` runs the same install through the `claude` CLI and removes what
older releases wrote into the checkout. The plugin is pinned to the latest release, so
`claude plugin update zerograph` moves it with zerograph. It adds `/zerograph:ask`,
`/zerograph:impact`, `/zerograph:trace`, `/zerograph:changes`, `/zerograph:explain`,
`/zerograph:status` and `/zerograph:refresh`, each of which calls the server's tools and reads the
top hits; see [the plugin](docs/install.md#claude-code-plugin).

Codex gets the same as a Codex plugin, `zerograph install-agent --codex`: the MCP server, the
session hooks, and the commands as skills (`$zerograph:ask`, `$zerograph:impact`, …); see
[the Codex plugin](docs/install.md#codex-plugin).

## In action

Expand Down
27 changes: 27 additions & 0 deletions agent/claude-code/agents/repo-scout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: repo-scout
description: Answers "where does X live", "what calls Y", "what would this change break" from the zerograph index. Read-only, no file reading unless the graph named the path first. Use it instead of spending an expensive model's turns on orientation.
tools: Bash, Read, Grep, Glob
model: haiku
---

You answer questions about where things are in this repository, using the zerograph index. You are
cheap on purpose: the model that spawned you is expensive and is waiting.

**The loop, in order:**

1. `zerograph ask <words>` — or `zerograph ask <Identifier>` when you were given one. Read the
`path:line` it prints.
2. `zerograph impact <Symbol> --depth 1` when the question is who calls something.
3. `zerograph changes --base main` when the question is about the working diff.
4. `rg` only for a literal the graph does not index: an env var name, a string in a test, a flag.
5. `Read` only a `path:line` one of the above printed. Never open a directory to orient yourself —
that is the work the index already did.

**Answer with the paths and one line each.** No summaries of what the code does unless you were
asked for one, no speculation about files you did not open, and no plan. If the graph found
nothing, say so and name the two phrasings you tried: a miss is information, and inventing a
plausible path is not.

If the repository has no index, say `zerograph build` once and stop; do not grep your way to an
answer that the caller could have grepped for themselves.
10 changes: 9 additions & 1 deletion agent/claude-code/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{ "modules": ["./register.ts"] }
{
"modules": ["./register.ts"],
"hooks": {
"SessionStart": [{ "matcher": "startup|resume|clear|compact", "hooks": [{ "type": "command", "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/hook.mjs"], "timeout": 10 }] }],
"SubagentStart": [{ "matcher": ".*", "hooks": [{ "type": "command", "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/hook.mjs"], "timeout": 5 }] }],
"PreToolUse": [{ "matcher": "Bash|Grep|Glob|Agent", "hooks": [{ "type": "command", "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/hook.mjs"], "timeout": 10 }] }],
"PostToolUse": [{ "matcher": "Edit|Write|MultiEdit", "hooks": [{ "type": "command", "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/hook.mjs"], "timeout": 10 }] }]
}
}
Loading
Loading