Preflight Checklist
What's Wrong?
Cowork global instructions silently revert to an older version after being saved through the Claude Desktop settings UI.
When editing global instructions via Settings → Cowork → Edit Global Instructions → Save, the new instructions appear to save successfully. However, within minutes they silently revert to an older version — typically the version that was active when an existing Cowork session was started.
This has been reproduced 20+ times over 2 weeks with consistent behavior. The save always appears to succeed in the UI, but the instructions always revert.
Mechanism (traced to root cause)
This is the Cowork-specific manifestation of the .claude.json stale-write race condition documented in #27941 (now closed as stale). The root cause, confirmed via deobfuscated source analysis in that issue:
- Global instructions are stored in
~/.claude.json alongside internal app state (tipsHistory, cachedStatsigGates, OAuth tokens, migration flags, etc.)
- Each active Cowork session holds an in-memory copy of the config at session start time
- Claude Desktop writes to
.claude.json continuously during normal operation for internal state updates
- Each write follows a read-modify-write cycle using the session's stale in-memory copy
- The
saveConfigWithLock function detects external modification (mtime/size change from the user's save) and logs tengu_config_stale_write telemetry — but does not abort the write
- The fallback path uses a 1-second in-memory cache, further ensuring fresh disk changes are lost
Result: Any active Cowork session writing any internal state back to .claude.json silently overwrites the user's freshly saved global instructions with its stale copy. Old sessions don't need to be doing anything visible — even background state writes trigger the overwrite.
What Should Happen?
Saving global instructions via the UI should persist reliably regardless of how many Cowork sessions are active. The save should never be silently reverted.
Why This Is Not a Duplicate
Error Messages/Logs
No error messages are displayed — the save appears to succeed. The revert is completely silent. The only trace is the tengu_config_stale_write telemetry event logged internally, which is invisible to the user.
Steps to Reproduce
- Open Claude Desktop → Cowork tab
- Start a Cowork session (or have one already running)
- Go to Settings → Cowork → Edit Global Instructions
- Make a visible change to the instructions text
- Click Save
- Wait 1–5 minutes (or start a new Cowork session)
- Return to Settings → Cowork → Global Instructions
- Result: Instructions have reverted to the version that was active when the existing session started
More reliably reproduced when multiple Cowork threads/sessions exist, as each holds its own stale copy.
Suggested Fix
Short-term: When tengu_config_stale_write is detected, re-read from disk and merge (or at minimum abort the write) instead of overwriting.
Long-term (as proposed in #27941 and #30329): Separate internal state (~/.claude/state.json) from user-editable config (~/.claude/config.json) so internal writes can never touch user settings.
Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
Latest Claude Desktop (March 2026)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
N/A (Cowork Desktop UI)
Additional Information
Impact: This bug makes Cowork's global instructions feature effectively unusable for power users who maintain detailed instruction sets. The only reliable workaround is to put all instructions in a CLAUDE.md file in the mounted folder, which bypasses .claude.json entirely.
Related issues: #27941, #20637, #24578, #29929, #30329, PR #29077 (unmerged community fix for the race condition)
Preflight Checklist
What's Wrong?
Cowork global instructions silently revert to an older version after being saved through the Claude Desktop settings UI.
When editing global instructions via Settings → Cowork → Edit Global Instructions → Save, the new instructions appear to save successfully. However, within minutes they silently revert to an older version — typically the version that was active when an existing Cowork session was started.
This has been reproduced 20+ times over 2 weeks with consistent behavior. The save always appears to succeed in the UI, but the instructions always revert.
Mechanism (traced to root cause)
This is the Cowork-specific manifestation of the
.claude.jsonstale-write race condition documented in #27941 (now closed as stale). The root cause, confirmed via deobfuscated source analysis in that issue:~/.claude.jsonalongside internal app state (tipsHistory, cachedStatsigGates, OAuth tokens, migration flags, etc.).claude.jsoncontinuously during normal operation for internal state updatessaveConfigWithLockfunction detects external modification (mtime/size change from the user's save) and logstengu_config_stale_writetelemetry — but does not abort the writeResult: Any active Cowork session writing any internal state back to
.claude.jsonsilently overwrites the user's freshly saved global instructions with its stale copy. Old sessions don't need to be doing anything visible — even background state writes trigger the overwrite.What Should Happen?
Saving global instructions via the UI should persist reliably regardless of how many Cowork sessions are active. The save should never be silently reverted.
Why This Is Not a Duplicate
.claude.jsonbroadly, focused on MCP server env vars. This issue is specifically about the Cowork Desktop UI for global instructions, which is a different user surface and a different team's domain.Error Messages/Logs
No error messages are displayed — the save appears to succeed. The revert is completely silent. The only trace is the
tengu_config_stale_writetelemetry event logged internally, which is invisible to the user.Steps to Reproduce
More reliably reproduced when multiple Cowork threads/sessions exist, as each holds its own stale copy.
Suggested Fix
Short-term: When
tengu_config_stale_writeis detected, re-read from disk and merge (or at minimum abort the write) instead of overwriting.Long-term (as proposed in #27941 and #30329): Separate internal state (
~/.claude/state.json) from user-editable config (~/.claude/config.json) so internal writes can never touch user settings.Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
Latest Claude Desktop (March 2026)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
N/A (Cowork Desktop UI)
Additional Information
Impact: This bug makes Cowork's global instructions feature effectively unusable for power users who maintain detailed instruction sets. The only reliable workaround is to put all instructions in a
CLAUDE.mdfile in the mounted folder, which bypasses.claude.jsonentirely.Related issues: #27941, #20637, #24578, #29929, #30329, PR #29077 (unmerged community fix for the race condition)