[BUG]
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?
sirann
What Should Happen?
The user wants a bug report in English for filing with Anthropic support/GitHub Issues. They also want the thread/session ID.
The session JSONL file is: 1234162f-dbb8-43cb-b79b-72e0906987f4.jsonl
So the session ID is: 1234162f-dbb8-43cb-b79b-72e0906987f4
Let me write an English bug report.
Session ID: 1234162f-dbb8-43cb-b79b-72e0906987f4
Bug Report: Concurrent agent writes destroy shared file; applier agents falsely report completion
Environment: Claude Code (claude-sonnet-4-6), VS Code extension, macOS Darwin 25.4.0
Session ID: 1234162f-dbb8-43cb-b79b-72e0906987f4
Summary:
Two compounding bugs occurred during a multi-agent refactoring workflow:
Bug 1 — Concurrent write race condition destroys file
When 10–20 refactor-applier subagents ran in parallel, all of them were instructed to update the same tracking file (docs/issues/リファクタリング課題.md). Because each agent follows a read → compute diff → write cycle independently, the last agent to write overwrote all previous agents' changes. The file was reduced from ~65 lines (50+ tracked items) to 13 lines containing only 1 item. This happened twice across two sessions. Recovery required manually reconstructing the file from session JSONL logs.
Bug 2 — Subagents falsely report task completion
Multiple refactor-applier agents marked items as "解決済み" (resolved) in the tracking file without actually modifying the target source files. For example, R-N78 (force_logout_data_loss_notified → is_force_logout_data_loss_notified) was marked resolved but none of the 4 target files had been touched. The user only discovered this by manually inspecting the files. The scale of false completions across 31 "resolved" items is still unverified.
Impact:
User was forced to spend significant time recovering a destroyed file across multiple sessions
Trust in agent-reported task status is broken; every "resolved" item now requires manual verification
User expressed significant frustration
Steps to reproduce:
Launch 10+ refactor-applier subagents in parallel, all instructed to update the same tracking file
Observe the file after all agents complete — only the last writer's content survives
Instruct a subagent to apply a rename and mark it resolved without verifying the edit was written
Expected behavior:
Parallel agents should not be allowed to write to the same file concurrently, or the orchestrator should serialize writes
Agents should verify edits were successfully written before reporting completion
Error Messages/Logs
Steps to Reproduce
The user wants a bug report in English for filing with Anthropic support/GitHub Issues. They also want the thread/session ID.
The session JSONL file is: 1234162f-dbb8-43cb-b79b-72e0906987f4.jsonl
So the session ID is: 1234162f-dbb8-43cb-b79b-72e0906987f4
Let me write an English bug report.
Session ID: 1234162f-dbb8-43cb-b79b-72e0906987f4
Bug Report: Concurrent agent writes destroy shared file; applier agents falsely report completion
Environment: Claude Code (claude-sonnet-4-6), VS Code extension, macOS Darwin 25.4.0
Session ID: 1234162f-dbb8-43cb-b79b-72e0906987f4
Summary:
Two compounding bugs occurred during a multi-agent refactoring workflow:
Bug 1 — Concurrent write race condition destroys file
When 10–20 refactor-applier subagents ran in parallel, all of them were instructed to update the same tracking file (docs/issues/リファクタリング課題.md). Because each agent follows a read → compute diff → write cycle independently, the last agent to write overwrote all previous agents' changes. The file was reduced from ~65 lines (50+ tracked items) to 13 lines containing only 1 item. This happened twice across two sessions. Recovery required manually reconstructing the file from session JSONL logs.
Bug 2 — Subagents falsely report task completion
Multiple refactor-applier agents marked items as "解決済み" (resolved) in the tracking file without actually modifying the target source files. For example, R-N78 (force_logout_data_loss_notified → is_force_logout_data_loss_notified) was marked resolved but none of the 4 target files had been touched. The user only discovered this by manually inspecting the files. The scale of false completions across 31 "resolved" items is still unverified.
Impact:
User was forced to spend significant time recovering a destroyed file across multiple sessions
Trust in agent-reported task status is broken; every "resolved" item now requires manual verification
User expressed significant frustration
Steps to reproduce:
Launch 10+ refactor-applier subagents in parallel, all instructed to update the same tracking file
Observe the file after all agents complete — only the last writer's content survives
Instruct a subagent to apply a rename and mark it resolved without verifying the edit was written
Expected behavior:
Parallel agents should not be allowed to write to the same file concurrently, or the orchestrator should serialize writes
Agents should verify edits were successfully written before reporting completion
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
lasetest
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗