mhylle/claude-skills-collection
Overview
This skill provides a strategic compaction suggestion framework that watches session activity and recommends context compaction at logical boundaries instead of at arbitrary token or time thresholds. It aims to preserve work continuity and decision rationale by suggesting compaction only when the session is between tasks, after commits, or at other meaningful pause points. Suggestions are non-blocking and can integrate with a context-saver to preserve critical state before compaction.
How this skill works
The skill attaches to the PreToolUse hook and maintains an in-memory session state that counts tool invocations, flags activity (debugging, implementation), and records boundary events like task completions or git commits. It evaluates weighted tool counts against configurable thresholds and suppression rules to decide when to suggest compaction. When a suggestion is appropriate, it optionally calls context-saver to create a reference file and presents a concise recommendation with session metrics and a compact summary.
When to use it
- During long coding sessions where context windows may approach capacity
- When you complete a logical unit of work (task, phase, commit) and want a natural pause
- Before switching to a different feature or area of the codebase
- When tool counts or estimated context usage approach configured thresholds
- When you want non-disruptive, reversible guidance rather than forced auto-compaction
Best practices
- Accept suggestions after commits or passing tests to create clean resume points
- Defer compaction during active debugging, unresolved test failures, or rapid edit cycles
- Ensure context-saver runs before compacting to capture decisions, file locations, and next steps
- Tune thresholds per project or activity (debugging, refactor, docs) rather than using one size for all
- Don’t accept compaction if you have important uncommitted work or expect to continue the same mental thread soon
Example use cases
- A feature implementation that finishes with a successful git commit — suggestion appears to compact and save context
- A debugging session where the skill suppresses compaction until error rates drop or the bug is resolved
- A large refactor that triggers suggestions at phase completions to keep history coherent
- Manual invocation to get a current recommendation or force a save: /strategic-compact or /strategic-compact now
- Teams using hooks.json to enable the PreToolUse monitor and integrate saved context files into session handoffs
FAQ
It suggests compaction at semantic boundaries (task completion, commits) and suppresses suggestions during active debugging or implementation rather than compacting purely on token/time thresholds.
What if I want no suggestions?
You can set the active threshold to "never" or disable the PreToolUse hook for the project; the skill also supports a silent or disabled mode in settings.
Does it save context automatically?
If integrate_context_saver is enabled the skill will invoke context-saver before presenting a final compaction recommendation, but it will not perform destructive actions without your acceptance.
9 skills
This skill helps you manage coding sessions by suggesting strategic context compaction at logical boundaries, preserving work continuity and reducing
This skill performs structured code reviews to enforce six dimensions: service delegation, framework standards, ADR compliance, plan synchronization, and
This skill captures and persists valuable work-session patterns to the learning directory for future reuse, improving speed and consistency across projects.
This skill coordinates adversarial multi-perspective team brainstorms to deeply explore ideas, surface risks, and deliver comprehensive insights for
This skill generates structured phase-based implementation prompts using an orchestrator pattern and saves them to docs/prompts for subagent delegation.
This skill helps you systematically evaluate AI implementations with capability and regression tests, delivering actionable feedback and measurable quality.
This skill helps you brainstorm ideas using Socratic questioning and multi-perspective analysis to refine concepts for implementation planning.
This skill observes and reports end-to-end tests using Playwright MCP, enabling setup, run, and report modes for web applications.
This skill executes a comprehensive 6-check verification loop to ensure build, type safety, lint, tests, security, and diff review before completion.