claude-sessions-as-root
Notes
- 2026-10-05 finding: Claude Code desktop sessions have been running on the VPS as root since at least 9/20 (six ccd-cli processes started 9/27–9/28 with cwd /root were still alive, plus a root remote server since ~9/20), against CLAUDE.md §21 (sessions run as the claude user). They left root-owned files inside claude-owned repos: 74 in /opt/scripts/.git (objects, refs/heads/master, worktrees/ metadata, FETCH_HEAD), config + packed-refs in /opt/workflow-guides/.git (9/28 11:22), and two root-owned worktree dirs (.claude-worktrees/ in scripts and workflow-guides, 9/20). Symptoms: git fetch failed in /opt/scripts (FETCH_HEAD permission denied), worktrees tripped “dubious ownership”, config writes would fail. Fixed with chown -R claude:claude on those .git dirs and worktree dirs; the root-run nightly push cron also re-roots refs/remotes/origin/master when it moves (seen in /home/claude/.git). Open: find which SSH config launches sessions as root and stop it; the 14 root-owned playwright-mcp orphans (about 2.3 GB RSS with their chromium children) need a root kill that the session’s permission classifier refused.