fix-bug

fix-bug is a command for Claude Code from pablomarin/claude-codex-forge. It costs 0 tokens per session (3,240 once invoked), scanned A, original, MIT.

A step-by-step workflow for investigating and fixing software bugs. It uses separate debugging, planning, implementation, and code-review steps, and requires specific add-ons to be installed and enabled.

In plain words
What is it for?
Use it to investigate a reported bug, plan the fix, implement it, simplify the resulting code, and review the changes before finishing.
Why use it?
It gives bug fixes a consistent process instead of relying on ad-hoc changes. It also checks that work happens in an isolated worktree, a separate copy of the repository.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to investigate a reported bug, plan the fix, implement it, simplify the resulting code, and review the changes before finishing.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/pablomarin/claude-codex-forge/fix-bug
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.

Clone the repo
git clone --depth 1 https://github.com/pablomarin/claude-codex-forge

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 fix-bug

README.md
[![agentmods](https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/fix-bug/github.svg)](https://agentmods.dev/commands/pablomarin/claude-codex-forge/fix-bug)
Your own site
<a href="https://agentmods.dev/commands/pablomarin/claude-codex-forge/fix-bug"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/fix-bug/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 fix-bug

Your own site · 80×15
<a href="https://agentmods.dev/commands/pablomarin/claude-codex-forge/fix-bug"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/fix-bug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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 3,240 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.00000 $0.03240
Opus 5.5 $0.00000 $0.01296
Sonnet 5.5 $0.00000 $0.00648
Haiku 4.5 $0.00000 $0.00324

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

Security

Grade A, and why

fix-bug 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 10d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

commands/fix-bug.md · 233 lines

How it starts

The opening of the file, as written. The whole thing — 233 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/fix-bug — Host-Neutral Systematic Bug-Fix Workflow

Diagnose and fix a reproducible defect through an open PR. The active Claude Code or Codex host is the main agent for this session; there is no permanent main engine.

Apply the shared Startup boundary before the first workflow step. It is the canonical activation, resume, isolation, and setup-failure contract.

0. Resume or Start

  1. Read .forge/instructions.md and .forge/rules/, resolve the active host, then run .forge/hooks/lib/workflow-state.sh show (PowerShell: the .ps1 twin). If canonical state is absent or invalid, stop and use the setup/migration path; never reconstruct it ad hoc.
  2. If this worktree already has the matching workflow active, use workflow-state.sh checkpoint with the displayed phase and exact next step to record Last active host, then resume that exact next unchecked durable step. If it is inactive, continue only through the deterministic worktree/base preflight below. Forge provides no edit lock: concurrent sessions are allowed, including simultaneous editing; coordinate overlapping writes. If any session mutates the candidate, candidate-bound evidence becomes stale and must be regenerated before certification.
  3. Work outside the protected default branch in one isolated physical worktree, reusing an existing prepared native worktree when present. If none exists, use the portable helper where allowed: .forge/hooks/lib/worktree-lifecycle.sh create --kind fix --name <slug> --base <ref-or-sha> (PowerShell: worktree-lifecycle.ps1 -Action Create -Kind fix -Name <slug> -Base <ref-or-sha>). In a fresh host-native worktree, normalize and seed it before activation with .forge/hooks/lib/worktree-lifecycle.sh adopt --kind fix --name <slug> --base <ref-or-sha> --worktree "$PWD" (PowerShell: worktree-lifecycle.ps1 -Action Adopt -Kind fix -Name <slug> -Base <ref-or-sha> -Worktree $PWD.Path). This safely replaces a clean, unpublished host-generated branch name with fix/<slug>; it never renames protected, dirty, shared, or published work. Only in the Forge source checkout, when the installed path is absent, use the tracked hooks/lib/worktree-lifecycle.sh or .ps1. Native creation or adoption is optional only under the shared startup boundary; never create a second worktree for the same-directory handoff.
  4. Continue in the current session by default; switch only if the developer chooses to. A session opened in the primary checkout may continue the linked worktree by using it as the working directory for local edits, reviews, verification, approval recording and normal receipt-validating promotion. Before direct commit, push or PR creation, follow Shipping from the current session. Shipping hooks use the host's event cwd; selecting only the tool working directory does not change that hook context. The procedure verifies the exact task locally while preserving native hooks and authorization. The installed adapter declares the current host for reviewer routing. No per-worktree Forge receipt, copied session identity, or hook-trust bypass is required.
  5. The helper seeds only ## State (with ### Now cleared), ## Open Questions, and ## Blockers from the primary checkout and writes the exact baseline to .forge/local/.state-seed-snapshot.md. It never seeds workflow, goal, authorization, receipts, evidence, or local memory. The create and adopt actions both seed state. If an inactive native worktree already has both state and its snapshot, adopt preserves them; if only one exists or a workflow is active, stop rather than guessing or overwriting it.
  6. In the target worktree, run workflow-state.sh show and resolve the intended base ref. If state is inactive, invoke .forge/hooks/lib/workflow-state.sh activate --host <claude|codex> --workflow fix-bug --task <slug> --base-ref <ref-or-sha> --phase diagnosis --next-step 'reproduce the symptom' before any discretionary investigation or tracked mutation. On Windows, use the .ps1 twin. The helper resolves and freezes the base SHA. Reuse an already-recorded base for an adopted active worktree; when ancestry is ambiguous, require an explicit base before activation. Never recompute from a later-moving default branch.
  7. Replace the active workflow checklist with:

Read the full file on GitHub · 233 lines

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. 10d ago Changed · +14 lines 58db220f0f29
  2. 11d ago Changed · +3 lines aef8ff5bf29d
  3. 13d ago Changed · +1 lines e8fcab74ae32
  4. 16d ago Changed · +8 lines 644132b499af
  5. 17d ago Changed · +11 lines cd7de36220c4
  6. 20d ago Changed · +26 lines 5a99bde9640a
  7. 1mo ago Changed · -1,069 lines scan B → A 522c50bdc000
  8. 1mo ago First seen · 1,239 lines · 0 tokens per session scan B edd7ded1bf98

Subscribe to this mod's changes

fix-bug is a command published in the GitHub repository pablomarin/claude-codex-forge (5 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,240 tokens. 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 commands, from other repositories