Session memory first compaction

From ychampion/cskill-agents · View interactive version

Session memory first compaction is an AI agent skill from the GitHub repository ychampion/cskill-agents. Attempt session-memory compaction before full conversation compaction so lightweight summaries win when available.

How to use this skill

Skill file

SKILL: Session Memory First Compaction

Domain: context-management

Trigger: Apply when an auto-compact flow can query a session-memory summary before running the heavier legacy compaction path.

Source Pattern: Distilled from reviewed lightweight summary-first and fallback compaction implementations.

Core Method

When auto-compaction fires, try the lightweight session-memory summary path first. If it returns a usable summary, treat that as a successful compaction and skip the heavier full-conversation compaction path. Only fall back to the heavyweight path when the lightweight summary is unavailable. This keeps cached or precomputed summaries in charge whenever possible and reserves the costly path for true misses.

Key Rules

Example Application

Auto-compaction finds a fresh session-memory summary, accepts it as the compaction result, records success, and avoids calling the heavyweight compaction path at all.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.