- Home
- Skills
- Mhylle
- Claude Skills Collection
- Strategic Compact
strategic-compact_skill
- Python
9
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill mhylle/claude-skills-collection --skill strategic-compact- SKILL.md18.2 KB
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.