Skip to content

claude prune

Copy page

Removes 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.

Terminal window
workmux claude prune
  1. Scans ~/.claude.json for entries pointing to non-existent directories
  2. Creates a backup at ~/.claude.json.bak before making changes
  3. Removes all stale entries
  4. Reports the number of entries cleaned up
  • Only removes entries for absolute paths that don’t exist
  • Creates a backup before modifying the file
  • Preserves all valid entries and relative paths
Terminal window
# Clean up stale Claude Code entries
workmux claude prune
- Removing: /Users/user/project__worktrees/old-feature
✓ Created backup at ~/.claude.json.bak
✓ Removed 3 stale entries from ~/.claude.json