Help us improve
Share bugs, ideas, or general feedback.
From open-second-brain
Detects codegraph CLI and indexed repos, then uses AST/graph queries for callers, callees, impact analysis, symbol definitions, and architectural overviews.
How this skill is triggered — by the user, by Claude, or both
Slash command
/open-second-brain:codegraph-partnerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
OSB and codegraph are complementary, not overlapping. OSB owns the vault
Share bugs, ideas, or general feedback.
OSB and codegraph are complementary, not overlapping. OSB owns the vault (Markdown prose, the Brain layer, preferences, paid-action audit). The codegraph CLI and its MCP server own the code-symbol graph of a repository - callers, callees, impact radius, AST. This skill teaches the agent to detect codegraph in the current scope and to use, recommend, or stay quiet about it, depending on what is actually nearby.
This skill never installs, initializes, or writes data for codegraph itself. Those actions stay in the user's hands or in codegraph's own installer.
Run these checks in order. Stop at the first state that matches.
which codegraph (or, in Bun runtimes, Bun.which("codegraph"))..git/
directory plus at least one of package.json, pyproject.toml,
Cargo.toml, go.mod, tsconfig.json, Gemfile, composer.json,
build.gradle, pom.xml..codegraph/ directory inside the code project root.codegraph status -j <project_path> returns
{"initialized": true, ...}. The same command on an uninitialized
project returns {"initialized": false, ...} rather than failing.The structured way to ask is o2b doctor. When OSB is installed in the
workspace, the doctor report carries a code_graph line that
summarises detection result with node count and file count.
| State | Agent behaviour |
|---|---|
| ok (CLI present, indexed) | Use codegraph for AST and graph queries. No install talk. |
not_indexed (CLI present, no .codegraph/ or initialized: false) | Offer one line: "run codegraph init <path> to index this repo". Do not run it yourself unless the user asks. |
| missing + code project | Argued recommendation (Step 5). |
| missing + no code project in scope | Stay quiet. |
error (CLI present, status -j errors with a lock or schema issue) | Suggest codegraph unlock <path> or a rebuild, but do not run it. |
codegraph initWhenever you run codegraph init in any repository on the user's
behalf, immediately read that repo's .gitignore and append a
.codegraph/ line if one is not already present. The append must be
atomic, must preserve the existing trailing newline policy, and must
not touch any other line.
If the repo does not have a .gitignore, do not create one yourself.
Tell the user the file is missing and that they should decide whether
to add it.
This rule exists so the local codegraph index never lands in a commit.
Use this table to pick the right tool for each kind of question. Do not duplicate a codegraph answer by also running a grep; treat its output as authoritative.
| Question shape | Tool |
|---|---|
| Where is symbol X defined? | codegraph_search |
| Who calls function Y? | codegraph_callers |
| What does Y call? | codegraph_callees |
| What would break if I change Z? | codegraph_impact |
| Show Y's signature or body. | codegraph_node |
| Survey several related symbols at once. | codegraph_explore |
| What files exist under path P? | codegraph_files |
| Prose, page bodies, MOC content, daily notes. | brain_search |
| Confirmed preferences, taste rules. | brain_query |
| Free-text fallback when neither index helps. | Plain grep, last resort. |
Trigger only when both conditions hold: there is a code project in the
current scope, and codegraph is not on the user's PATH.
Show the user a short paragraph that uses real numbers from their project, with no emoji and no marketing voice. Template:
Found a code project at
<path>with N source files. Without an index, every structural question (callers, impact, "where is X") spawns a grep+read loop that burns several thousand tokens per answer. codegraph keeps a SQLite knowledge graph and serves the same question in sub-millisecond time. Installer:curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh(ornpm i -g @colbymchenry/codegraph). After install:codegraph init <path>from inside the repo.
If the user says no, drop the topic for the rest of the session. Do not nag.
codegraph install, codegraph init, or codegraph index automatically..codegraph/codegraph.db.~/.claude.json, .cursor/rules/, or any other agent
config on behalf of codegraph.npx claudepluginhub itechmeat/open-second-brain --plugin open-second-brainExplores codebases using SocratiCode semantic search, dependency graphs, and tools like codebase_search for understanding architecture, finding functions/types, analyzing dependencies, and searching schemas/specs.
Dispatches code-review-graph queries as an agent: ensures graph freshness/embeddings, runs semantic search, feature exploration, impact analysis, and git-based review context.
Queries codebase knowledge graphs to search functions, trace callers/callees, list file entities, analyze impact, and run SurrealQL. Use for code structure, dependencies, and relationships.