[BUG] Force-stopping a workflow clears the agent journal/cache, breaking resume
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Force-killing a workflow (TaskStop) clears the journal cache. When a workflow is stopped mid-run
and then resumed with resumeFromRunId, the completed agent results are not replayed from cache — the
workflow restarts from 0. The docs say completed agents return cached results on resume, but this
doesn't hold when the prior run was stopped rather than naturally completed/failed.
Repro for #1: Launch a workflow with 50+ agents, stop it mid-run with TaskStop, then call
Workflow({scriptPath, resumeFromRunId}) — progress resets to 0/N instead of continuing from where it
left off.
What Should Happen?
It should pick up on the cached data from the agents
Error Messages/Logs
Steps to Reproduce
- Launch a workflow with many parallel agents (we had ~59):
Workflow({ script: "..." })
- Note the returned Run ID (e.g. wf_fa220529-84e) and Task ID (e.g. wu1wgavg2).
- Let it run partially — some agents complete, some fail or are still in-flight.
- Attempt to resume the still-running workflow:
Workflow({ scriptPath: "...", resumeFromRunId: "wf_fa220529-84e" })
- → This correctly errors: "Workflow is still running. Stop it first with TaskStop."
- Stop the running workflow:
TaskStop({ task_id: "wu1wgavg2" })
- Resume with the same run ID:
Workflow({ scriptPath: "...", resumeFromRunId: "wf_fa220529-84e" })
- Expected: Completed agents replay from cache; only failed/incomplete agents re-run. Progress
counter starts at e.g. 32/59.
- Actual: Workflow restarts from 0/59. All agents re-run from scratch, including ones that had
already completed successfully.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.195
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗