skills/core/strategic-compact/SKILL.md
Compact context at logical phase boundaries to preserve coherence and avoid mid-task context loss.
npx skillsauth add bereniketech/claude_kit strategic-compactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Trigger /compact at deliberate task boundaries rather than waiting for auto-compaction, which fires at arbitrary points and can destroy critical mid-task context.
Use this decision table at every phase transition:
| Transition | Compact? | Reason | |---|---|---| | Research → Planning | Yes | Research is bulky; plan is the distilled output | | Planning → Implementation | Yes | Plan lives in TodoWrite or a file; free context for code | | Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus | | Debugging → Next feature | Yes | Debug traces pollute unrelated work | | After a failed approach | Yes | Clear dead-end reasoning before retrying | | Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
Rule: Never compact mid-implementation. Always finish the current atomic unit of work first.
The suggest-compact.js script runs on PreToolUse for Edit and Write operations. It counts tool calls and suggests compaction at the configured threshold.
Register in ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{ "matcher": "Edit", "hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }] },
{ "matcher": "Write", "hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }] }
]
}
}
Default threshold: 50 tool calls. Reminder every 25 calls after threshold. Override with COMPACT_THRESHOLD env var.
Rule: Treat the hook suggestion as a prompt to evaluate, not an automatic command. You decide whether to compact.
| Persists | Lost |
|---|---|
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
| Memory files (~/.claude/memory/) | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
Before running /compact:
~/.claude/memory/./compact Focus on implementing auth middleware next.Rule: Never compact without saving volatile context first — memory files and TodoWrite are your anchors.
testing
AUTHORIZED USE ONLY: This skill contains dual-use security techniques. Before proceeding with any bypass or analysis: > 1.
testing
Provide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.
development
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.
development
Comprehensive guide to auditing web content against WCAG 2.2 guidelines with actionable remediation strategies.