Feature request: Hook event for /clear command
Resolved 💬 6 comments Opened Jan 29, 2026 by kmichels Closed Mar 1, 2026
Summary
Add a hook event that fires when the user runs /clear to reset the conversation.
Use Case
I use multi-project planning with progress tracking in markdown files. Currently I have:
SessionStarthook to load planning contextStophook to remind about updating progress docs
However, /clear bypasses both — it resets context without triggering SessionEnd or Stop. This means:
- Progress tracking reminders are skipped
- Planning context isn't reloaded after clear
Proposed Solution
Add a Clear or PreClear hook event that fires when /clear is invoked, before the context is wiped. This would allow:
- Saving state before clear
- Prompting about unsaved work
- Running cleanup tasks
Alternatively, /clear could trigger SessionEnd then SessionStart to reuse existing hooks.
Workaround
Currently none — /clear cannot be intercepted or wrapped.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗