Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Strategic Compact

ASecurity

Use when a long session is approaching a context limit, or is between task phases (research/plan/implement/test), to decide whether this is a good point to manually compact — rather than waiting for arbitrary auto-compaction to hit mid-task and discard state you actually needed.

26 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentgobashtestingdebugginggit

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add peterbamuhigire/chwezi-dev-engine --skill strategic-compact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Strategic Compact?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Strategic Compact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peterbamuhigire-strategic-compact/badge)](https://www.skillsdirectory.com/skills/peterbamuhigire-strategic-compact)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: strategic-compact
description: Use when a long session is approaching a context limit, or is between task phases (research/plan/implement/test), to decide whether this is a good point to manually compact — rather than waiting for arbitrary auto-compaction to hit mid-task and discard state you actually needed.
metadata:
  portable: true
  compatible_with:
  - claude-code
  - codex
  origin: "Adapted from affaan-m/ECC skills/strategic-compact/SKILL.md (doctrine only — ECC's automated context-size hook is not vendored into this engine; see Note on Automation below)"
---

# Strategic Compact

Auto-compaction fires at an arbitrary point in a session, with no awareness of
task boundaries — it can as easily interrupt the middle of a multi-step edit as
land cleanly between phases. Compacting deliberately at a logical boundary
instead — after exploration and before execution, after a milestone, before a
major context shift — preserves the state that matters and discards the state
that does not, rather than leaving the outcome to timing.

## When to Consider Compacting

- The session is long and approaching a context limit
- A task phase has just completed: research → planning → implementation → testing
- About to switch to an unrelated task within the same session
- A milestone just finished and the next phase is starting fresh
- Responses are slowing down or losing coherence — a sign of context pressure

## Compaction Decision Guide

| Phase Transition | Compact? | Why |
|---|---|---|
| Research → Planning | Yes | Research context is bulky; the plan is the distilled output that survives |
| Planning → Implementation | Yes, once the plan is written to a file | Frees context for code without losing the plan |
| Implementation → Testing | Maybe | Keep context if tests reference recent code; compact if switching focus |
| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
| After a failed approach | Yes | Clear the dead-end reasoning before trying a different approach |

## Write the Plan Down Before Compacting

Do not rely on an in-session task list surviving compaction — whether one
exists at all depends on which task-management tools the current harness and
model combination has enabled, which is an environment setting, not something
a skill can guarantee. **Write the plan to a file before compacting.** A file
persists across every compaction, every session, and every model; an in-memory
task list might not exist in the first place.

## What Survives vs. What Is Lost

| Persists | Lost |
|---|---|
| `CLAUDE.md` / router instructions | Intermediate reasoning and analysis |
| Files written to disk | File contents you previously read but did not re-save |
| Durable memory files, where the harness has them | Multi-step conversation context |
| Git state (commits, branches) | Tool-call history and counts |
| A task list — only if the tools exist and were used | Nuanced preferences stated only verbally |

## Best Practices

1. Compact after a plan is finalized **and written to a file**, not before.
2. Compact after debugging is resolved, to clear error-resolution noise.
3. Do not compact mid-implementation — preserve context for related changes.
4. Add a custom summary to the compact instruction when useful (e.g. "focus on
   implementing the auth middleware next") so the distilled context stays
   actionable.

## Token Discipline Alongside Compaction

- **Load skills on demand, not upfront.** This engine's own narrowest-surface
  principle (`skills/sdlc-meta/skill-composition-standards` and the rules-vs-skills
  test in `rules/README.md`) already does the "trigger-table lazy loading" job
  ECC's version of this skill describes separately — skills here load only when
  triggered, not at session start.
- **Watch for duplicate instruction sources** — the same rule stated in both a
  rules file and a loaded skill wastes context twice for one fact; consolidate
  toward the rules file and have the skill link to it, per this engine's own
  `rules/README.md` guidance.

## Note on Automation

ECC's version of this skill ships a `suggest-compact.js` PreToolUse hook that
reads live token counts from the transcript and fires threshold-based
reminders automatically. That hook is **not vendored into this engine** — this
skill captures the decision doctrine only. If automated compact suggestions
become worth building here, they belong in `hooks/`, following the same
pattern as this engine's existing `destructive-bash-gate.js` and
`banned-font-gate.js` (see `hooks/hooks.json` and `rules/README.md`'s
hooks-vs-rules-vs-skills split) — not inside this skill file.

Attribution

peterbamuhigirepeterbamuhigire
View sourceMore from peterbamuhigire →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →