claude-code - 💡(How to fix) Fix autoArchiveSessions: false ignored for worktree sessions

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…

Setting autoArchiveSessions: false in the global ~/.claude/settings.json has no effect on worktree sessions — they are still archived automatically when the session ends.

Root Cause

Setting autoArchiveSessions: false in the global ~/.claude/settings.json has no effect on worktree sessions — they are still archived automatically when the session ends.

Fix Action

Fix / Workaround

  • OS: Windows 11 Pro 10.0.26220
  • Shell: PowerShell (pwsh)
  • Global ~/.claude/settings.json contains "autoArchiveSessions": false
  • No project-level settings.json was present (attempted workaround: added one)
RAW_BUFFERClick to expand / collapse

Summary

Setting autoArchiveSessions: false in the global ~/.claude/settings.json has no effect on worktree sessions — they are still archived automatically when the session ends.

Steps to reproduce

  1. Set "autoArchiveSessions": false in ~/.claude/settings.json
  2. Open a Claude Code session inside a git worktree (created via /worktree or EnterWorktree)
  3. End the session
  4. Observe: the session is archived despite the setting

Expected behavior

The session should not be archived, consistent with the global setting.

Actual behavior

Worktree sessions are archived on close regardless of autoArchiveSessions: false.

Environment

  • OS: Windows 11 Pro 10.0.26220
  • Shell: PowerShell (pwsh)
  • Global ~/.claude/settings.json contains "autoArchiveSessions": false
  • No project-level settings.json was present (attempted workaround: added one)

Possible cause

The worktree session lifecycle may not read the global autoArchiveSessions flag, or it may always archive as part of worktree teardown independent of that setting.

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…

FAQ

Expected behavior

The session should not be archived, consistent with the global setting.

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 autoArchiveSessions: false ignored for worktree sessions