Home › Agent workflows › /fix-issue slash command (Claude Code)
/fix-issue slash command (Claude Code)
A Claude Code /fix-issue command that reads a GitHub issue, reproduces it with a test, fixes it, and reports back.
Claude Code (CLAUDE.md)Agent workflows
How to use
Save this as .claude/commands/fix-issue.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
.claude/commands/fix-issue.mdDownload ---
description: Fix a GitHub issue end to end on a local branch (no push)
allowed-tools: Bash(gh issue view:*), Bash(git:*), Read, Grep, Glob, Edit, Write, Bash
argument-hint: <issue-number>
---
## Issue
!`gh issue view $ARGUMENTS --json number,title,body,labels,comments`
## Steps
1. Summarize the issue in your own words and the expected behavior. If the issue lacks reproduction details, say what's missing and make the most reasonable assumption explicit.
2. Create a branch: `git switch -c fix/$ARGUMENTS-<short-slug>`.
3. Locate the relevant code (Grep/Glob, read the files).
4. Write a failing test that reproduces the issue. Run it and show that it fails for the right reason.
5. Implement the smallest fix for the root cause. Follow the conventions in CLAUDE.md.
6. Run the related tests, then the full suite, lint, and typecheck commands documented in the repo.
7. Commit with a Conventional Commits message ending in `Fixes #$ARGUMENTS`.
## Rules
- Do not push, open a PR, or comment on the issue. I'll review first.
- Don't change unrelated code or update dependencies.
- Don't weaken or skip existing tests.
## Report
Root cause, files changed, test added, commands run with results, and any follow-ups.