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

AI Token Monitor: macOS Tool Tracks Local Claude Usage and Cost
A developer built AI Token Monitor, a macOS menu bar app that reads local Claude session files to track token usage, model distribution, and cost equivalents without API keys. The open-source tool revealed 6.5M tokens ($4,924 at API pricing) over 35 days in one user's case.

Persistent Side Panel for Claude Code with Autonomous Content Management
A developer built a TUI panel that sits in an iTerm2 split pane next to the terminal, featuring three fixed panels that Claude autonomously manages to show relevant content like code, diagrams, and status updates.

Claude Code v2.1.141: New Environment Variables, Hooks Enhancement, and Bug Fixes
Anthropic released Claude Code v2.1.141 with new environment variables (CLAUDE_CODE_PLUGIN_PREFER_HTTPS, ANTHROPIC_WORKSPACE_ID), terminalSequence field for hooks, agent listing by cwd, and over 20 bug fixes.

bareguard: A Lightweight Safety Gate for AI Agents — Now on npm
bareguard v1.0 is a ~1000-line, single-dependency safety layer for AI agents that blocks destructive actions (rm -rf, DROP TABLE) and enforces budget limits with human escalation. Part of the bare suite, live on npm.