You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: configurable auto-compaction threshold (token window / percentage), like Claude Code's autoCompactWindow #1159
Auto-compaction thresholds are hard-coded as percentages of the model's context window, with no way to set a fixed token budget:
Trigger
Fires at
Configurable?
Tier 1 tool-call trim
50% of window
only via compact-mode=fast
Tier 2 tool-call trim
80% of window
only via compact-mode=fast
Tier 3 summarization
90% of window
no
Only compact-mode (default / fast) exists in the config registry (cmd config list). There is no token-window or percentage override setting, and no documented env var for it.
Concrete consequence: on a 1M-context model such as deepseek/deepseek-v4.1-flash-fast, summarization does not fire until ~900K tokens. Users who want to compact at e.g. 500K (for response quality and predictable per-turn cost) have to run /compact by hand every time.
Comparison
Claude Code exposes this as a first-class setting:
autoCompactWindow — a token window from 100000 to 1000000
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE — percentage override 1–100 (can only lower the default threshold)
an on/off toggle
Proposal
Expose an absolute threshold, either of these (both would be ideal):
compact-window — token budget (e.g. 100000–1000000); summarization fires at 90% of it, consistent with current tier math
compact-threshold — percentage of the model window (1–100), read live like compact-mode
Requirements:
settable via cmd config set and settings.json, user scope
values clamp to the active model's window; a model switch recalibrates as it does today
applies from the next compaction check (same live-reload semantics as compact-mode)
Environment
Command Code v1.91.0
Ubuntu 24.04 (headless, SSH + tmux)
Model in use: deepseek/deepseek-v4.1-flash-fast (1M context)
Activity
vipulgupta2048 commentedon Nov 18, 2026
Thanks for opening the feature request, already have a PR for this @TIANCHEDN Should be getting live soon.