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.

More: all Agent workflows rules · all Claude Code (CLAUDE.md) rules

Related rules

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Code review prompt file (Copilot)

A Copilot prompt file (/review-changes) that reviews the current changes and reports issues by severity without editing.

GitHub CopilotAgent workflows

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

/commit slash command (Claude Code)

A Claude Code /commit slash command that reviews staged changes and writes a Conventional Commits message.

Claude Code (CLAUDE.md)Agent workflows

Context management for long agent sessions CLAUDE.md

CLAUDE.md practices for keeping Claude Code effective in long sessions: lean memory, notes files, subagents, and resets.

Claude Code (CLAUDE.md)Agent workflows

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.