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

  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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗