claude-praetorian — Claude Code plugin: what it does, how to install
claude-praetorian triggers prompts to save and reload session context around planning, web research, and subagent runs, reducing token usage by 50-60%.
MIT ★ 78 updated 2026-03-05
/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-praetorian@claude-emporiumWhat claude-praetorian does
This plugin connects Claude Code workflow events with the external claude-praetorian-mcp server. It contains no internal compaction logic; instead, its event hooks signal when to store notes right before compaction resets the chat, after web searches, or upon subagent completion.
Compacted context resides directly in the project folder under .claude/praetorian/. Manual operations rely on /compact-praetorian with types like decisions or web_research, plus /restore-praetorian to pull earlier entries by query.
Without running claude mcp add praetorian -- npx claude-praetorian-mcp, the hooks have nothing to call. Behavior adjusts inside ~/.claude/settings.json under claude-emporium.
What it helps with
- save subagent task outputs before they leave the context window
- review prior decisions before launching planning mode
- compact web search findings into local project storage
- prevent context loss during session compaction resets
Example prompts for the agent
- /compact-praetorian decisions Database schema change
- /restore-praetorian authentication flow
- /compact-praetorian web_research
How to install claude-praetorian
Plugin marketplace
/plugin marketplace add Vvkmnn/claude-emporium/plugin install claude-praetorian@claude-emporiumStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about claude-praetorian
How to install claude-praetorian in Claude Code?
Register the repository by running /plugin marketplace add Vvkmnn/claude-emporium, then install the package with /plugin install claude-praetorian@claude-emporium.
What dependencies does claude-praetorian require?
It depends on the claude-praetorian-mcp server. Add it to Claude Code with claude mcp add praetorian -- npx claude-praetorian-mcp.
Where does the plugin save compacted context?
All records stay inside the project directory under .claude/praetorian/.
Source text
claude-praetorian · MIT
# Claude Praetorian
Automatic context preservation for Claude Code. Prompts you to save and restore valuable context at the right moments — before planning, after research, when subagents complete.
## Installation
```bash
/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-praetorian@claude-emporium
```
## Requirements
MCP server: [`claude-praetorian-mcp`](https://www.npmjs.com/package/claude-praetorian-mcp)
```bash
claude mcp add praetorian -- npx claude-praetorian-mcp
```
## Hooks
| Event | Trigger | What It Does |
|-------|---------|-------------|
| `PreToolUse` | `EnterPlanMode` | Lists prior compactions before you start planning |
| `PreCompact` | `*` | Saves context before compaction resets it |
| `PostToolUse` | `WebFetch` · `WebSearch` | Prompts to compact research findings |
| `SubagentStop` | `*` | Prompts to compact subagent results |
## Commands
| Command | Description |
|---------|-------------|
| `/compact-praetorian [type] [title]` | Save current context (interactive or with args) |
| `/restore-praetorian [query]` | Load previous context (recent or searched) |
**Compaction types:** `web_research` · `task_result` · `file_reads` · `decisions`
## Settings
Configure in `~/.claude/settings.json` under `claude-emporium`:
```json
{
"claude-emporium": {
"suggest_siblings": false,
"claude-praetorian": {
"auto_compact_research": false,
"auto_compact_subagent": false,
"check_compactions_before_plan": false,
"remind_compact": false
}
}
}
```
| Key | Default | What It Controls |
|-----|---------|-----------------|
| `auto_compact_research` | `true` | Prompt to compact after web research |
| `auto_compact_subagent` | `true` | Prompt to compact after subagent completes |
| `check_compactions_before_plan` | `true` | List prior compactions before planning |
| `remind_compact` | `true` | Remind to save context before compaction |
| `suggest_siblings` | `true` | Show install suggestions for sibling plugins (global) |
## How It Works
Hooks inject prompts that trigger `claude-praetorian-mcp` tools at high-impact moments. No business logic in the plugin — it tells Claude *when* to compact, the MCP handles *how*.
Storage is project-local at `.claude/praetorian/`.
## License
MIT
© vvkmnn · MIT · Vvkmnn/claude-emporium