Skip to content

Instantly share code, notes, and snippets.

@dima-yah
dima-yah / install-prune.sh
Created May 25, 2026 14:30
/prune — Claude Code slash command that strips tool calls, results, thinking blocks, and file snapshots from the current session's .jsonl file. Keeps all user and assistant text. Same session continues with a lighter context — no reset, no LLM involved. Install with: curl -s https://gist.github.com/dima-yah/b7cd6ab21f8a484f9088207018a1b037/raw |…
#!/usr/bin/env bash
set -e
mkdir -p ~/.claude/commands ~/.local/bin
cat > ~/.local/bin/prune-session.py << 'PYEOF'
#!/usr/bin/env python3
import json, os, sys, glob
cwd = os.getcwd()