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

Autonomous coding workflow ships 163K lines overnight using Claude Code
A developer built an autonomous workflow that completed 72 tasks overnight, generating 163,643 lines of code and 6,400+ passing tests with an 85% first-attempt success rate.

Clawdex: A Directory for Tracking OpenClaw Derivatives and Forks
Clawdex is a directory listing 18 OpenClaw-related projects across three tiers, with data on stars, language, and category tags. The project is PR-driven, requiring contributors to fork the repo, add a YAML file to /src/data/projects/, and open a pull request.

Traversable Skill Graph for Persistent AI Agent Memory in Codebases
A developer built a three-layer skill graph system that lives inside a codebase, enabling AI coding assistants to maintain persistent memory across sessions. The system uses progressive disclosure with self-directing instructions instead of monolithic context files.

Building a Full Production App with Claude: What Actually Worked and What Didn't
A senior backend dev with zero Flutter experience shipped a full production app (iOS + Android) using Claude as primary tool over 2.5 months. Details the workflow, failures, and why tests were the quality gate.