codebase-impact-analysis

A pre-change analysis guide for finding what parts of a codebase depend on a piece of code. A codebase is the files that make up a software project; the guide can use an MCP server or prepared project documents to trace connections.

In plain words
What is it for?
Use it to ask what depends on a symbol, whether something is safe to delete, or what could break after changing it. It is for impact assessment, not for implementing the change.
Why use it?
It reveals likely callers and related files before a rename, removal, signature change, deprecation, or split. This helps identify what may need updating before code is changed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dhevenddra/forensic-deepdive/codebase-impact-analysis
Any agent
npx skills add Dhevenddra/forensic-deepdive --skill codebase-impact-analysis
Clone the repo
git clone --depth 1 https://github.com/Dhevenddra/forensic-deepdive

Made for: Claude Code, Codex.

Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 596 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00121 $0.00596
Opus 5 $0.00060 $0.00298
Sonnet 5 $0.00024 $0.00119
Haiku 4.5 $0.00012 $0.00060

Measured 2d ago against content hash 3a24e7f17265, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-impact-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tests/fixtures/prior_release/v0_8_0/.claude/skills/codebase-impact-analysis/SKILL.md · 38 lines

What it actually says

Codebase impact analysis

Predict downstream effects of a change BEFORE making it. Never recommend a rename / removal / signature change without first surfacing callers and co-change neighbors.

When to use

  • User proposes a rename, signature change, removal, deprecation, or split.
  • Question shape: 'what depends on this', 'safe to delete X', 'where is Y called from', 'what breaks if I change Z'.

When NOT to use

  • User is reading code to understand it → codebase-exploring.
  • User is hunting a bug → codebase-debugging.
  • User is restructuring with full knowledge of callers → codebase-refactoring.

How to answer

  1. Always read docs/codebase/AGENT_BRIEF.md first — coupling rules ('if you touch X also touch Y') often pre-answer the question.
  2. If MCP server is running (forensic serve):
    • impact(symbol, depth=3, direction='upstream') — every caller, depth-bucketed, with confidence per edge.
    • context(symbol) — definition + callers + callees + parent + siblings + members + recent commits in one call.
  3. If MCP isn't running:
Question shape Artifact
'Cross-file dependencies' docs/codebase/HOTPATHS.md (Cross-file dependencies)
'Coupling rules for this file' docs/codebase/AGENT_BRIEF.md (Always rules)
'Co-change cluster' docs/codebase/HOTPATHS.md (Co-change clusters)

Confidence discipline

The graph tags every edge EXTRACTED / INFERRED / AMBIGUOUS (DEC-015). When recommending a change, call out AMBIGUOUS callers explicitly — the resolver was unsure, so the human should double-check.

Citation rule

Cite docs/codebase/HOTPATHS.md:42 or the MCP tool output verbatim. Never say 'X is safe to delete' without showing the caller list (even when empty — 'no callers found in docs/codebase/HOTPATHS.md and impact() returned 0 upstream').

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 38 lines · 121 tokens per session scan A 3a24e7f17265

Subscribe to this mod's changes

codebase-impact-analysis is a skill published in the GitHub repository Dhevenddra/forensic-deepdive (2 stars, last pushed 16d ago), licensed Apache-2.0. It adds 121 tokens to every session and 596 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

mistakes

List past mistakes engram has learned in this project — failures, regressions, broken assumptions. Use before starting a non-trivial change to surface relevant prior failures, or when debugging to check if this issue has been seen before.

NickCirv/engram · 46 tokens

query

Query engram's local knowledge graph for structural context — function calls, imports, type relationships, mistake history, ADRs. Use when the user asks "how does X work in this project", "what calls Y", "where is Z used", or any structural question that doesn't need file content.

NickCirv/engram · 60 tokens

chatcrystal-task-writeback

Write reusable ChatCrystal task memories after substantive work completes. Use when implementation or debugging produced a durable fix, pitfall, pattern, or decision worth preserving, and when the environment can either persist it through writetaskmemory or emit a structured memory candidate for later save.

ZengLiangYi/ChatCrystal · 62 tokens

chatcrystal-debug-recall

Recall ChatCrystal memories for debugging tasks involving failing tests, compiler errors, runtime exceptions, dependency issues, environment breakage, or performance regressions. Use when historical root causes, fixes, or pitfalls may accelerate diagnosis before proposing a fix.

ZengLiangYi/ChatCrystal · 54 tokens

chatcrystal-task-recall

Recall project-first and global-supplement ChatCrystal memories before substantive implementation, refactoring, migration, configuration, investigation, or optimization work. Use when the task is non-trivial, has repository or project context, and prior fixes, decisions, pitfalls, or reusable patterns may change the…

ZengLiangYi/ChatCrystal · 66 tokens

slm-graph

Index and query a codebase as a structural graph — build the code graph, trace blast radius of a change, find callers/callees/inheritors, semantic code search by meaning, assemble PR review context, and detect what changed since last index. Use when the user asks how code connects, what breaks if X changes, what calls…

qualixar/superlocalmemory · 97 tokens