Claude Compact Guard Plugin Uses New PostCompact Hook to Preserve Context

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.
Installation and Details
Installation requires one command:
/plugin marketplace add celeritas-stack/claude-compact-guardThe 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
👀 See Also

Six open-source tools that address OpenClaw's security, cost, and complexity issues
A developer tested six community tools to solve OpenClaw's security gaps flagged by Cisco, spiraling costs, and complex setup. ClawSec provides security scanning and integrity verification, Antfarm enables deterministic multi-agent workflows, and LanceDB Pro improves memory retrieval with hybrid vector search.

Google's HEIR Compiler: Practical Private AI with Homomorphic Encryption
Google open-sources HEIR, a compiler that lets developers run AI inference on encrypted data without decryption. Demos include fraud detection, recommendations, and more.

Testing AI Agents Against Real-world APIs with d3 Labs
d3 labs offers 10 free production APIs to help developers test AI agents in real-world scenarios instead of relying on unrealistic mocks.

Sonarly: AI-driven Production Alert Triage and Resolution
Sonarly connects with observability tools to triage and resolve production alerts, reducing noise and focusing on critical issues.