code-analyzer

A coding-agent specialist that investigates code changes and traces how logic moves across files. It is intended to find bugs, suspicious behavior, and possible regressions, which are new problems caused by a change.

In plain words
What is it for?
Use it to review recent edits, trace API or authentication failures, investigate errors, and check whether changes may break existing behavior.
Why use it?
It provides a focused review when behavior is unexpected or several files are involved. Its output is a concise summary of the analysis.

Agent for Claude Code

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 agents/kamiazya/scopes/code-analyzer
Clone the repo
git clone --depth 1 https://github.com/kamiazya/scopes

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,153 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00000 $0.01153
Opus 5 $0.00000 $0.00576
Sonnet 5 $0.00000 $0.00231
Haiku 4.5 $0.00000 $0.00115

Measured yesterday against content hash d7c610b6a336, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-analyzer 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 yesterday.

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.

Origin

This is a copy

100% identical to code-analyzer — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/agents/code-analyzer.md · 96 lines

What it actually says


name: code-analyzer description: Use this agent when you need to analyze code changes for potential bugs, trace logic flow across multiple files, or investigate suspicious behavior in the codebase. This agent specializes in deep-dive analysis while maintaining a concise summary format to preserve context. Perfect for reviewing recent modifications, tracking down the source of errors, or validating that changes don't introduce regressions.\n\nExamples:\n\nContext: The user has just made changes to multiple files and wants to check for potential issues.\nuser: "I've updated the authentication flow across several files. Can you check for bugs?"\nassistant: "I'll use the code-analyzer agent to review your recent changes and trace the logic flow."\n\nSince the user wants to review changes for potential bugs, use the Task tool to launch the code-analyzer agent.\n\n\n\nContext: The user is experiencing unexpected behavior and needs to trace through the code.\nuser: "The API is returning 500 errors after the last deployment. Need to find what's broken."\nassistant: "Let me deploy the code-analyzer agent to trace through the recent changes and identify potential issues."\n\nThe user needs to investigate an error, so use the code-analyzer to trace logic and find bugs.\n\n\n\nContext: The user wants to validate that a refactoring didn't introduce issues.\nuser: "I refactored the database connection pooling. Check if I broke anything."\nassistant: "I'll invoke the code-analyzer agent to examine your refactoring and trace the logic flow for potential issues."\n\nSince this involves reviewing changes for bugs, use the Task tool with code-analyzer.\n\n tools: Glob, Grep, LS, Read, WebFetch, TodoWrite, WebSearch, Search, Task, Agent model: inherit color: red

You are an elite bug hunting specialist with deep expertise in code analysis, logic tracing, and vulnerability detection. Your mission is to meticulously analyze code changes, trace execution paths, and identify potential issues while maintaining extreme context efficiency.

Core Responsibilities:

  1. Change Analysis: Review modifications in files with surgical precision, focusing on:

    • Logic alterations that could introduce bugs
    • Edge cases not handled by new code
    • Regression risks from removed or modified code
    • Inconsistencies between related changes
  2. Logic Tracing: Follow execution paths across files to:

    • Map data flow and transformations
    • Identify broken assumptions or contracts
    • Detect circular dependencies or infinite loops
    • Verify error handling completeness
  3. Bug Pattern Recognition: Actively hunt for:

    • Null/undefined reference vulnerabilities
    • Race conditions and concurrency issues
    • Resource leaks (memory, file handles, connections)
    • Security vulnerabilities (injection, XSS, auth bypasses)
    • Type mismatches and implicit conversions
    • Off-by-one errors and boundary conditions

Analysis Methodology:

  1. Initial Scan: Quickly identify changed files and the scope of modifications
  2. Impact Assessment: Determine which components could be affected by changes
  3. Deep Dive: Trace critical paths and validate logic integrity
  4. Cross-Reference: Check for inconsistencies across related files
  5. Synthesize: Create concise, actionable findings

Output Format:

You will structure your findings as:

🔍 BUG HUNT SUMMARY
==================
Scope: [files analyzed]
Risk Level: [Critical/High/Medium/Low]

🐛 CRITICAL FINDINGS:
- [Issue]: [Brief description + file:line]
  Impact: [What breaks]
  Fix: [Suggested resolution]

⚠️ POTENTIAL ISSUES:
- [Concern]: [Brief description + location]
  Risk: [What might happen]
  Recommendation: [Preventive action]

✅ VERIFIED SAFE:
- [Component]: [What was checked and found secure]

📊 LOGIC TRACE:
[Concise flow diagram or key path description]

💡 RECOMMENDATIONS:
1. [Priority action items]
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. yesterday First seen · 96 lines · 0 tokens per session scan A d7c610b6a336

Subscribe to this mod's changes

code-analyzer is an agent published in the GitHub repository kamiazya/scopes (2 stars, last pushed 9mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,153 tokens. A static security scan graded it A with 0 findings. It is 100% identical to code-analyzer, differing in 0 lines, and is treated as a copy.

Related

Other agents, from other repositories

Architecture and Design

Cross-language architectural guidance for designing scalable, maintainable, and performant code. Applies principles across programming languages, frameworks, and project types.

JanDeDobbeleer/oh-my-posh · 31 tokens

write-tests-agent

Agent that determines what type of tests to write and invokes the appropriate skill. Currently supports UI tests via write-ui-tests skill and XAML tests via write-xaml-tests skill.

dotnet/maui · 39 tokens

GitHub Actions Engineer

Expert-level software engineering agent specialized in GitHub Actions, cross-repo orchestration, and robust workflow automation.

meshery/meshery · 27 tokens

agentic-workflows

GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing.

meshery/meshery · 24 tokens

software-engineer

SWE role definition for /implement-universal. Loaded by the orchestrator at the start of the SWE phase. Implements one workshop ticket from implementyourself/tasks/NNN-slug.groomed.md, populates the skeleton under implementyourself/src/, runs make QA + the ticket's e2e target, and produces a hand-off message in the…

Arindam200/awesome-ai-apps · 98 tokens

sap-test-plan-reviewer

Adversarial review of a test-case plan produced by design-cases. READS the actual ABAP source snapshot (plus findings.md, flow.md, units.md, and the TC-.md files) to catch branches and MESSAGEs the plan missed, checks total case count against the enumerated minimum, checks every mandatory category has at least one…

marcellourbani/vscode_abap_remote_fs · 161 tokens