autoArchiveSessions: false ignored for worktree sessions
Resolved 💬 2 comments Opened May 17, 2026 by alahaouas Closed Jun 16, 2026
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
- Set
"autoArchiveSessions": falsein~/.claude/settings.json - Open a Claude Code session inside a git worktree (created via
/worktreeorEnterWorktree) - End the session
- 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.jsoncontains"autoArchiveSessions": false - No project-level
settings.jsonwas 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗