/investigate:brieffrom Investigate toolkit
Generate a deterministic structural brief for a path before anyone reads code, covering callers, wiring, blast radius, installed third-party versions, and version-checked doc sources. Use when asked for a brief, a blast radius, who calls this, or a pre-computation for an investigation or review; the deep and spec skills call it first. Not an investigation by itself: for the full two-pass investigation use investigate:deep.
Ships in Investigate toolkit. 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.
Read when SKILL.md points to them; scripts run unread.
The brief is a deterministic pre-computation: a graph query plus a textual wiring scan, with no LLM in the loop. Mechanism beats instruction. An agent told to be careful about callers still fabricates and omits them; an agent handed a computed caller list has something to check against.
It targets two distinct hallucination modes. First-party structure (who calls this, what breaks) is covered by the graph and wiring sections. Third-party behaviour (what the framework or library actually does) is covered by installed versions read from lockfiles and a version gate on documentation sources. Redundant agent passes do not catch the second mode; see the evidence ladder, "Agreement is not evidence for recall".
node "${CLAUDE_PLUGIN_ROOT}/skills/brief/scripts/brief.mjs" <target-dir> [--max-symbols N] [--no-docs] [--no-lsp] [--help] \
> "${TMPDIR:-/tmp}/brief-<module>.md"
vendor/ or node_modules/ and any code-graph indexes. A bare
worktree degrades resolved types and omits graph sections..mjs, .cjs, .mts, .cts. Files come
from git ls-files (tracked, plus untracked files that are not ignored). vendor/,
node_modules/, dot-directories, and symlinks are skipped.*.test.*, *.spec.*, or *.stories.* are always left out. The test-directory
filter (tests/, __tests__/, __mocks__/) applies to paths relative to the target, so
targeting a tests directory briefs the tests themselves.--no-docs skips the doc-source gate and its calls to context7.com; --no-lsp skips
language-server resolution.--max-symbols N sets the per-symbol detail cap, 15 by default; a smaller N lowers it.
Symbols are taken in file path order, so the cap drops whatever sorts last.-h or --help prints the usage line and exits 0.tsserver.js, so a TypeScript 7 repo shows
typescript-language-server: FAILED (…) with the server's stated cause.--max-symbols) also exits 1. Never investigate
silently without the brief.Every tool the brief used reports a status. Read these before trusting any other section.
| Status | Meaning |
|---|---|
ran, ran (index current) | Section is trustworthy. The gitnexus index is current only when the indexed commit is HEAD. |
ran (index STALE, N commits behind), ran (index STALE, indexed commit is not in HEAD's history) | Graph data may be outdated. |
ran (no results) | Tool worked and found nothing. |
partial (k of N files failed: …) | The language server failed on some files. Types or callers for those files are UNRESOLVED. |
ran anonymously (no CONTEXT7_API_KEY) | Doc gate ran without a key; rate limits may apply. |
ran (k of N lookups FAILED…) | Some doc lookups errored. Those packages' docs are UNRESOLVED. |
FAILED (...) | Tool is present but errored. Treat its section as UNRESOLVED, not empty. |
unavailable (<note>), UNAVAILABLE (no global fetch) | Tool could not run. Section is UNRESOLVED. |
not on PATH, no .codegraph index | Tool absent. Section is UNRESOLVED, not empty. |
skipped (--no-lsp), skipped (--no-docs) | Deliberately not run. |
skipped (no PHP scan dirs) | None of app, config, routes, database, src exists, and those are the only directories ast-grep scans. The textual wiring scan still ran. |
skipped (no composer.lock read), skipped (no package-lock.json read), skipped (no composer.lock or package-lock.json read) | No lockfile was read for the target's sources, so its third-party imports are UNRESOLVED. pnpm, yarn, and bun lockfiles are not read. |
…; composer imports UNRESOLVED (no composer.lock read), …; npm imports UNRESOLVED (no package-lock.json read) | The gate ran for one ecosystem, but the other's lockfile was not read, so that ecosystem's imports are UNRESOLVED. |
not needed (no PHP files), not needed (no PHP symbols), not needed (no TypeScript/JavaScript symbols), not needed (no third-party imports), not needed (only dev packages imported) | Nothing for the tool to do. Dev packages are listed under Third-party surface but never sent to context7. |
For gitnexus, not on PATH means the binary is missing; an installed gitnexus whose list
command fails reads FAILED (...). A thin section under a tool marked not on PATH is
absence of a tool, not absence of callers. If gitnexus reports STALE and its CLI is
available, run gitnexus analyze from the project root and rerun the brief.
current only
when the indexed commit is HEAD and STALE otherwise. When gitnexus could not run it reads
Index: UNAVAILABLE and the graph sections are omitted. A stale index is a confident
wrong map.(no named exports; basename used) marks a JS/TS file with no usable export name, whose symbol is its file name.^3.1.0 is not a
fact, 3.3.1 is. When no lockfile was read for the target's PHP or JS/TS sources, the
section opens with an UNRESOLVED: no <lockfile> was read line..codegraph index
exists.The gate queries context7 for at most 12 packages per run: the first 12 imported non-dev
packages in name order. It compares each candidate's documented version to the installed
one. The gate decides version alignment; the reader only copies verdicts. Do not resolve
library ids yourself or judge versions: the context7 tool hides the deciding field
(branch), version markers hide in ids, and benchmark score is not relevance.
| Verdict | Action |
|---|---|
USE UNPINNED | ✅. Hand over the id as-is. |
PIN to <id>/<ver> | ✅. Hand over the pinned id, <id>/<ver>, as the fetch list prints it. |
NAME MISMATCH | ⚠. Confirm it is really that package before handing it over. |
AHEAD / no version signal | ⚠, not in the fetch list. Hand over nothing; read installed source. |
installed version unparsed | ⚠. The lockfile version did not parse; compare versions by hand. |
STALE / STALE-ISH / pins are vX, installed is vY … do NOT pin / NO USABLE DOCS | Hand over nothing; point at installed source. |
DIFFERENT STACK | The docs are for another framework's adapter. Hand over nothing. |
no context7 match — read installed source | context7 has no docs for it; read installed source. |
lookup FAILED | That package's docs are UNRESOLVED; read installed source. |
USE UNPINNED and PIN to lines carry ✅; every other verdict carries ⚠. A package whose
best candidate is STALE, pins are … do NOT pin, DIFFERENT STACK, or a NAME MISMATCH
on anything weaker than USE UNPINNED also gets a ⛔ NO USABLE DOCS line. The
FETCH BEFORE CLAIMING list rolls up each package's best ✅ id: the plain id for
USE UNPINNED, <id>/<pin> for PIN to. When nothing cleared, the list says so and tells
agents not to fetch docs for any package.
Prefer unpinned when the branch matches. A pin is a snapshot of one release and can be older
than the default branch. The gate recommends a pin only when a published version matches the
installed major and the default branch either is behind the installed major or is not a
release branch (main, master, develop, dev, next, trunk) updated within 120 days.
A ⛔ verdict is a real answer, not a failure to try. Stale docs are worse than none: given
documentation for the wrong major, an agent reports the old idiom with a citation, which
reads as verified.
Condense the verdicts of the packages you hand over into lines like these
(investigate:deep Step 2 says which to pick):
DOC SOURCES: pre-resolved and version-checked. Do not resolve your own.
- @inertiajs/react 3.3.1 → /websites/inertiajs_v3 (id pins v3 == installed)
- laravel/framework v13.17.0 → /laravel/framework (branch 13.x == installed)
- lucide-react 1.17.0 → NAME MISMATCH on every candidate; read node_modules/ instead
The gate never blocks the brief. A network error, an HTTP error, or a reply without a
results array shows as lookup FAILED on that package and is not cached; the Tools line
then reads FAILED (...) or ran (k of N lookups FAILED…). Each means UNRESOLVED: read
installed source. A reply whose result entries all lack a string id reads
no context7 match and is cached like any other answer. With CONTEXT7_API_KEY set, the
key is sent as Authorization: Bearer <key>; without it, queries are anonymous. Results
cache for 6 hours under the OS temp directory (investigate-brief/context7; override with
INVESTIGATE_BRIEF_CACHE_DIR). Never carry a doc verdict across sessions; recompute it.
For PHP the call graph has no inheritance or interface edges and no container-resolution
edges (resolve(Foo::class), app(Foo::class), DI). Graph caller lists are a lower bound
and often read as misleadingly test-only. An empty caller list on a service or interface
method is unresolved. Recover wiring from the brief's textual buckets.
For reachability claims, see ${CLAUDE_PLUGIN_ROOT}/skills/deep/SKILL.md, "Step 4: Report".
For claims about how a third-party package behaves, apply the evidence ladder.
For first-party types and call relationships, see resolving types and callers.
references/evidence-ladder.md (opens in a new tab)references/resolution.md (opens in a new tab)scripts/brief.mjs (opens in a new tab)scripts/lib/cache.mjs (opens in a new tab)scripts/lib/deps.mjs (opens in a new tab)scripts/lib/docs-gate.mjs (opens in a new tab)scripts/lib/exec.mjs (opens in a new tab)scripts/lib/freshness.mjs (opens in a new tab)scripts/lib/graph.mjs (opens in a new tab)scripts/lib/lsp-client.mjs (opens in a new tab)scripts/lib/phpantom.mjs (opens in a new tab)scripts/lib/render.mjs (opens in a new tab)scripts/lib/repo.mjs (opens in a new tab)scripts/lib/ts-lsp.mjs (opens in a new tab)scripts/lib/wiring.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/deepThe full investigation of a service, module, or feature, with a deterministic brief and two redundant parallel passes synthesised by intersection. Use when asked to investigate, audit, or deeply understand code, or when conclusions about callers, blast radius, or reachability will drive a decision; this is the default when someone asks for "the investigate skill". Accepts a path or a free-text subject. Not for quick single-fact lookups; for a spec or ticket use investigate:spec; for the brief alone use investigate:brief./specClaim-by-claim review of a spec, ticket, plan, or design document against the codebase, using a deterministic brief and two redundant passes. Use when asked to review a spec or ticket against the code, check whether a plan's assumptions hold, or find the callers a proposed change forgot. Accepts a file path, a ticket or document id, or pasted text.npx claudepluginhub noppu-labs/ai-toolkit --plugin investigate