strategic-compact
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Skill by myths-labs
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/myths-labs-strategic-compact
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/strategic-compact
What's inside
- Skill name
strategic-compact- Description
- Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction. Supports focus-aware compaction for targeted context preservation.
- License
- MIT
- Instructions
- 101 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Strategic Compact Skill
Suggests manual `/compact` at strategic points rather than relying on arbitrary auto-compaction.
## Why Strategic Compaction?
Auto-compaction triggers at arbitrary points:
- Often mid-task, losing important context
- No awareness of logical task boundaries
- Can interrupt complex multi-step operations
Strategic compaction at logical boundaries:
- **After exploration, before execution** — Compact research, keep plan
- **After completing a milestone** — Fresh start for next phase
- **Before major context shifts** — Clear old context before different task
## Focus-Aware Compaction (inspired by OpenClaw)
Blind compaction = blind discards. Focus-directed compaction = preserving key information.
**Usage**: Specify what to preserve when manually compacting.
```
Scenario: Completed 3 hours of debugging, now starting a new feature
✅ /compact preserve root cause analysis and fix approach, discard trial-and-error debugging
❌ /compact (blind compaction may discard root cause analysis)
```
**Common focus templates**:
| Scenario | Focus Directive |
|----------|----------------|
| After debugging | `Preserve root cause and fix approach, discard trial-and-error` |
| After planning | `Preserve final plan and key decisions, discard alternative discussions` |
| After code review | `Preserve items to change, discard confirmed-OK sections` |
| After strategy discussion | `Preserve strategic decisions and metrics, discard brainstorming process` |
| After multi-file edits | `Preserve which files changed and why, discard file content details` |
## When to Trigger Compaction
| Signal | Action |
|--------|--------|
| Completed a full milestone | ✅ Good time to compact |
| Switching from exploration to execution | ✅ Good time to compact |
| Debugging complete, starting new feature | ✅ Good time to compact |
| In the middle of multi-step implementation | ❌ Do NOT compact |
| Still analyzing a problem | ❌ Do NOT compact |
| `/ctx` shows 60-70% consumed | 🟡 Consider compacting |
| `/ctx` observes ≥80% pressure | Save the current Lane, compact if supported, verify and continue |
## Hook Setup
Add to your `~/.claude/settings.json`:
```json
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}
```
## Configuration
Environment variables:
- `COMPACT_THRESHOLD` - Tool calls before first suggestion (default: 50)
## Best Practices
1. **Compact with focus** — Always specify what to preserve, never compact blindly
2. **Write memory before compacting** — Save key information to `memory/YYYY-MM-DD.md` first
3. **Never compact mid-task** — Maintain complete context during multi-step implementations
4. **Pair with /ctx** — Use actual observations; ≥80% means save and reassess after compaction, not forced exit. Unknown occupancy remains unknown.
## Pre-Compaction Protocol (MUSE — derived from LCM compact:before)
**MUST** execute in order before compaction:
1. **Persist**: Write current task progress to `memory/YYYY-MM-DD.md`
2. **Preserve recent instructions**: Save recent decisions, corrections and constraints; do not claim the client supports a protected/non-compactable zone unless its actual interface does.
3. **Extract key decisions**: Scan content about to be compacted, extract key decisions/data to memory
4. **Notify user**: Inform about upcoming compaction, list what will be preserved
> **Principle: Persist first, then compact. Never discard information without a backup.**
## Post-Compaction Injection (MUSE — derived from OpenClaw postCompactionSections)
**MUST** re-internalize the following after compaction:
1. First 4 lines of `CLAUDE.md` (7 iron laws + priority chain)
2. Currently `[/]` in-progress tasks from `task.md`
3. Today's `memory/` snapshot (just written)
4. Any focus-aware specified preservation items
> Compaction may omit information. Reconcile the selected role/Lane checkpoint and required evidence after it; do not reload all history or claim memory is lossless.From myths-labs/muse, MIT.
More from myths-labs/muse
- 0.659score
growth-distribution
myths-labs
Cross-platform content distribution and growth strategy for DYA app across 10+ platforms (Xiaohongshu, Douyin, TikTok, Instagram Reels, X/Twitter, Reddit…
SkillAFreshness: A★ 36Claude Code +9 - 0.659score
github-pr-review
myths-labs
Handles PR review comments and feedback resolution.
SkillAFreshness: A★ 36Claude Code +9 - 0.659score
muse-orchestration
myths-labs
Run several long-lived AI coding sessions ("lanes") as one team led by an orchestrator lane.
SkillAFreshness: A★ 36Claude Code +9 - 0.656score
muse-commands
myths-labs
Run MUSE /resume, /save and /bye for continuous work in Codex or Claude Code, preserving the selected role, Lane, decisions and source evidence across sessions.
SkillAFreshness: A★ 36Claude Code +9 - 0.654score
markitdown
myths-labs
A Python utility for converting various file formats (PDF, Word, Excel, PowerPoint, etc.) to Markdown.
SkillAFreshness: A★ 36Claude Code +9 - 0.654score
coordinator-mode
myths-labs
Multi-agent coordination SOP derived from Anthropic's internal coordinator architecture.
SkillAFreshness: A★ 36Claude Code +9 - 0.654score
semantic-search
myths-labs
Zero-dependency TF-IDF search across MUSE memory, roles, and skills.
SkillAFreshness: A★ 36Claude Code +9 - 0.651score
javascript-typescript
myths-labs
JavaScript and TypeScript development with ES6+, Node.js, React, and modern web frameworks.
SkillAFreshness: A★ 36Claude Code +9 - 0.651score
architect-agent
myths-labs
Software architecture specialist for system design, scalability, and technical decision-making.
SkillAFreshness: A★ 36Claude Code +9 - 0.651score
database-reviewer
myths-labs
PostgreSQL database specialist for query optimization, schema design, security, and performance.
SkillAFreshness: A★ 36Claude Code +9 - 0.651score
context-health-check
myths-labs
Check actual session context observations; save and reassess after compaction without forcing Bye or guessing model limits.
SkillAFreshness: A★ 36Claude Code +9 - 0.651score
code-refactoring
myths-labs
Code refactoring patterns and techniques for improving code quality without changing behavior.
SkillAFreshness: A★ 36Claude Code +9
Signals
- Stars
- 36
- Forks
- 4
- Open issues
- 0
- Last commit (this folder)
- Sep 6, 2026 (1 month ago)
- Last release
- Oct 24, 2026 (4 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/myths-labs/muse
- Website
- github.com/myths-labs/muse
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from myths-labs
- 0.659score
github-pr-review
myths-labs
Handles PR review comments and feedback resolution.
SkillAFreshness: A★ 36Claude Code +9 - 0.659score
muse-orchestration
myths-labs
Run several long-lived AI coding sessions ("lanes") as one team led by an orchestrator lane.
SkillAFreshness: A★ 36Claude Code +9 - 0.659score
growth-distribution
myths-labs
Cross-platform content distribution and growth strategy for DYA app across 10+ platforms (Xiaohongshu, Douyin, TikTok, Instagram Reels, X/Twitter, Reddit…
SkillAFreshness: A★ 36Claude Code +9 - 0.656score
muse-commands
myths-labs
Run MUSE /resume, /save and /bye for continuous work in Codex or Claude Code, preserving the selected role, Lane, decisions and source evidence across sessions.
SkillAFreshness: A★ 36Claude Code +9 - 0.654score
coordinator-mode
myths-labs
Multi-agent coordination SOP derived from Anthropic's internal coordinator architecture.
SkillAFreshness: A★ 36Claude Code +9 - 0.654score
semantic-search
myths-labs
Zero-dependency TF-IDF search across MUSE memory, roles, and skills.
SkillAFreshness: A★ 36Claude Code +9
Cite this page
strategic-compact skill. Agent Mart. https://agentmart.dev/skills/myths-labs-strategic-compact (last updated 2026-10-24)