Claude Code bug: a root run makes your config unreadable, then silently wipes it

scscgit · ghdev · 2026-11-17

A confirmed data-loss bug (has repro) in anthropics/claude-code: running Claude Code as root on a user-owned config dir (sudo -E claude, or docker exec shells) rewrites .claude.json and creates root-owned sessions/, backups/, etc. The owner can no longer read their config; Claude Code then treats it as missing, runs first-run onboarding, and replaces it with a near-empty file within a second.

The reporter asks that an EACCES config never be replaced without a readable copy (like the existing .corrupted behavior, issue #106634), and that ownership be preserved regardless of who runs the tool.

Original post →

More from coding & agent

coding & agent channel →