troubleshoot

troubleshoot is a command for Claude Code from bengous/claude-code-plugins. It costs 18 tokens per session (498 once invoked), scanned A, original, MIT.

A diagnostic command for finding the underlying cause of a software bug or issue without changing the code. It investigates the expected behavior, implementation, history, data flow, and test results.

In plain words
What is it for?
Use it to trace errors, inspect recent changes, check types and dependencies, run tests, and document a bug's root cause.
Why use it?
It separates investigation from implementation, making it easier to understand what is actually broken before deciding how to fix it.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the understanding plugin — 2 commands shipped together

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 commands/bengous/claude-code-plugins/troubleshoot
Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins

Made for: Claude Code.

Or install understanding, the plugin that ships this one along with the rest of its 2 commands.

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 troubleshoot

README.md
[![agentmods](https://agentmods.dev/badge/commands/bengous/claude-code-plugins/troubleshoot.svg)](https://agentmods.dev/commands/bengous/claude-code-plugins/troubleshoot)
Your own site
<a href="https://agentmods.dev/commands/bengous/claude-code-plugins/troubleshoot"><img src="https://agentmods.dev/badge/commands/bengous/claude-code-plugins/troubleshoot.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 498 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.1 $0.00018 $0.00498
Opus 5 $0.00009 $0.00249
Sonnet 5 $0.00004 $0.00100
Haiku 4.5 $0.00002 $0.00050

Measured 2d ago against content hash 754757ebf6b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

troubleshoot 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.

understanding/commands/troubleshoot.md · 66 lines

What it actually says

Troubleshooting Task

Problem: $ARGUMENTS

Your Role

You are in diagnostic mode. Find the root cause of the issue. Leave implementation to a separate task.

Instructions

  1. Understand the problem:

    • Ask clarifying questions if the problem description is vague
    • Identify what's broken vs what's expected
  2. Investigate systematically:

    • Read relevant files to understand current implementation
    • Check git history for recent changes: git log --oneline -20, git diff
    • Search for error messages, function definitions, and related code
    • Trace data flow and execution paths
    • Check for type errors, missing dependencies, configuration issues
  3. Add console.log statements when helpful:

    • Use Edit tool to add strategic console.log() statements
    • Log at key execution points: function entry/exit, branches, data transformations
    • Log variable values, types, and state
    • Add clear labels: console.log('[DEBUG:functionName]', variableName)
  4. Run diagnostic commands:

    • Execute the project's test suite
    • Run type checking if TypeScript
    • Start the app and inspect logs, network requests
  5. Document findings:

    • Identify the root cause with file paths and line numbers
    • Explain WHY the issue occurs (not just what fails)
    • List relevant code locations: file.ts:123
    • Summarize the call stack or data flow leading to the issue

Scope Boundaries

Focus exclusively on investigation:

  • Add console.log() statements for debugging
  • Leave all other code unchanged
  • Suggest fixes but defer implementation to a separate task

Output Format

Provide:

  1. Root Cause: Clear explanation of what's wrong and why
  2. Evidence: File paths, line numbers, log output, test results
  3. Context: Related code, recent changes, architectural considerations
  4. Next Steps: Suggested fix approach (ready for implementation task)
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 · 66 lines · 18 tokens per session scan A 754757ebf6b1

Subscribe to this mod's changes

troubleshoot is a command published in the GitHub repository bengous/claude-code-plugins (4 stars, last pushed 4d ago), licensed MIT. It adds 18 tokens to every session and 498 once invoked, about $0.0001 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-09-03.