From cc-customize
This skill should be used when the user asks to "adjust auto compact", "change compact percentage", "set auto compact threshold", "configure auto compaction", "change context compaction", or wants to modify the CLAUDE_AUTOCOMPACT_PCT_OVERRIDE setting in Claude Code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cc-customize:compact-percentageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Adjust the auto-compact percentage threshold that controls when Claude Code automatically compresses conversation context.
Adjust the auto-compact percentage threshold that controls when Claude Code automatically compresses conversation context.
Claude Code automatically compacts (summarizes) conversation history when context usage reaches a threshold. The CLAUDE_AUTOCOMPACT_PCT_OVERRIDE environment variable controls this threshold as a percentage of context capacity. Lower values trigger compaction earlier, preserving more room but summarizing sooner. Values above 83 are silently capped due to an internal response-token buffer.
Read ~/.claude/settings.json to check the current configuration.
Extract the current CLAUDE_AUTOCOMPACT_PCT_OVERRIDE value from the env block in settings.json.
env block is absent, display: "Auto-compact threshold is not set (default: ~95%)"Use AskUserQuestion to ask:
"Enter desired auto-compact percentage (1–83). Lower values compact earlier, preserving more context headroom. Recommended: 60–75 for most work."
Parse the user's response as an integer.
Read ~/.claude/settings.json again (to get the latest state), then use the Edit tool to perform a surgical update:
~/.claude/settings.json does not exist, create it with { "env": { "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "N" } }.env block, add an env key. Preserve all other top-level keys.env block exists, add or replace only the CLAUDE_AUTOCOMPACT_PCT_OVERRIDE key within it. Preserve all other keys in both the env block and the rest of the file.The value must be a string (environment variables are strings). Example partial excerpt:
"env": {
"EXISTING_KEY": "preserved",
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
}
Inform the user: "Auto-compact threshold set to N%. Restart Claude Code for the change to take effect."
To revert to default behavior, remove the CLAUDE_AUTOCOMPACT_PCT_OVERRIDE key from the env block in ~/.claude/settings.json. Preserve all other keys.
npx claudepluginhub aeghnnsw/cc-toolkit --plugin cc-customizeSuggests manual context compaction at logical task boundaries (after exploration, milestones, or before context shifts) to preserve task-relevant state instead of relying on arbitrary auto-compaction.
Guides managing Claude Code context window with /compact, /clear commands, auto-compaction config, sub-agents, targeted reads, background tasks, and conversation flows for long sessions.
Monitors Claude Code context token usage and auto-triggers compaction at 65% via Bash hooks: snapshots transcripts, summarizes, restores state to prevent overload.