compact-guard
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.
What this skill does
# Compact Guard Protect important context through compaction cycles. Based on Claude Code internals: compaction restores max 5 files with 5K tokens each, within a 50K total budget. ## Trigger Use before `/compact` or when auto-compact warning appears. ## Key Constants (from Claude Code source) - `POST_COMPACT_MAX_FILES_TO_RESTORE = 5` — only 5 files survive - `POST_COMPACT_TOKEN_BUDGET = 50K` — total restore budget - `POST_COMPACT_MAX_TOKENS_PER_FILE = 5K` — per-file limit - Auto-compact fires at `context_window - 13K` buffer ## Pre-Compact Checklist Before compacting, save these to memory or a scratch file: 1. **Current task** — What are you working on? One sentence. 2. **Files in progress** — Which files are being edited? (max 5 — compaction only restores 5) 3. **Decisions made** — Any architectural choices made this session 4. **Blockers** — What's preventing progress? 5. **Next steps** — What to do immediately after compact ## Strategy: Microcompact First Before full compaction, try microcompact: - Large tool results (test output, grep results) can be trimmed - File reads that are no longer relevant can be dropped - Use subagents for heavy exploration to keep main context clean ## Post-Compact Recovery After compaction, immediately: 1. Re-read the top-priority file (the one you're actively editing) 2. Check task list for current progress 3. Review any scratch notes saved pre-compact 4. Resume from next steps ## Prevention Strategies | Strategy | Token Savings | When | |----------|--------------|------| | Delegate grep/search to subagent | 30-60% per search | Always for broad searches | | Read only needed lines (`offset`/`limit`) | 50-90% per read | Large files | | Compact at task boundaries | Preserves coherence | Between logical steps | | Use `/resume` for fresh start | 100% | Unrelated new task | ## Output After running compact-guard: ```text COMPACT GUARD Files to preserve: [list top 5] Task state: [one sentence] Decisions: [key choices] Next step: [immediate action after compact] Ready to compact. Run /compact now. ``` ## Rules - Always save state before compacting — never compact blind - Prioritize the file you're actively editing as #1 to restore - If auto-compact fires unexpectedly, immediately re-read your working file - Keep CLAUDE.md under 60 lines to leave room for actual context
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.