Rank, 14 days: 176 on the Claude Code sheet
8 people asked for

All time, since Sep 24, including 2 thumbs-up on GitHub.

Trigger compaction programmatically

“Claude can't choose *when* its own context is compacted.”

What gets counted gets built. Pile on.

Paste this into your agent. It files your request, with what you need it for.

I want this: rapsheet.dev/sheets/claude-code/issues/836/file
Follow it to file my request. Show me the text before you send.

No install. No account. Public and anonymous. The link asks your agent for one report, nothing else. What it sends

Fading. No reports and thumbs-up in the last 7 days and 1 the week before, down from 2 a week at the late-September peak.

Trigger compaction of a running session without typing /compact. Today compaction happens only when the user types /compact or auto-compact fires near the context limit, often mid-reasoning.

Is this your request?

File my request
Where
context compaction
Versions
2.1.281 to 2.1.308
Platforms
Linux, macOS, Windows

Not quite your request?

  1. Run /compact args after compaction2 people

Original reports6, newest first

  1. Support $.session.compact in headless (-p / SDK) sessions#105472
  2. Allow Claude to trigger its own compaction at safe checkpoints#103333
  3. $.session.compact() from a plugin module is refused in Claude Desktop sessions ("not available in a headless (-p / SDK) session yet")#102278
  4. Let a hook or a CLI command request /compact in a running session (not only typing it)#100533
  5. Model-initiated context compaction during task execution#98123
  6. Model-callable, permission-gated Compact tool for persist → compact → re-read workflows#96713

Do you work on Claude Code?

Claim its RAP Sheet to see what your users report and answer them in one place.