Analyze conversation and auto-execute /compact with smart preservation instructions
Analyzes conversation context and auto-executes /compact with smart preservation instructions.
/plugin marketplace add kp222x/claude-plugins/plugin install smart-compact@kp-claude-pluginsYou are about to help prepare for context compaction. Analyze the current conversation thoroughly and generate preservation instructions.
FIRST - Capture tmux session - Run this bash command IMMEDIATELY before doing anything else:
tmux display-message -p '#S' > ~/.claude/smart-compact-session.txt 2>/dev/null || echo "" > ~/.claude/smart-compact-session.txt
This saves the tmux session name for background command sending (no focus stealing).
Analyze the conversation - Review what we've been working on:
Generate compact instructions - Create a concise set of instructions for /compact that preserves:
Save instructions to file - Write the instructions to ~/.claude/smart-compact-instructions.txt (cross-platform path)
Auto-execute compact - After saving, run this command to trigger the compact:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/auto-compact.py"
Notify the user - Output:
Smart compact instructions saved and auto-compact triggered.
The /compact command will execute automatically.
Keep instructions concise but comprehensive. Example format:
Preserve: [Main task/goal being worked on]
Files: [Key files being modified with brief purpose]
Progress: [Current state - what's done, what's next]
Context: [Critical technical details needed to continue]
Decisions: [Key choices made and why]
Continue: [Explicit instruction for what to do after compact - e.g., "Continue implementing X" or "Resume fixing the bug in Y"]