Add new rules to the compact token-saving hook.
The compact hook system rewrites verbose Bash commands using regex rules to save context window tokens. This skill helps you design, validate, and add new rules to compact-rules.json.
/eagle-compact-add
Also triggers on: "add compact rules", "compact-add", "this command is too verbose", "compact this command"
- You tell Claude which command is too verbose (or it spots one during your session)
- Claude proposes a rule:
- Flag rule if truncation flags exist (
-n,--limit,--max-count) - Pipe rule if output needs filtering (test results, build logs, lint)
- Flag rule if truncation flags exist (
- Validates the regex pattern against sample commands
- Shows the proposed rule for your confirmation
- Appends the confirmed rule to
compact-rules.json
Proposed rule:
terraform plan → pipe:generic pattern: ^terraform plan\b
Confirm? [y/N]
You: That terraform plan output was way too long, compact it
Claude: [proposes a pipe rule with generic filter, validates, asks to confirm]