history-pruner

Prune Claude Code conversation history files with conservative or aggressive modes.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Folly-Partners/claudesync --skill history-pruner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: history-pruner
Source: https://github.com/Folly-Partners/claudesync/tree/main/skills/history-pruner
Command: npx skills add https://github.com/Folly-Partners/claudesync --skill history-pruner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

Prunes old Claude Code conversation history to save disk space by trimming large JSONL files and old thinking blocks.

Core Features & Use Cases

  • Conservative pruning: Keeps the last 7 days of history and truncates tool results to 500 characters for older entries.
  • Aggressive pruning: Keeps the last 3 days and removes tool_results content entirely for older entries, plus pruning thinking blocks and old file-history snapshots.
  • Automation & safety: Backups created before pruning; supports dry-run mode and manual pruning steps.
  • Use Case: Maintain lean local Claude Code histories across multiple Macs to prevent disk bloat when syncing.

Quick Start

Check current sizes: du -sh ~/.claude/projects/**/*.jsonl | sort -hr | head -10 Run pruning: ~/.claude/plugins/marketplaces/Folly/skills/history-pruner/prune-history.sh [conservative|aggressive] Dry run: ~/.claude/plugins/marketplaces/Folly/skills/history-pruner/prune-history.sh --dry-run

Frequently Asked Questions about history-pruner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I free up disk space from Claude Code conversation history?

Prune old Claude Code history files using conservative or aggressive modes to trim JSONL files and remove large tool results and thinking blocks. Conservative mode keeps 7 days of history; aggressive keeps 3 days and removes tool_results entirely for older entries, reclaiming significant disk space without losing recent context.

Can I safely test history pruning before applying changes?

Yes, run the pruning script with --dry-run mode to simulate the operation and see what would be removed without modifying files. Backups are automatically created before any pruning executes, allowing you to restore if needed.

What's the difference between conservative and aggressive pruning modes?

Conservative pruning retains 7 days of history and truncates tool results to 500 characters for older entries, preserving more context. Aggressive pruning keeps only 3 days, removes tool_results entirely for older entries, and also prunes thinking blocks and old file-history snapshots for maximum disk reclamation.

How do I identify which history files are consuming the most disk space?

Use `du -sh ~/.claude/projects/**/*.jsonl | sort -hr | head -10` to list the largest JSONL history files in your local Claude Code projects, helping you understand where disk usage concentrates before running pruning.

Does history pruning work with multiple Claude Code projects or Macs?

Yes, the pruning script operates on all files under ~/.claude/projects, making it suitable for maintaining lean histories across multiple local projects and synced Macs to prevent disk bloat from accumulated conversation data.