Quick start
Five steps from zero to an agent asking the graph for blast radius.
1. Clone
Section titled “1. Clone”git clone https://github.com/theagenticguy/opencodehubcd opencodehub2. Install toolchain, build, and link the CLI
Section titled “2. Install toolchain, build, and link the CLI”```bash title=“install toolchain, deps, build, and link codehub”
mise install
pnpm install —frozen-lockfile
pnpm -r build
mise run cli:link # puts codehub on your PATH
See [Install](/opencodehub/start-here/install/) for the non-mise pathand for the `cli:install-global` tarball alternative.
:::note[Haven't linked the CLI?]Every `codehub <subcommand>` example below assumes `mise run cli:link`has run (or the packed tarball is installed via `mise run cli:install-global`).If you prefer not to link, replace `codehub` with`node packages/cli/dist/index.js` in every command — same arguments,same behaviour.:::
## 3. Bootstrap a repo in one command
The simplest on-ramp is `codehub init`. Run it inside any repositoryyou want to index:
```bash title="one-command bootstrap — project-scope plugin + .mcp.json + .gitignore + policy starter"codehub initinit does four things atomically:
- Copies the OpenCodeHub plugin assets into
<repo>/.claude/—skills/,agents/,commands/,hooks/, and a project-scopesettings.jsonwith the hook tokens rewritten from${CLAUDE_PLUGIN_ROOT}to${CLAUDE_PROJECT_DIR}/.claude. - Writes
<repo>/.mcp.jsonwith anmcpServers.codehubentry (reuses the same logic ascodehub setup --editors claude-code). - Appends
.codehub/to.gitignoreif not already present. - Seeds
opencodehub.policy.yaml(a starter file with every rule commented out — uncomment when spec 002 ships the CI verdict actions).
Re-running init against a repo with conflicts refuses and names each
file; pass --force to overwrite. --skip-mcp and --skip-policy
disable those steps for teams that manage those surfaces elsewhere.
Team benefit: once init has run and .claude/ is checked into
git, every teammate who clones the repo gets the plugin automatically.
No per-machine install step.
If you prefer the manual path — just the MCP config, no project-scope
plugin — use codehub setup:
codehub setup --editors claude-code4. Analyze the current repo
Section titled “4. Analyze the current repo”codehub analyzeanalyze writes the graph to .codehub/ under the repo root and
registers the repo in ~/.codehub/registry.json. By default the graph
lands in .codehub/graph.lbug (LadybugDB) with .codehub/temporal.duckdb
alongside it; if @ladybugdb/core cannot load on the current platform,
analyze falls back to the single-file .codehub/graph.duckdb layout.
Add --embeddings to compute semantic vectors for hybrid search, or
--offline to guarantee zero network sockets.
5. Ask the agent
Section titled “5. Ask the agent”Point your agent at the MCP server (Claude Code picks up .mcp.json
automatically on the next session). Then ask:
“Run
impactonvalidateUserand tell me the blast radius.”
The MCP impact tool returns a structured response shaped like:
{ "target": "validateUser", "direct_callers": 14, "affected_processes": 3, "risk": "HIGH", "next_steps": [ "call context(validateUser) for caller sites", "call detect_changes after staging edits" ]}You can also invoke the same analysis directly from the CLI:
codehub impact validateUser --depth 2Where to next
Section titled “Where to next”- Your first query walks through
query,context, andimpactwith sample output. - MCP tools lists all 29 tools the server exposes.
- Using with Claude Code covers the plugin path (PreToolUse hooks) and the MCP-only path.