# feat\(claude\): idle compaction has a global default and per-instance overrides · PR \#23037 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/23037)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: t3code/claude-idle-compaction-per-instance

Target branch: main

Head commit: 0adf0a36394a6330a7755f9d02021b5ddacf7a07

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/23037)

[Commits](https://git.cafe/pingdotgg/t3code/pull/23037/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/23037/diffs?format=markdown)

## Description

---

Users resuming 100k–150k-token Claude threads keep getting pushed into compaction after a break, and want to decide this per provider (raised in Discord).

<img width="1550" height="1796" alt="CleanShot 2026-10-21 at 12 40 56@2x" src="https://github.com/user-attachments/assets/9471ed92-db94-4987-b72a-02ee0d047644" />


**What changed**

**Settings > General › Compact idle threads** is now a select instead of a beta on/off switch. It is the default for every Claude instance:

- **When you return** (default): today's behavior. The composer's Compact chip and Claude's native resume prompt.
- **Before the cache expires (beta)**: the background `/compact` that the old beta switch enabled.
- **Never**: hides the Compact chip and answers Claude's `resume_return` dialog with "continue" without asking.

Each Claude instance's provider settings get the same select with a leading **Use default** option, so a work and a personal Claude account can behave differently. `resolveIdleCompaction` in contracts picks the instance override or falls back to the global value; the web chip, `IdleCompactionService`, and the Claude adapter's resume dialog all use it.

**Migration**: the setting keeps its `compactIdleThreads` key. A stored `true` decodes as **Before the cache expires**, `false` as **When you return**, so nobody loses their beta choice.

**Surfaces**
- Web/desktop: General select plus the schema-driven provider settings form.
- Mobile: has no Compact chip; the server-side dialog and idle timer changes apply to it too.
- Other providers: idle compaction is Claude-only today; no change.

Docs: `providers-claude.md` documents the modes and the override; `composer.md` points there.

Tested with `vp run check:changed` (format, lint, knip, typecheck, tests) plus contracts tests for the override resolution and the legacy decode.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

