claude prune
Copy pageRemoves stale entries from Claude config (~/.claude.json) that point to
deleted worktree directories. When you run Claude Code in worktrees, it stores
per-worktree settings in that file. Over time, as worktrees are merged or
deleted, it can accumulate entries for paths that no longer exist.
workmux claude pruneWhat happens
Section titled “What happens”- Scans
~/.claude.jsonfor entries pointing to non-existent directories - Creates a backup at
~/.claude.json.bakbefore making changes - Removes all stale entries
- Reports the number of entries cleaned up
Safety
Section titled “Safety”- Only removes entries for absolute paths that don’t exist
- Creates a backup before modifying the file
- Preserves all valid entries and relative paths
Examples
Section titled “Examples”# Clean up stale Claude Code entriesworkmux claude pruneExample output
Section titled “Example output” - Removing: /Users/user/project__worktrees/old-feature
✓ Created backup at ~/.claude.json.bak✓ Removed 3 stale entries from ~/.claude.json