
Cc Skill Strategic Compact
- 604 installs
- 44k repo stars
- Updated July 27, 2026
- sickn33/antigravity-awesome-skills
cc-skill-strategic-compact is a Claude Code hook skill that suggests timely manual context compaction at logical breakpoints for developers running long agent sessions instead of letting context degrade mid-task.
About
cc-skill-strategic-compact is a community Claude Code skill sourced from everything-claude-code that runs a Strategic Compact Suggester on PreToolUse hooks. Instead of waiting for automatic compaction that may truncate critical context mid-task, the skill prompts developers to manually compact at logical breakpoints like phase completions or before large tool batches. Developers reach for cc-skill-strategic-compact during extended refactoring, multi-file features, or debugging marathons where Claude context windows fill and quality drops. The bash-based hook evaluates session state and nudges compaction before degradation affects code quality.
- Suggests manual compaction after exploration before execution
- Triggers on transition from research to implementation
- Runs on PreToolUse hook for Edit|Write actions
- Preserves context through logical phases instead of arbitrary auto-compaction
- 3 clear criteria for when to compact: session length, tool call volume, milestone transitions
Cc Skill Strategic Compact by the numbers
- 604 all-time installs (skills.sh)
- Ranked #1,557 of 16,659 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill cc-skill-strategic-compactAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 604 |
|---|---|
| repo stars | ★ 44k |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | sickn33/antigravity-awesome-skills ↗ |
When should you compact Claude Code context?
Receive timely suggestions to manually compact Claude context at logical breakpoints instead of letting it degrade mid-task.
Who is it for?
Developers running long Claude Code sessions who need proactive compact prompts before context degradation hurts multi-file tasks.
Skip if: Developers on short single-file edits where context limits are never approached.
When should I use this skill?
A long Claude Code session approaches context limits or the developer needs guidance on when to manually compact.
What you get
Timed compact suggestions, preserved critical context, PreToolUse hook notifications at session breakpoints
- Compact timing suggestions
- Breakpoint notifications
By the numbers
- Hooks into Claude Code PreToolUse lifecycle events
- Sourced from the everything-claude-code community skill collection
Files
cc-skill-strategic-compact
Development skill skill.
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
#!/bin/bash
# Strategic Compact Suggester
# Runs on PreToolUse or periodically to suggest manual compaction at logical intervals
#
# Why manual over auto-compact:
# - Auto-compact happens at arbitrary points, often mid-task
# - Strategic compacting preserves context through logical phases
# - Compact after exploration, before execution
# - Compact after completing a milestone, before starting next
#
# Hook config (in ~/.claude/settings.json):
# {
# "hooks": {
# "PreToolUse": [{
# "matcher": "Edit|Write",
# "hooks": [{
# "type": "command",
# "command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
# }]
# }]
# }
# }
#
# Criteria for suggesting compact:
# - Session has been running for extended period
# - Large number of tool calls made
# - Transitioning from research/exploration to implementation
# - Plan has been finalized
# Track tool call count in a user-owned state directory
COUNTER_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/strategic-compact"
mkdir -p "$COUNTER_DIR"
COUNTER_FILE="$COUNTER_DIR/tool-count"
THRESHOLD=${COMPACT_THRESHOLD:-50}
# Initialize or increment counter
if [ -f "$COUNTER_FILE" ]; then
count=$(cat "$COUNTER_FILE")
count=$((count + 1))
echo "$count" > "$COUNTER_FILE"
else
echo "1" > "$COUNTER_FILE"
count=1
fi
# Suggest compact after threshold tool calls
if [ "$count" -eq "$THRESHOLD" ]; then
echo "[StrategicCompact] $THRESHOLD tool calls reached - consider /compact if transitioning phases" >&2
fi
# Suggest at regular intervals after threshold
if [ "$count" -gt "$THRESHOLD" ] && [ $((count % 25)) -eq 0 ]; then
echo "[StrategicCompact] $count tool calls - good checkpoint for /compact if context is stale" >&2
fi
Related skills
How it compares
Pick cc-skill-strategic-compact over generic productivity skills when the problem is Claude Code context window management during long agent runs.
FAQ
What does cc-skill-strategic-compact do in Claude Code?
cc-skill-strategic-compact runs a Strategic Compact Suggester on PreToolUse hooks, recommending manual context compaction at logical breakpoints before automatic truncation degrades agent output mid-task.
Why use manual compaction instead of automatic?
cc-skill-strategic-compact favors manual compaction at phase boundaries so developers control what context is summarized, avoiding mid-task auto-compact that can drop critical file or decision history.
Is Cc Skill Strategic Compact safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.