[Bug] Multi-tab coordination rules in CLAUDE.md are not enforced — tabs duplicate work silently
Bug Description
When running multiple Claude Code tabs with explicit coordination rules in CLAUDE.md and a shared coordination file (doc/session_state.md), tabs do not actually coordinate. They read the coordination documents but don't use them as mutual exclusion mechanisms, leading to duplicated work and potential data conflicts.
Concrete Example
Two Claude Code tabs were running simultaneously:
- Tab A (this session): Wrote 7 SQL files and applied all 7 to the database
- Tab B (other session): Also applied SQL files 05, 06, and 07
Neither tab checked with the other. Neither tab updated session_state.md to claim file ownership before starting. The user had to manually report that Tab B had already applied files 05-07.
In this case, the SQL was idempotent (INSERT IGNORE / WHERE NOT EXISTS), so no data corruption occurred. But for non-idempotent operations (UPDATE, DELETE, schema changes), this coordination failure could cause real damage.
CLAUDE.md Rules That Were Ignored
The project's CLAUDE.md contains an entire section titled "MULTI-TAB DELEGATION — BLOCKING OBLIGATION" with:
- A table of 7 hard triggers for tab splits
- Exact format for suggesting tab splits
- Rules about claiming assignments in session_state.md before starting work
- Rules about not touching files another tab owns
All of these rules were read at session start and none were followed during execution.
Root Cause Hypothesis
Each Claude Code tab operates as an independent conversation with no shared state beyond the filesystem. The coordination documents (session_state.md) are read once at session start but not re-read before each operation. There is no locking mechanism — two tabs can read the same "unclaimed" state and both proceed.
Impact
- Duplicated work (wasted compute/API costs)
- Potential data corruption for non-idempotent operations
- Users who set up coordination infrastructure get false confidence that it works
- The more elaborate the coordination rules in CLAUDE.md, the more surprising the failure
Possible Improvements
- Claude Code could expose a lightweight file-based lock/claim mechanism that tabs check before mutating shared resources
- The model could be trained to re-read coordination files immediately before (not just at session start) performing operations that affect shared state
- At minimum, Claude should update the coordination file to claim work BEFORE starting, not after being reminded
Environment
- Claude Code 2.1.71
- Windows 11
- Multiple Claude Code tabs in Windows Terminal
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗