[BUG] Running agent stops when navigating back to a previous message
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start by tracing how conversation navigation and editing handle active agent runs, then follow the cancellation path when a previous message is retried. The report names no files or tests, so first locate the relevant terminal UI and agent lifecycle code and inspect existing coverage. Done means reproducing the steps no longer cancels an unrelated running agent, while explicit cancellation still works.
Written by the indexing model from the issue text.
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
Bug Description
When I start an agent and it is still running, then navigate back to a previous message in the conversation to edit or retry a prompt, the running agent is automatically canceled.
The agent's task is completely unrelated to the message I'm editing.
Steps to Reproduce:
- Start an agent with a task.
- While the agent is running, send another prompt.
- Navigate back to an earlier message and edit or retry it.
- The running agent gets canceled unexpectedly.
Expected Behavior:
The running agent should continue executing independently unless I explicitly cancel it or modify the task it is working on.
Actual Behavior:
The agent stops automatically when I navigate back and edit an unrelated message.
Impact:
This interrupts development workflows, wastes time and tokens, and forces me to restart tasks unnecessarily.
What Should Happen?
The running agent should continue working independently, even when I navigate back to an earlier message, edit it, or retry a different prompt.
Editing or retrying an unrelated message should not automatically cancel any active agents.
Agents should only stop when I explicitly cancel them or when their own task is affected.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code and start an agent with a task that takes some time to complete.
- While the agent is still running, send a new prompt in the conversation.
- Navigate back to an earlier message in the conversation.
- Edit or retry that previous message.
- Observe that the running agent is automatically canceled, even though its task is completely unrelated to the edited message.
Expected: The agent should continue running independently.
Actual: The agent is unexpectedly canceled without explicitly requesting cancellation.
Note: This issue interrupts ongoing development tasks and causes unnecessary token consumption when tasks need to be restarted.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.287 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 25k
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/claude-code
-
area:hooks area:plugins bug has repro platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111771 ·
-
area:docs bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111658 ·
-
area:core bug platform:linux platform:wsl regression
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anthropics/claude-code#111548 ·
-
area:vscode bug has repro platform:vscode platform:windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anthropics/claude-code#111416 ·
-
area:plugins area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111195 ·
All issues in anthropics/claude-code
Similar issues
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
bug extension mcp
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primer/primitives#1426 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2941 ·
Maintainers usually reply within 4 days