What
Claude Code checks who owns the files and folders it keeps for its sessions. A session is one run of Claude Code. These checks now treat a container (an isolated environment that often runs as the administrator account, root) differently when CLAUDE_CODE_CONTAINER_ID is set:
- Session entries are now sorted into four groups: belonging to Claude Code, belonging to someone else, missing, or unreadable.
- An entry counts as someone else's if it is a symlink (a shortcut pointing to another location) or is owned by a different user account.
- Root counts as the owner only when
CLAUDE_CODE_CONTAINER_IDis set. - Entries belonging to someone else are now dropped from the list Claude Code works with.
- A temporary folder owned by another user, when
CLAUDE_CODE_CONTAINER_IDis set and Claude Code runs as root, is now logged with the correct user ID and used. Before, the check gave up and reused an out-of-date value. - A temporary folder with the wrong permissions is now fixed and checked again.
Why
Ignoring symlinked entries and entries owned by other users makes it harder for planted files to be picked up as session data. The temporary-folder change fixes a bug that affected Claude Code running as root inside containers.