/codebase:impact [--base <sha>]from codebase
Show what your recent changes affect. [--base <sha>]
Ships in codebase. 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.
Show what's affected by recent code changes. Wraps codebase-memory-mcp's detect_changes tool with enriched output: risk classification, caller analysis for high-risk changes, and test coverage status.
| Argument | Type | Default | Description |
|---|---|---|---|
--base | string | auto-detected | Base SHA to compare against. Auto-detects upstream tracking branch (@{u}) or prompts if none. |
Prefer MCP first. If its tools are absent or the server is unreachable, automatically try the CLI without asking:
command -v codebase-memory-mcp
codebase-memory-mcp cli --json list_projects
Set codebase_transport to mcp or cli. All tool calls below use that transport. For CLI calls, pipe the same JSON arguments to codebase-memory-mcp cli --json <tool> via stdin; inspect isError and read the result from content[] text. Use each tool's --help for supported flags and output formats. Query and indexing errors are not transport failures: report them accurately, not as missing MCP. On a later MCP connection failure, retry through CLI. Preserve project selection, index settings, and consent rules; do not install anything automatically.
Resolve the transport above. Only if neither MCP nor CLI works, explain that impact analysis requires either a configured MCP server or the installed codebase-memory-mcp CLI, then exit.
Read references/freshness.md and follow it for every project in scope.
If --base is provided, use it directly.
If not provided, auto-detect:
git rev-parse @{u} 2>/dev/null
If that fails (no upstream), check:
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
If all fail, ask the user for a base ref using the harness's question mechanism. In Claude Code this may be AskUserQuestion; in Pi, ask directly in chat and wait for the answer:
No upstream branch detected. What SHA should I compare against?
Enter a commit SHA, branch name, or tag:
Call list_projects and match against the current repo, using the same project-name matching as codebase:ask Step 1.
Call detect_changes with:
project: the matched project namescope: "commits"base_branch: the resolved base SHA from Step 1depth: 2This returns a list of changed symbols with risk labels (CRITICAL, HIGH, MEDIUM, LOW) and blast radius information.
For each symbol classified as CRITICAL or HIGH:
Call trace_path with:
function_name: the symbol's qualified namedirection: "inbound"depth: 2project: the matched project nameThis shows what depends on the changed symbol.
Call search_graph with:
name_pattern: a regex matching common test file patterns for the symbol (e.g., if the symbol is in auth/middleware.go, search for files matching auth.*test)label: "Function" or "Method"project: the matched project nameClassify test coverage as:
covered — test file exists with functions that reference the changed symbolpartial — test file exists but doesn't reference the changed symbol directlynone — no test file foundGroup results by risk level. For each changed symbol:
## Impact Analysis (base: [base_sha]..HEAD)
### CRITICAL
- `[file_path]:[function_name]` (line [N])
[Contextual explanation: what changed and why it matters]
[N] callers across [M] packages depend on this — [list key callers]
Tests: [covered|partial|none] — [details]
### HIGH
- `[file_path]:[function_name]` (line [N])
[Contextual explanation]
Tests: [status]
### MEDIUM
- `[file_path]:[function_name]` (line [N])
[Brief explanation]
### LOW
- [list briefly, or "No changes at LOW risk level"]
If detect_changes returns no results:
No changes detected between [base] and HEAD.
The contextual explanation for each item should cover:
Read references/share.md and follow it.
What SKILL.md sets; muted values are Claude Code's defaults
Use when the user asks what recent code changes affect: 'what did my changes break', 'blast radius of this diff', 'what might break', 'which tests are affected'. Works from a git diff or base SHA. Not for questions about code that has not changed (use codebase:ask) one symbol's callers (use codebase:graph), risky frequently changed code (use codebase:hotspots), or unused code (use codebase:dead-code).
npx claudepluginhub jskswamy/skills --plugin codebase12 skills in this plugin
/dead-codeFind code nothing uses, with each candidate verified. [<path>]