Work an issue end to end
Give Claude Code an issue number; it reads the full issue on GitHub, finds the cause, implements a fix with a test and runs the suite before reporting.
Task: Work an issue end to end · Other tasks
Fill in the details
The number only. Claude reads the issue itself, so you do not need to summarize it.
Optional. Anything the issue does not say, such as limits on what to change.
Optional. Leave empty and Claude will find how the project runs its tests.
Copy your prompt
This site doesn't run Claude or show model output. Results depend on your input and the model you use.
You've edited the prompt, so changes to the fields aren't applied.
Replace what you've entered for this task with the example? This can't be undone.
What you type is kept in this tab's session storage so a reload doesn't lose it. Use "Clear this task" to remove it. Browsers can restore session data when they reopen tabs, so closing a tab isn't a guaranteed way to erase it.
When to use this template
- The work is already written up as a GitHub issue, and you want Claude to read it in full, including the comments, instead of working from your summary.
- Claude Code can reach GitHub: the
ghCLI is installed and authenticated, or GitHub is added as a claude.ai connector or MCP server. - The issue is a bug or a small, clearly described change that one focused session can finish and verify with tests.
When not to use it
- Neither the
ghCLI nor a GitHub connector is set up. Set one up first, or paste the issue text into a debugging prompt instead. - The issue is a large feature or a discussion with no agreed solution. Plan the change first, or settle the approach in the issue before asking for code.
- The issue comes from an untrusted source and you do not want an agent acting on its contents in your repository. Read it yourself and describe the problem in your own words.
Why this structure
- The opening request gives only the issue number. Claude reads the full ticket itself, so details and comments you would forget to mention still reach it.
- Step 1 says to treat the issue text as a description, not as instructions. Anyone who can comment on an issue can write text in it, and this line states how you want that text used. It cannot stop such text from influencing the work, so read the issue yourself and review the diff before you keep the change.
- Step 2 asks Claude to restate the problem and stop if the issue is unclear or already fixed. You catch a misreading before any code is written.
- A failing test first, then the smallest fix, then a test run until it passes, gives the fix a check and keeps the diff limited to the issue.
- The git setting and the closing rule bound what leaves your machine: Claude may commit locally if you choose, but it does not push, open a pull request or comment on the issue.
Example input (fictional)
- Issue number
312
- Extra context
Only the CSV export is affected; leave the JSON export alone.
- When the fix is done
leave the changes uncommitted for me to review
- Test command
pytest tests/export
Follow-ups to send Claude
- Open a pull request for this branch that links the issue we just worked on and explains the cause and the fix. Confirm the repository and the issue number with me before you create it.
- Search the codebase for the same mistake elsewhere and list every place it occurs. Do not fix them yet.
- Draft a short comment for the issue that explains the cause and the fix, and show it to me before posting.
Common mistakes
- Summarizing the issue in the prompt instead of giving its number. Your summary replaces the full text, including details you did not think were important.
- Letting Claude push or comment as part of the fix. Review the diff and the test output first, then decide what goes to GitHub.
- Skipping the reproducing test. Without one, "the tests pass" may only mean the existing tests never covered the bug.
Related templates
- Debug an error: Turn an error message and the code around it into a ranked list of likely causes, a check for each, and a fix you can try.
- Write tests first, then implement: Have Claude Code write tests that describe a feature before any implementation, confirm they fail, then write code until they all pass.
- Plan a code change before editing: Have Claude Code read the relevant code and propose a file-by-file plan for a multi-file change, without editing anything until you approve it.
Sources
- Claude Code docs: Prompt library (Anthropic documentation)
- Claude Code best practices: Use CLI tools (Anthropic documentation)
- Claude Code docs: Use MCP servers from claude.ai (Anthropic documentation)