Claude Compact Guard Plugin Uses New PostCompact Hook to Preserve Context

✍️ OpenClawRadar📅 Published: March 28, 2026🔗 Source
Claude Compact Guard Plugin Uses New PostCompact Hook to Preserve Context
Ad

Plugin Solves /compact Context Loss Problem

A developer has built the first plugin leveraging Anthropic's newly released PostCompact hook to address a persistent frustration with Claude's /compact command. The plugin, claude-compact-guard, automatically preserves context that would otherwise be lost when the context window fills and /compact is triggered.

How It Works

The plugin operates through two automated phases:

  • Fires before /compact executes — takes a snapshot of your critical context
  • Fires after /compact completes — reinjects the saved context automatically

This allows Claude to pick up exactly where you left off without requiring manual re-explanation of complex tasks, key decisions, files in progress, or open problems that were identified before the context window filled.

Ad

Installation and Details

Installation requires one command:

/plugin marketplace add celeritas-stack/claude-compact-guard

The plugin requires zero configuration and zero manual work once installed. It's free and open source, available at github.com/celeritas-stack/claude-compact-guard.

The developer notes that the PostCompact hook is "a brand new primitive with some interesting constraints" and is available to answer questions about its architecture.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also