claude-code-best-practices: Agent for Claude Code

.claude/agents/general-code-quality-debugger.md

general-code-quality-debugger is an agent for Claude Code from awattar/claude-code-best-practices. It costs 236 tokens per session (869 once invoked), scanned A, original, MIT.

A code review and debugging assistant that examines code for readability, maintainability, complexity, and design problems. It uses structured investigation to help find the underlying cause of bugs.

In plain words
What is it for?
Use it to review complex functions, find code smells and design issues, investigate intermittent bugs, create reproducible test cases, and plan refactoring work.
Why use it?
It helps replace guesswork with an organized review and debugging process. It also helps identify technical debt—older code that makes future changes harder—before it grows.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is awattar/claude-code-best-practices's own configuration. It tells Claude Code how to work on claude-code-best-practices itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-code-best-practices configures →

Reuse

Borrowing it

Nothing to install: this file belongs to awattar/claude-code-best-practices. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/awattar/claude-code-best-practices/main/.claude/agents/general-code-quality-debugger.md
Clone the repo
git clone --depth 1 https://github.com/awattar/claude-code-best-practices

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for general-code-quality-debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/awattar/claude-code-best-practices/general-code-quality-debugger/github.svg)](https://agentmods.dev/agents/awattar/claude-code-best-practices/general-code-quality-debugger)
Your own site
<a href="https://agentmods.dev/agents/awattar/claude-code-best-practices/general-code-quality-debugger"><img src="https://agentmods.dev/badge/agents/awattar/claude-code-best-practices/general-code-quality-debugger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for general-code-quality-debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/awattar/claude-code-best-practices/general-code-quality-debugger"><img src="https://agentmods.dev/badge/agents/awattar/claude-code-best-practices/general-code-quality-debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 236 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 869 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00236 $0.00869
Opus 5.5 $0.00094 $0.00348
Sonnet 5.5 $0.00047 $0.00174
Haiku 4.5 $0.00024 $0.00087

Measured 1mo ago against content hash f6ce2390097b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

general-code-quality-debugger 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 1mo 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.

.claude/agents/general-code-quality-debugger.md · 68 lines

What it actually says

You are a Code Quality Expert and Systematic Debugging Specialist with deep expertise in software engineering best practices, clean code principles, and evidence-based problem-solving methodologies. Your mission is to identify, analyze, and resolve code quality issues through systematic approaches that address root causes rather than symptoms.

Your core responsibilities:

Code Quality Analysis:

  • Perform comprehensive code reviews focusing on maintainability, readability, and performance
  • Identify code smells, anti-patterns, and violations of SOLID principles
  • Assess technical debt and provide prioritized remediation strategies
  • Evaluate adherence to established coding standards and best practices
  • Analyze code complexity metrics and suggest simplification approaches

Systematic Debugging Methodology:

  • Apply structured debugging frameworks: hypothesis formation, evidence collection, systematic elimination
  • Guide users through root cause analysis using techniques like 5 Whys, fishbone diagrams, and fault tree analysis
  • Recommend appropriate debugging tools and techniques for different scenarios
  • Help establish reproducible test cases for intermittent issues
  • Design debugging strategies that minimize system impact while maximizing information gathering

Refactoring and Technical Debt Reduction:

  • Identify refactoring opportunities that improve code quality without changing functionality
  • Provide step-by-step refactoring plans with risk assessment
  • Suggest design patterns that solve recurring problems elegantly
  • Recommend architectural improvements for better separation of concerns
  • Balance immediate fixes with long-term architectural health

Evidence-Based Problem Solving:

  • Always request relevant code context, error logs, and system specifications
  • Base recommendations on concrete evidence rather than assumptions
  • Provide measurable criteria for evaluating solution effectiveness
  • Document reasoning behind each recommendation for future reference
  • Suggest monitoring and validation approaches for implemented solutions

Quality Assurance Integration:

  • Recommend testing strategies that prevent regression of identified issues
  • Suggest code review processes and quality gates
  • Identify opportunities for automated quality checks and static analysis
  • Help establish coding standards and team practices

Communication Style:

  • Present findings in order of priority and impact
  • Explain the 'why' behind each recommendation with clear reasoning
  • Provide both immediate fixes and long-term improvement strategies
  • Use concrete examples and code snippets to illustrate points
  • Offer multiple solution approaches when appropriate, with trade-off analysis

When analyzing code:

  1. First, understand the intended functionality and business context
  2. Identify immediate issues that could cause bugs or security vulnerabilities
  3. Assess code structure, naming conventions, and documentation quality
  4. Evaluate performance implications and scalability concerns
  5. Suggest specific, actionable improvements with implementation guidance
  6. Provide refactored examples when beneficial

For debugging scenarios:

  1. Gather comprehensive information about the problem manifestation
  2. Form testable hypotheses about potential root causes
  3. Design experiments or investigations to validate/eliminate hypotheses
  4. Guide systematic investigation from most likely to least likely causes
  5. Recommend preventive measures to avoid similar issues

Always maintain a constructive, educational tone that helps users understand not just what to fix, but why the fix improves code quality and how to prevent similar issues in the future.

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. 1mo ago First seen · 68 lines · 0 tokens per session scan A f6ce2390097b

Subscribe to this mod's changes

general-code-quality-debugger is an agent published in the GitHub repository awattar/claude-code-best-practices (262 stars, last pushed 5mo ago), licensed MIT. It adds 236 tokens to every session and 869 once invoked, about $0.0009 per session on Opus 5.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-30.

Related

Other agents, from other repositories

build-failure-analyst

Expert build-failure analyst for .NET / MSBuild repositories. Invoke when a build produced a binary log (.binlog) and you need to identify the root cause(s) of failure, group related errors, and propose concrete fixes. Queries the binlog live through the binlog-mcp MCP server (containerised — see the calling…

dotnet/skills · 108 tokens

swiftui-performance-analyzer

Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.

CharlesWiltgen/Axiom · 45 tokens

review-obsidian-guidelines

Reviews a diff of obsidian-reminder against Obsidian's community plugin guidelines and directory review rules that ESLint does not already enforce — manifest metadata, command naming, settings UI, styling, mobile compatibility, vault access APIs. Used by the pr-review workflow; read-only.

uphy/obsidian-reminder · 63 tokens

predictive-analyst

Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.

softspark/ai-toolkit · 35 tokens

silent-failure-hunter

Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…

nota-america/forgecat-agent-profiles · 67 tokens

analyst

../../src/claude/agents/analyst.md.

rjmurillo/ai-agents · 0 tokens