Skip to main content
plugin

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-praetorian@claude-emporium
Open on GitHub

What 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-emporium

Step 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

Similar plugins

All plugins for Agent setup: memory, context, orchestration →

From the same set20

The whole set →
claude-orator claude-orator scores prompts across seven dimensions and returns a reworked version. Use it to shape subagent requests or review prompts across a session. CX Codex +1 ★ 78repo stars claude-historian claude-historian — a skill that automatically searches past sessions before triggering web research, planning, or debugging. Reuse past solutions across projects and avoid redundant work. CX Codex +1 ★ 78repo stars claude-gladiator claude-gladiator tracks tool failures, collects observations, and prompts reflection to update rules and skills at session end. It helps the agent learn from its own mistakes. CX Codex +1 ★ 78repo stars claude-orator claude-orator is a Claude Code plugin that scores and restructures prompts before they go to subagents. Its hook suggests a rewrite for underspecified Task prompts. ★ 78repo stars claude-vigil claude-vigil creates file snapshots before destructive operations, shows what changed, and restores safely. Protection against accidental deletion or overwriting. ★ 78repo stars claude-gladiator claude-gladiator is a Claude Code plugin that catches tool failures and prompts reflection before sessions close. ★ 78repo stars claude-oracle claude-oracle searches 17 sources for skills, plugins, and MCP servers. It can look for relevant tools before planning or after a command error. ★ 78repo stars claude-historian claude-historian — a plugin that searches your past sessions before web research, planning, and debugging. Reuses solutions you've already found and prevents redundant work. ★ 78repo stars

Project sponsors

Companies that keep this analytics open