claude-code - 💡(How to fix) Fix [Bug] /setup-bedrock propagates shell env to all active sessions, causing mid-session model switches and session loss [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48875Fetched 2026-04-16 06:48:34
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/abradley/.local/share/claude/versions/2.1.110 (expected in multi-process scenarios)\n at kU_ (/$bunfs/root/src/entrypoints/cli.js:2751:2153)\n at Mt6 (/$bunfs/root/src/entrypoints/cli.js:2751:1233)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.523Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.542Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:23.739Z"}]

Root Cause

Expected behavior: /setup-bedrock should only affect the current session. Other running sessions should be unaffected. Actual behavior: The wizard sets CLAUDE_CODE_USE_BEDROCK=1 in the live shell environment, which propagates to all child/sibling shell processes running other CC instances, switching them all to Bedrock mid-session. Abnormal exits caused by model errors then prevent session recovery. Impact: Complete loss of session history across all open projects. Sessions cannot be resumed with --continue. Workaround: Run /setup-bedrock only in a fresh terminal with no other CC sessions open.

Fix Action

Fix / Workaround

Expected behavior: /setup-bedrock should only affect the current session. Other running sessions should be unaffected. Actual behavior: The wizard sets CLAUDE_CODE_USE_BEDROCK=1 in the live shell environment, which propagates to all child/sibling shell processes running other CC instances, switching them all to Bedrock mid-session. Abnormal exits caused by model errors then prevent session recovery. Impact: Complete loss of session history across all open projects. Sessions cannot be resumed with --continue. Workaround: Run /setup-bedrock only in a fresh terminal with no other CC sessions open.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/abradley/.local/share/claude/versions/2.1.110 (expected in multi-process scenarios)\n    at kU_ (/$bunfs/root/src/entrypoints/cli.js:2751:2153)\n    at Mt6 (/$bunfs/root/src/entrypoints/cli.js:2751:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.523Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n    at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n    at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.542Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n    at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n    at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:23.739Z"}]
RAW_BUFFERClick to expand / collapse

Bug: /setup-bedrock wizard corrupts all active Claude Code sessions via shell env propagation Version: 2.1.110 Summary: Running /setup-bedrock in one Claude Code session caused all other active CC sessions to switch to Bedrock mid-session, triggering model availability errors and abnormal exits that wiped session history across all projects. Steps to reproduce:

Have multiple Claude Code sessions open across different projects, all using Claude Max subscription In one session, run /setup-bedrock to configure a single project for Bedrock All other open CC sessions immediately switch to Bedrock and begin throwing model availability errors Sessions exit abnormally; claude --continue reports no session found for sessions that were just active

Expected behavior: /setup-bedrock should only affect the current session. Other running sessions should be unaffected. Actual behavior: The wizard sets CLAUDE_CODE_USE_BEDROCK=1 in the live shell environment, which propagates to all child/sibling shell processes running other CC instances, switching them all to Bedrock mid-session. Abnormal exits caused by model errors then prevent session recovery. Impact: Complete loss of session history across all open projects. Sessions cannot be resumed with --continue. Workaround: Run /setup-bedrock only in a fresh terminal with no other CC sessions open.

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.110
  • Feedback ID: ad4af11e-2792-41ef-969d-1df03b0a1d29

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/abradley/.local/share/claude/versions/2.1.110 (expected in multi-process scenarios)\n    at kU_ (/$bunfs/root/src/entrypoints/cli.js:2751:2153)\n    at Mt6 (/$bunfs/root/src/entrypoints/cli.js:2751:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.523Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n    at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n    at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:17.542Z"},{"error":"Error: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file /Users/abradley/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.0.0/hooks/hooks.json. The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.\n    at Mz9 (/$bunfs/root/src/entrypoints/cli.js:1035:6544)\n    at async Pz9 (/$bunfs/root/src/entrypoints/cli.js:1035:12757)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T01:00:23.739Z"}]

extent analysis

TL;DR

Run /setup-bedrock in a fresh terminal with no other Claude Code sessions open to prevent session corruption.

Guidance

  • The issue is caused by the CLAUDE_CODE_USE_BEDROCK=1 environment variable set by /setup-bedrock propagating to all child/sibling shell processes, affecting other Claude Code sessions.
  • To verify the issue, check if other sessions switch to Bedrock and throw model availability errors after running /setup-bedrock in one session.
  • As a temporary workaround, run /setup-bedrock in a separate terminal to isolate its effects.
  • Consider reviewing the environment variable handling in the /setup-bedrock wizard to prevent unintended propagation.

Example

No code snippet is provided as the issue is related to environment variable propagation and shell process management.

Notes

The provided errors in JSON format seem unrelated to the primary issue of session corruption caused by environment variable propagation. The Duplicate hooks file detected errors may be a separate issue that requires attention.

Recommendation

Apply the workaround: run /setup-bedrock in a fresh terminal with no other Claude Code sessions open. This will prevent the environment variable from affecting other sessions until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] /setup-bedrock propagates shell env to all active sessions, causing mid-session model switches and session loss [2 comments, 3 participants]