/open-second-brain:codegraph-partnerfrom open-second-brain
Detects codegraph CLI and its code-symbol index in the workspace, then uses it to answer structural code questions like callers, callees, impact analysis, symbol definitions, and architectural overviews.
Ships in open-second-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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
the detection result with node count and file count.
Multi-project workspaces: when more than one code project is discovered,
the code_graph line covers EVERY project. Status is threaded per project
by passing each project's path to codegraph status, and the line
aggregates one entry per project (N code projects: followed by a bullet
per project naming its path and index state/health). This per-query
project-path threading is feature-detected: if the installed codegraph CLI
does not document a positional [path] argument for status, OSB cannot
trust per-project queries, so it degrades to reporting the first project
only and appends an explicit note: codegraph CLI has no per-query project_path support - reported 1 of N discovered projects only. A
single-project workspace is unaffected and its line is unchanged.
| 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. |
In a multi-project workspace the aggregate code_graph line can mix these
states across projects (one indexed, one not); read each bullet and act per
project. When the line ends with the note: ... project_path support marker,
only the first project was checked - query the others explicitly with
codegraph status <their_path> before trusting a single-project verdict.
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. Install it withnpm i -g @colbymchenry/codegraph(other options: https://github.com/colbymchenry/codegraph#1-install-the-cli). 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.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub itechmeat/open-second-brain --plugin open-second-brain6 skills in this plugin
/brain-memoryRecord taste signals and apply-evidence events into the Brain observing-memory layer of Open Second Brain. INVOKE this skill (and call `brain_feedback`) the moment the user expresses a preference, dislike, correction, or rule in dialogue — "don't do X", "use A instead of B", "I prefer Y", "X is wrong here", or any explicit imperative that should outlive the current turn. SEPARATELY invoke (and call `brain_apply_evidence`) right after you produce a durable artifact (code shipped, file written, content drafted, config change) and at least one active preference (`brain_context` lists them) has a `scope` that plausibly applies — record whether you `applied` or `violated` it. SKIP only for casual chat, exploration without a stated rule, read-only inspection, and trivial edits. When a preference plausibly applies but you are unsure, RECORD with `note: "speculative; <reason>"` rather than skipping — the dream pass discards single-event speculative entries that do not recur, so coverage costs less than missing the signal. WRITE the `principle` and `note` fields in the same natural language the user has been speaking in this session; technical identifiers (`topic` slug, `pref_id`, `scope`) stay English./decision-model-setupSet up, evaluate or turn off the optional Open Second Brain decision-model feature (typed judgments that rerank search, pick skills, pre-filter extract-signals turns, filter recalled notes and annotate dedup, tension, label and answerable proposals). INVOKE when the user mentions decision models, Jev, TypeSafe, OpenRouter or Vercel decisions, the `decision_model_*` config keys, or after `o2b decision-model check` reports an error, a warning or a hint. SKIP when the user only asks conceptual questions about decision models or compares providers without intent to set up; answer those directly and change nothing./embeddings-setupBring Open Second Brain semantic search online — embedding API key, sqlite-vec extension, first reindex, optional periodic refresh. INVOKE when the user mentions "embeddings", "semantic search", "vector index", or after `o2b search check` reports `vec_extension: unavailable`, `embedding_key: missing`, or any line in its `recommendations:` block. SKIP when the user is asking conceptual questions about embeddings or comparing providers without intent to set up — answer those directly./open-second-brainUse Open Second Brain to read, write, and maintain an agent-owned second brain beside an Obsidian-compatible Markdown vault. The agent reaches its brain memory only through Open Second Brain tools and commands, never through file paths. User-authored notes live wherever the operator names them and are read-only inputs when listed in `notes.read_paths`./schema-authorUse when adding, renaming, reviewing, or explaining Brain schema tokens, aliases, prefixes, link types, extractability, or expert routing in Open Second Brain vaults.Other plugins' skills for the same job