Skip to content
Back to skills

Forge Strategic Compaction

ASecurity

Manage long agent sessions: when to compact or clear, what to keep in handoffs, and how to avoid context rot

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsgodebugging

Works with

  • mcp

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill forge-strategic-compaction --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forge Strategic Compaction?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Forge Strategic Compaction
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-forge-strategic-compaction/badge)](https://www.skillsdirectory.com/skills/ansh44233-forge-strategic-compaction)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: forge-strategic-compaction
description: "Manage long agent sessions: when to compact or clear, what to keep in handoffs, and how to avoid context rot"
---

<!-- Generated from catalog/skills/strategic-compaction/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->

# Strategic compaction

Use in long agent sessions, or when an agent starts forgetting decisions or repeating mistakes.

## When to compact
- After research or exploration, before implementing.
- After a milestone passes its checks, before the next one.
- After a failed approach, before trying another.

## When not to
In the middle of an edit or a debugging run, where file paths, variable names and partial state still matter.

## Before compacting
Write a handoff: the goal, decisions and why, files changed, the current check status and the next step. `forge memory handoff` saves it, and FORGE's pre-compact hook saves one automatically when files changed.

## Clear instead of compact
Start a fresh session (`/clear`) between unrelated tasks. Carrying an old task's context costs tokens and confuses the agent.

## Keep context small from the start
- Measure what loads every session with `forge context`, and trim the heaviest files.
- Put procedures in skills that load on demand, not in always-on instruction files.
- Disable MCP servers this repo does not use.

## Verify
After compacting, ask the agent to restate the goal, constraints and next step. Fix the handoff if anything important is missing.

Attribution

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

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.