[Feature Request] Allow custom commands to hook and invoke `/compact` with generated arguments
Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 2 comments · opened Jul 30, 2026
Bug Description
I have my own /compact command that constructs args for the system /compact command but unfortunately it can neither hook the /compact command to give it those args nor invoke /compact itself. So I have to do this all the time:
❯ /cc-context-preserving-compact ⏺ /compact @.claude/compact-context-9858f5b0.md Copy-run the above to compact — writing the instructions to that file now; I can't trigger /compact myself. · Booping… (46s · ↓ 2.0k tokens) ❯ /compact @.claude/compact-context-9858f5b0.md
Please enhance the compact hook so /compact or auto compact will run my command to generate the args to compact. Thank you! :)
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.220
- Feedback ID: f5297dc7-6bfd-4e21-a657-a18a31a07e67
Errors
[]This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗