[FEATURE] Auto compact and pre compact param separation

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jan 21, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I disabled auto compaction due to loss of context size. The result it, the context size is amazing, I'm fine with compaction time, but it gets super counter productive that the agent stops and wait for me to type /compact, and then type continue when it finishes.

It feels to me like the auto compact param controls two separate behaviors:
behavior 1: pre compaction that requires 20% context size and reduces compaction times (let me know if i'm being inaccurate here).
behavior 2: automatic compaction and continuation on context size limit reached.

Most users I talked to, at least showed interest in behavior 2, but not necessarily in behavior 1 and vise versa. Is this a valid request? Do I miss an existing param I can use for that? I'm I missing an already open issue on the matter?

Proposed Solution

Two separate settings params to control each behavior

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18152
  2. https://github.com/anthropics/claude-code/issues/18314
  3. https://github.com/anthropics/claude-code/issues/19018

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

avivcarmis-bb · 7 months ago

Any news on this?

bcherny collaborator · 2 months ago

Good question. The two behaviors are separable now: keep auto-compaction on (so Claude compacts and continues by itself) and control when it fires with the auto-compact window. By default it compacts at the model's context limit rather than early, and you can tune it with /autocompact <tokens> (saved to settings), the --autocompact flag, or CLAUDE_CODE_AUTO_COMPACT_WINDOW. Docs: https://code.claude.com/docs/en/model-config#set-the-auto-compact-window

Closing as covered; feel free to reopen if this doesn't match what you're seeing.

🤖 Generated with Claude Code

github-actions[bot] · 9 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.