
Cc Skill Strategic Compact
Install this when long Claude Code sessions bloat context and you want hook-driven reminders to compact manually at phase boundaries instead of mid-task auto-compact.
Overview
cc-skill-strategic-compact is a journey-wide agent skill that suggests when to manually compact Claude context—usable whenever a solo builder needs to reset context at logical phase boundaries before committing to the ne
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill cc-skill-strategic-compactWhat is this skill?
- Suggests manual compaction at logical boundaries: after exploration, before execution, after milestones
- Documents PreToolUse hook wiring in ~/.claude/settings.json for Edit|Write matchers
- Bash suggest-compact.sh script criteria: long sessions, high tool-call volume, research-to-implementation transitions
- Argues against arbitrary auto-compact mid-task in favor of strategic phases
- Documents three strategic compact checkpoints: after exploration, before execution, and after milestones
- Hook matcher example targets Edit|Write tool classes
Adoption & trust: 543 installs on skills.sh; 40.1k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent session accumulates exploration noise and auto-compact may wipe or scramble context at the worst moment in a task.
Who is it for?
Claude Code users running long, multi-phase agent sessions with heavy Edit|Write tool use who want controlled compaction timing.
Skip if: Short one-shot prompts, agents without hook support, or workflows where official auto-compact policy is mandatory and cannot be customized.
When should I use this skill?
Long Claude Code sessions, high tool-call volume, or transitioning from research/exploration to implementation—especially when PreToolUse hooks on Edit|Write are configured.
What do I get? / Deliverables
You configure PreToolUse hooks and follow strategic compact checkpoints so each implementation phase starts with a leaner, intentional context window.
- PreToolUse hook configuration snippet for strategic compact suggestions
- Operational criteria for when to trigger manual compaction
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Compact after competitor reconnaissance before drafting the implementation plan with the agent.
Compact after spiking API design and before writing production handlers across many files.
Compact after a broad code-review pass before applying fix batches in a fresh context.
Compact after log archaeology before executing a focused patch series for a production incident.
How it compares
Use hook-timed strategic compaction instead of relying solely on default auto-compact or endless context growth without milestones.
Common Questions / FAQ
Who is cc-skill-strategic-compact for?
Solo builders using Claude Code with custom hooks who manage large codebase edits and want reminders to compact between exploration and execution.
When should I use cc-skill-strategic-compact?
During build implementation marathons, ship review fixes across many files, launch polish sprints, or operate debugging sessions whenever tool calls pile up and you are switching from research to execution.
Is cc-skill-strategic-compact safe to install?
It runs shell commands via hooks you configure locally; review the Security Audits panel on this page and inspect suggest-compact.sh before enabling PreToolUse in your settings.
SKILL.md
READMESKILL.md - Cc Skill Strategic Compact
# 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