Feature request: compact-on-exit setting and app:compact keybinding action

Resolved 💬 3 comments Opened Apr 3, 2026 by chrishwiggins Closed Apr 7, 2026

Problem

There's no way to compact and exit a session as a single action. /compact and /exit are harness primitives that can't be invoked from custom commands, skills, hooks, agents, or keybindings.

Typing /compact then waiting then /exit works, but chaining them (e.g. /compact ; /exit) quits without compacting.

Requested features (either would solve it)

  1. compactOnExit setting (boolean): automatically compact the conversation before exiting. Analogous to how autoCompact triggers compaction at a context threshold.
  1. app:compact keybinding action: expose compact as a bindable action so users can create key chords (e.g. ctrl+k ctrl+q bound to compact, then exit). Currently the keybindings action list has no compact equivalent.

Context

  • autoCompact (threshold-based) exists and works well for mid-session compaction
  • But there's no way to ensure compaction happens at session end
  • Custom commands can't reach harness primitives, so workarounds via the plugin system are impossible
  • Users who --continue sessions lose context when they exit without compacting

Workaround

Currently using autoCompact: 0.5 for aggressive mid-session compaction, plus a custom /ciao command that saves context to memory files before exit. This preserves context for fresh sessions but doesn't help --continue workflows.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗