fix-github-issue — Claude Code command: fix issues and install
This command takes a GitHub issue number, investigates the related code, and works through a fix with tests. Use it to carry an issue from its report to a commit.
npx claude-code-templates@latest --command git-workflow/fix-github-issueWhat fix-github-issue does
Pass an issue number to start. The command retrieves its details with gh issue view, searches the project for relevant files, and makes the required code changes. GitHub tasks use the GitHub CLI (gh).
It then writes and runs tests, checks linting and types, and prepares a descriptive commit message. You need an installed and configured gh to fetch the issue; without it, the command cannot retrieve the task details. Install it in Claude Code with npx claude-code-templates@latest --command git-workflow/fix-github-issue.
What it helps with
- fetch a GitHub issue by number
- locate project files related to a reported problem
- change code to address an issue
- check a fix with tests, linting, and type checks
- prepare a descriptive commit message
Example prompts for the agent
- Investigate and fix GitHub issue 123:
/fix-github-issue 123 - Fix issue 42, add tests, and check linting and types:
/fix-github-issue 42
How to install fix-github-issue
1claude-code-templates
npx claude-code-templates@latest --command git-workflow/fix-github-issue2Manually: put the files in place
.claude/commands/fix-github-issue.mdCall it with /fix-github-issue. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/fix-github-issue.mdCall it with /prompts:fix-github-issue. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/fix-github-issue.prompt.mdManually: put the files in place
.gemini/commands/fix-github-issue.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about fix-github-issue
How do I install fix-github-issue in Claude Code?
Run npx claude-code-templates@latest --command git-workflow/fix-github-issue. The command is installed at .claude/commands/fix-github-issue.md.
What does fix-github-issue do?
It fetches an issue by number, finds related files, and edits the code. It then runs tests, checks linting and types, and prepares a commit message.
Does fix-github-issue need GitHub CLI?
Yes. It uses gh issue view to retrieve issue details and relies on GitHub CLI (gh) for GitHub tasks.
Source text
fix-github-issue.md · MIT
--- description: "Analyze and fix a GitHub issue by number, with tests and a commit" --- Please analyze and fix the GitHub issue: $ARGUMENTS. Follow these steps: 1. Use `gh issue view` to get the issue details 2. Understand the problem described in the issue 3. Search the codebase for relevant files 4. Implement the necessary changes to fix the issue 5. Write and run tests to verify the fix 6. Ensure code passes linting and type checking 7. Create a descriptive commit message Remember to use the GitHub CLI (`gh`) for all GitHub-related tasks.
© davila7 · MIT · davila7/claude-code-templates