Agent skill

Codegraph Detection Partner

by itechmeat in itechmeat/open-second-brain

Teaches the agent to detect whether the codegraph symbol graph is available and use it for callers, callees and impact questions, without installing or writing anything for it.

MITAuto-check passedDevelopment

Install Codegraph Detection Partner

skills CLI
$ npx skills add itechmeat/open-second-brain --skill codegraph-partner -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install itechmeat/open-second-brain codegraph-partner --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/itechmeat/open-second-brain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codegraph-partner .claude/skills/codegraph-partner && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codegraph-partner
GitHub stars
430
Token cost
~1.6k tokens
SKILL.md length
889 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Teaches the agent to detect whether the codegraph symbol graph is available and use it for callers, callees and impact questions, without installing or writing anything for it.

  • Works in 5 steps: detect → branch on result → hard rule after codegraph init → …
  • Asking who calls a function or what breaks if a symbol changes
  • SKILL.md covers Step 1 - detect, Step 2 - branch on result, Step 3 - hard rule after… and Step 4 - tool-vs-tool…, plus 2 more sections
  • Calls npm

What it does

The skill splits responsibilities between two tools. The vault side owns Markdown prose, preferences and audit records, while the codegraph CLI and its MCP server own the code-symbol graph of a repository, meaning callers, callees, impact radius and the syntax tree. The agent learns to detect codegraph in the current scope and then use it, recommend it or stay quiet about it, depending on what is nearby. It never installs, initializes or writes data for codegraph, which stays in your hands or in codegraph's own installer.

Detection runs in order: whether the CLI is on the path, whether the working directory is a code project, shown by a `.git/` folder plus a manifest such as `package.json`, `pyproject.toml`, `Cargo.toml` or `go.mod`, then the sibling folders next to the vault if it is not, the presence of a `.codegraph/` index folder, and a `codegraph status -j` call that reports whether the index is initialized. When several projects are found, each is checked separately, and if the installed CLI cannot take a project path the report covers only the first one and says so. The excerpt is cut off there.

When your agent uses it

  • Asking who calls a function or what breaks if a symbol changes
  • Finding where a symbol is defined in a repository
  • Getting an architectural overview of a code repository
  • Checking whether codegraph is installed and indexed for a project

Example prompts

  • “Use codegraph to show the callers of saveDraft in this repo.”
  • “What breaks if I change the signature of parseVault?”
  • “Is codegraph set up for the projects next to my vault?”
  • “Give me an architectural overview of this repository.”

Requirements

  • The codegraph CLI or its MCP server
  • A code repository with a .git folder

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. detect
  2. branch on result
  3. hard rule after codegraph init
  4. tool-vs-tool disambiguation
  5. argued install recommendation

What it can do on your machine

Read from SKILL.md and the folder at commit 0f0c9a7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codegraph Detection Partner loads about 1.6k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 889 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from itechmeat/open-second-brain at commit 0f0c9a7, republished under its MIT licence (© itechmeat). 889 words, ~1,616 tokens.

Download SKILL.mdSave it as .claude/skills/codegraph-partner/SKILL.md (or your agent's skills folder).
name
codegraph-partner
description
Use when the user explicitly mentions codegraph, asks structural code questions such as callers/callees/impact, asks where a symbol is defined, asks what breaks if a symbol changes, or asks for an architectural overview of a code repository. Skip for prose-only or vault-only questions.

Codegraph partner

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.

Step 1 - detect

Run these checks in order. Stop at the first state that matches.

  1. CLI presence: which codegraph (or, in Bun runtimes, Bun.which("codegraph")).
  2. Code-project signal in the current working directory: a .git/ directory plus at least one of package.json, pyproject.toml, Cargo.toml, go.mod, tsconfig.json, Gemfile, composer.json, build.gradle, pom.xml.
  3. If neither cwd nor the user's named project is a code project, look at the vault's parent directory and inspect the top-level entries (one level only). Many users keep their repos as siblings of the vault. All discovered code projects are candidates, not just the first.
  4. Index state: a .codegraph/ directory inside the code project root.
  5. Confirmed index: 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.

Step 2 - branch on result

StateAgent 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 projectArgued recommendation (Step 5).
missing + no code project in scopeStay 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.

Show full SKILL.md (377 more words)Show less

Step 3 - hard rule after codegraph init

Whenever 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.

Step 4 - tool-vs-tool disambiguation

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 shapeTool
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.

Step 5 - argued install recommendation

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 with npm 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.

Out of scope

  • Do not call codegraph install, codegraph init, or codegraph index automatically.
  • Do not read or write .codegraph/codegraph.db.
  • Do not mirror codegraph data into the Brain or the vault search index.
  • Do not modify ~/.claude.json, .cursor/rules/, or any other agent config on behalf of codegraph.

© itechmeat, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/codegraph-partner of itechmeat/open-second-brain.

Open the folder on GitHubat commit 0f0c9a7

Compare with similar skills

Codegraph Detection Partner next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codegraph Detection Partner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codegraph Detection Partner this skillitechmeat/open-second-brain430—~1.6kAutomated safety check: PassMIT
tilth Code Reading CLIjahala/tilth352—~1.1kAutomated safety check: PassMIT
trace-mcp Code Navigationnikolai-vysotskyi/trace-mcp185—~1.6kAutomated safety check: NotesMIT
Smart Explore Code Searchthedotmack/claude-mem97k—~2.3kAutomated safety check: PassApache-2.0
Basemind Code ContextGoldziher/basemind106—~2.6kAutomated safety check: PassMIT
Basemind Code SearchGoldziher/basemind106—~1.3kAutomated safety check: PassMIT

Similar skills

  • Replaces grep, cat, find and ls with the tilth CLI, which returns AST-aware outlines, definitions, usages and callers across many languages in one call.

    352 GitHub stars~1.1k tokensUpdated 11 days ago
    DevelopmentAuto-check passed
  • trace-mcp Code Navigation

    nikolai-vysotskyi/trace-mcp

    Routes code exploration through trace-mcp's indexed dependency graph, using symbol search, outlines, call graphs and change-impact tools instead of Read, Grep and Glob.

    185 GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Smart Explore Code Search

    thedotmack/claude-mem

    Explores code structure with tree-sitter AST search tools, getting a ranked symbol map and file outlines before reading full source, to save tokens.

    97k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Basemind Code Context

    Goldziher/basemind

    Answers structural questions about a repository, such as where a symbol is defined, what calls it and what changed recently, through the basemind MCP server.

    106 GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Basemind Code Search

    Goldziher/basemind

    Answers where code is defined, who calls it and what shape a file has from a pre-built index, returning paths and line numbers instead of file contents.

    106 GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Codebase Search

    Helweg/open-codebase-index

    Chooses the right retrieval tool for code questions: compact context for unfamiliar repos, direct lookup for known symbols, call graphs for relationships and grep for exhaustive matches.

    216 GitHub stars~1.3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from itechmeat/open-second-brain

  • Decision Model Setup

    itechmeat/open-second-brain

    Sets up, evaluates or turns off Open Second Brain's optional decision-model feature, starting from the o2b decision-model check command and a provider route you choose.

    430 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Open Second Brain Embeddings Setup

    itechmeat/open-second-brain

    Walks through turning on semantic search in Open Second Brain: embedding key, sqlite-vec extension, first reindex and an optional periodic refresh, starting from o2b search check.

    430 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: warnings
  • Brain Schema Author

    itechmeat/open-second-brain

    Adds, renames, reviews and explains Brain schema tokens, aliases, prefixes and link types in Open Second Brain vaults, previewing each change before applying it.

    430 GitHub stars~513 tokensUpdated yesterday
    Auto-check passed
  • Open Second Brain

    itechmeat/open-second-brain

    Lets an agent read, write and maintain its own memory in a Brain folder of an Obsidian-compatible vault, while keeping the user's own notes read-only.

    430 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Questions about Codegraph Detection Partner

What does Codegraph Detection Partner do?

Teaches the agent to detect whether the codegraph symbol graph is available and use it for callers, callees and impact questions, without installing or writing anything for it. The skill splits responsibilities between two tools. The vault side owns Markdown prose, preferences and audit records, while the codegraph CLI and its MCP server own the code-symbol graph of a repository, meaning callers, callees, impact radius and the syntax tree.

When should I use Codegraph Detection Partner?

Codegraph Detection Partner fits situations like: asking who calls a function or what breaks if a symbol changes; finding where a symbol is defined in a repository; getting an architectural overview of a code repository; checking whether codegraph is installed and indexed for a project.

How do I install Codegraph Detection Partner in Claude Code?

Run `npx skills add itechmeat/open-second-brain --skill codegraph-partner -a claude-code`. Or copy the skill folder (skills/codegraph-partner in itechmeat/open-second-brain) into .claude/skills/codegraph-partner in your project. Claude Code loads it when a task matches its description.

How do I install Codegraph Detection Partner in Codex?

Run `npx skills add itechmeat/open-second-brain --skill codegraph-partner -a codex`. Or copy the skill folder (skills/codegraph-partner in itechmeat/open-second-brain) into .agents/skills/codegraph-partner in your project. Codex loads it when a task matches its description.

Can I use Codegraph Detection Partner in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add itechmeat/open-second-brain --skill codegraph-partner -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codegraph-partner, .gemini/skills/codegraph-partner, .github/skills/codegraph-partner and .opencode/skills/codegraph-partner in your project.

What does Codegraph Detection Partner need to run?

Going by SKILL.md and its folder, Codegraph Detection Partner needs the command-line tools its instructions call (npm). Our summary lists: The codegraph CLI or its MCP server; A code repository with a .git folder.

Does Codegraph Detection Partner access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Codegraph Detection Partner safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codegraph Detection Partner use?

Codegraph Detection Partner is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codegraph Detection Partner use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codegraph Detection Partner?

Skills that share tags, products or a category with Codegraph Detection Partner: tilth Code Reading CLI (jahala/tilth, 352 stars), trace-mcp Code Navigation (nikolai-vysotskyi/trace-mcp, 185 stars), Smart Explore Code Search (thedotmack/claude-mem, 97k stars) and Basemind Code Context (Goldziher/basemind, 106 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codegraph Detection Partner?

itechmeat (a GitHub user) maintains it in itechmeat/open-second-brain, which has 430 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

Source: itechmeat/open-second-brain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.