Summary
Claude Code supports a configurable auto-compaction threshold via the CLAUDE_AUTOCOMPACT_PCT_OVERRIDE environment variable. For example, setting it to 60 triggers automatic context compaction when the context window reaches 60% capacity. This lets power users control the trade-off between context retention and compaction frequency.
Copilot CLI currently has no equivalent. Compaction is only available as a manual /compact slash command, and auto-compaction (if it exists internally) has no user-facing threshold control.
Request
Add a configurable auto-compaction threshold — either as:
-
A config.json setting:
{
"autoCompactThreshold": 0.6
}
-
An environment variable (matching Claude Code's pattern):
export COPILOT_AUTOCOMPACT_PCT=60
-
Or both (env var overrides config, like Claude Code does).
Why this matters
- Long sessions with heavy tool use burn through the context window fast. By the time a user notices and runs
/compact, they may have already lost important early context to truncation.
- Agentic workflows (fleet mode, sub-agents, multi-step plans) are especially vulnerable — they generate dense tool output that fills the window quickly.
- Power users want control. Some prefer aggressive compaction (20-40%) to keep sessions lean; others prefer late compaction (80%+) to maximize context retention. One size doesn't fit all.
Claude Code reference
Claude Code's implementation:
- Env var:
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 (triggers compaction at 60% context usage)
- Set in:
~/.claude/settings.json under env
- Behavior: When context crosses the threshold, Claude Code automatically summarizes the conversation history, preserving key decisions and state while freeing tokens.
This is a simple, high-impact feature that would bring Copilot CLI to parity on context management. Happy to discuss implementation details.
Environment
- Copilot CLI v1.0.34
- macOS (Darwin)
- Heavy daily usage with agentic workflows
Summary
Claude Code supports a configurable auto-compaction threshold via the
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEenvironment variable. For example, setting it to60triggers automatic context compaction when the context window reaches 60% capacity. This lets power users control the trade-off between context retention and compaction frequency.Copilot CLI currently has no equivalent. Compaction is only available as a manual
/compactslash command, and auto-compaction (if it exists internally) has no user-facing threshold control.Request
Add a configurable auto-compaction threshold — either as:
A
config.jsonsetting:{ "autoCompactThreshold": 0.6 }An environment variable (matching Claude Code's pattern):
export COPILOT_AUTOCOMPACT_PCT=60Or both (env var overrides config, like Claude Code does).
Why this matters
/compact, they may have already lost important early context to truncation.Claude Code reference
Claude Code's implementation:
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60(triggers compaction at 60% context usage)~/.claude/settings.jsonunderenvThis is a simple, high-impact feature that would bring Copilot CLI to parity on context management. Happy to discuss implementation details.
Environment