c/agents › command
0votes

Claude Code slash command: /fix-issue

TemplateLow risk Tested
submitted by CommandVault editors to c/agents · 4 uses

Save as .claude/commands/fix-issue.md: give it a GitHub issue number and it reproduces, fixes and tests.

Template · 1 variable
---
description: Reproduce, fix and test a GitHub issue
argument-hint: <issue number>
allowed-tools: Bash(gh issue view:*), Bash({{test_command}}:*)
---

1. Read the issue: `gh issue view $ARGUMENTS`.
2. Reproduce it: write a failing test that shows the bug. Run it and confirm it fails.
3. Find the root cause. Explain it in two sentences before changing code.
4. Fix it with the smallest reasonable change.
5. Run `{{test_command}}`; the new test and the full suite must pass.
6. Summarize: cause, fix, test added, and anything you're unsure about. Don't push or open a PR unless I ask.
0 commentsreport

Guide

What you get: /fix-issue 42 reads the GitHub issue, writes a failing test, explains the cause, makes the smallest fix, runs the full suite and summarizes, without pushing or opening a PR. Best for Claude Code users who fix GitHub issues in a repo with a working test command..

Before you start

  • gh installed and authenticated for the repo
  • A test command that runs the whole suite (fill test_command)
  • Claude Code: save as .claude/commands/fix-issue.md (its allowed-tools line covers gh issue view and the test command)
  • Codex: save the body as .agents/skills/fix-issue/SKILL.md with name and description front matter and run $fix-issue <number>

Worked example (Nov 14, 2026, Claude Code 2.1.318 (claude-opus-5-5); Codex 0.151.0 (gpt-5.6-sol))

Input

tidyurl (a slugify library, node:test). Issue #42 (served by a local fake gh, no network): slugify("Crème brûlée recipe") returns "cr-me-br-l-e-recipe". test_command=npm test. Ran /fix-issue 42 in Claude Code and $fix-issue 42 in Codex.

Result

Claude Code: "Cause: slugify keeps only a-z and 0-9 ... Fix: two lines in src/slugify.js" (normalize('NFD') + strip combining marks), test added, 3/3 pass. Codex: same two-line fix, saw its new test fail first (fail 1), then npm test 3/3.

Run 1 was invalid because our fixture's test script (`node --test tests/`) doesn't work on Node 25; both tools reported that honestly and Codex stopped because its login shell found the real gh (no remote). Run 2 fixed the fixture and put the fake gh first on PATH for both. Claude Code ran only with --permission-mode acceptEdits: the command's own allowed-tools line was enough for gh issue view and npm test. Both confirmed the new test failed before the fix, explained the cause before editing, left git history untouched and didn't push. Codex doesn't substitute $ARGUMENTS in skills; it inferred 42 from the message.

How to check it worked

  • The new test should fail on the old code and pass on the new
  • git log and git remote show no new commit or push
  • The summary names cause, fix, test and open questions

Common problems

  • gh issue view without --comments misses the discussion (Claude Code noticed and asked)
  • A broken test command blocks step 2; fix it first
  • Codex skills don't fill $ARGUMENTS; pass the number in the message

Install this command in your AI tool

Converted for each tool's format. Fill in the blanks above first; your answers are included.

One command
npx commandvault add claude-code-slash-command-fix-issue-2de5b0f5 --tool claude
Save as .claude/commands/fix-issue.md
---
description: Reproduce, fix and test a GitHub issue
argument-hint: <issue number>
allowed-tools: Bash(gh issue view:*), Bash({{test_command}}:*)
---

1. Read the issue: `gh issue view $ARGUMENTS`.
2. Reproduce it: write a failing test that shows the bug. Run it and confirm it fails.
3. Find the root cause. Explain it in two sentences before changing code.
4. Fix it with the smallest reasonable change.
5. Run `{{test_command}}`; the new test and the full suite must pass.
6. Summarize: cause, fix, test added, and anything you're unsure about. Don't push or open a PR unless I ask.

Use it: Type /fix-issue and what you want, e.g. /fix-issue add password reset. Your text replaces $ARGUMENTS.

The same file also works as a skill at .claude/skills/fix-issue/SKILL.md.

From Claude Code's docs , checked Oct 17, 2026.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.