[FEATURE] Add `app:compact` bindable keybinding action
Preflight Checklist
- [x] I have searched existing requests and this specific feature isn't currently tracked by an open issue
- [x] This is a single feature request (not multiple features)
Problem Statement
The keybindings system (~/.claude/keybindings.json) binds keys to a fixed enum of built-in actions (app:toggleTodos, chat:externalEditor, etc.). There is no action for compacting the conversation, so /compact cannot be bound to a key or chord. Users who compact frequently must type the slash command every time, and /compact (a harness primitive) is also unreachable from custom commands, skills, and hooks.
Proposed Solution
Add a bindable app:compact action to the keybindings action list (Global context), so users can do e.g.:
{
"context": "Global",
"bindings": { "ctrl+k ctrl+c": "app:compact" }
}
Invoking it would trigger the same flow as typing /compact. Optionally accept the same free-form instruction argument that /compact <instructions> supports (not required for a first cut).
Alternative Solutions
- Type
/compactmanually (current state). - Rely on
autoCompactthreshold — but that's automatic/mid-session, not an on-demand manual trigger.
Priority
Low/Medium — quality-of-life for heavy users.
Feature Category
Interactive mode (TUI) — keybindings.
Use Case Example
I compact at natural breakpoints many times per session. A single key chord is much faster and less error-prone than typing the command each time.
Additional Context
This is not a duplicate of the following, which the auto-triage bot previously conflated:
- #40837 ("Ask user whether to compact or quit") — about prompting the user at autocompact/exit time. Closed as
not_planned. Different mechanism. - #43195 ("compact-on-exit setting and app:compact keybinding action") — requested this exact
app:compactaction bundled with a separatecompactOnExitsetting; it was auto-closed as a duplicate of #40837 (an imprecise match) and is now locked.
This request is deliberately scoped to only the app:compact bindable keybinding action — nothing about exit behavior — so it can be evaluated on its own.