strategic-compact

Trigger strategic context compaction prompts at milestones via Bash script and PreToolUse hooks.

3|1|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/monch1962/everything-opencode --skill strategic-compact-monch1962
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/monch1962/everything-opencode/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/monch1962/everything-opencode --skill strategic-compact-monch1962

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill solves the problem of losing important context due to auto-compaction by prompting users to compact at logical milestones, ensuring critical information is preserved through task phases.

Core Features & Use Cases

  • Strategic prompts at milestones to condense exploration notes, planning artifacts, and implementation context.
  • PreToolUse integration that triggers when using Edit or Write tools to suggest compaction.
  • Use Case: Before a major code refactor, compact to lock in decisions and maintain a clean execution plan.

Quick Start

  • Ensure the suggest-compact.sh script is available at ~/.opencode/skills/strategic-compact/suggest-compact.sh
  • Update ~/.opencode/settings.json to add a PreToolUse hook that runs the script for Edit/Write actions, as described in the SKILL.md.

Frequently Asked Questions about strategic-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent losing context during long development tasks?

Strategic context compaction preserves essential information across task phases by prompting you to compact at logical milestones—exploration, planning, and execution—rather than relying on automatic compaction alone. This ensures critical decisions and implementation details stay accessible.

When should I compact my context during a coding project?

Compact before major context shifts: before refactoring, switching between exploration and planning phases, or before implementing large features. The Skill triggers compaction prompts via PreToolUse hooks when you use Edit or Write tools at optimal moments.

Can I automate context compaction prompts in my workflow?

Yes. The Skill uses a Bash script and PreToolUse hooks to automate compaction prompts at milestones without external dependencies. Configure it by adding a PreToolUse hook in ~/.opencode/settings.json pointing to the suggest-compact.sh script.

What's the difference between strategic compaction and automatic compaction?

Automatic compaction can discard context unexpectedly. Strategic compaction lets you decide what to preserve by prompting at deliberate milestones—exploration notes, planning artifacts, and implementation decisions—before major code changes.

Do I need additional tools to use strategic context compaction?

No. The Skill relies only on a lightweight Bash script and standard PreToolUse hooks. No external installations or dependencies are required beyond your existing workflow environment.