Skip to main content
skill CX Codex

claude-praetorian — Claude Code skill: context memory across sessions

claude-praetorian — a skill that snapshots your context before it gets compacted and brings it back later: before planning, after web research, when a subagent finishes.

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

The skill watches four moments where context tends to leak away. When plan mode is about to open, it lists earlier snapshots and offers to restore one. Before a compaction it asks which decisions and findings to keep. After WebFetch or WebSearch it proposes saving the result as web_research, and when a subagent stops it proposes task_result.

You can also do it by hand with /compact-praetorian [type] [title] for writing a snapshot and /restore-praetorian [query] for finding one by topic. Both go through the MCP tools praetorian_compact and praetorian_restore, so the server has to be registered first: claude mcp add praetorian -- npx claude-praetorian-mcp. Without it there is nowhere for a snapshot to go.

Other plugins from the same collection feed the snapshot. historian contributes past plans, oracle contributes tool discoveries, vigil checkpoints files while this runs. None are required. The skill saves and restores on its own.

What it helps with

  • save web research findings before the context window compacts
  • pull a past database decision back into the current session
  • review earlier plans before entering plan mode
  • snapshot a subagent result as task_result
  • merge saved context with tool findings into one briefing

Example prompts for the agent

  • Save what we found about the billing API: /compact-praetorian web_research "billing api notes"
  • Run /restore-praetorian migrations and summarize what we decided about the schema
  • List recent compactions before we start planning and suggest one to restore

How to install claude-praetorian

1Plugin marketplace

/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-praetorian@claude-emporium

This installs the whole claude-praetorian plugin with all its skills

2Skills CLI (Vercel)

npx skills add Vvkmnn/claude-emporium --skill claude-praetorian -a claude-code

3Manually: put the files in place

~/.claude/skills/claude-praetorian/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/claude-praetorian/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about claude-praetorian

How to install claude-praetorian in Claude Code?

Add the marketplace with /plugin marketplace add Vvkmnn/claude-emporium, then install the plugin: /plugin install claude-praetorian@claude-emporium. Next register the MCP server with claude mcp add praetorian -- npx claude-praetorian-mcp.

What does claude-praetorian do?

It guards your context on four hooks: before planning, before compaction, after web research, and when a subagent stops. Each time it offers to save or restore the relevant piece.

What does the skill need to work?

A registered MCP server named praetorian, otherwise praetorian_compact and praetorian_restore have nowhere to write. One command sets it up: claude mcp add praetorian -- npx claude-praetorian-mcp.

Source text

SKILL.md · MIT
---
name: claude-praetorian
description: Context preservation with cross-session memory — hooks prompt compaction at high-impact moments, siblings enrich what gets saved
triggers: [PreToolUse, PreCompact, PostToolUse, SubagentStop]
---

# Praetorian Plugin

Context guard. Saves and restores valuable context at the right moments — before planning, after research, when subagents complete.

## Hooks

| Hook | When | Action |
|------|------|--------|
| **PreToolUse(EnterPlanMode)** | Before planning | Lists prior compactions, suggests restoring |
| **PreCompact** | Before context resets | Prompts to save decisions/insights/findings |
| **PostToolUse(WebFetch/WebSearch)** | After web research | Prompts to compact as `web_research` |
| **SubagentStop** | After subagent completes | Prompts to compact as `task_result` |

## Commands

| Command | Description |
|---------|-------------|
| `/compact-praetorian [type] [title]` | Save current context |
| `/restore-praetorian [query]` | Load previous context |

## Workflows

### Compact (standalone)

1. Identify what's worth saving (research, decisions, patterns)
2. `praetorian_compact(type, title, key_insights, refs)`
3. Verify with `praetorian_restore(title)` to confirm it saved

### Compact (with siblings)

1. If **historian** active: `search_plans()` to check if past context already covers this
2. If **oracle** active: include any tool discoveries in `key_insights`
3. `praetorian_compact(type, title, key_insights, refs)`
4. If **vigil** active: files are also checkpointed via quicksave

### Restore (standalone)

1. `praetorian_restore()` — list recent compactions
2. `praetorian_restore("query")` — search for specific topic
3. Summarize findings for the current task

### Restore (with siblings)

1. `praetorian_restore("query")` — load praetorian context
2. If **historian** active: `search_conversations("query")` for broader session history
3. If **oracle** active: `search("query")` for tools relevant to the restored context
4. Combine all sources into a unified briefing

## Sibling Synergy

| Sibling | Value | How |
|---------|-------|-----|
| **Historian** | Past plans surface during planning compactions | `search_plans()` enriches pre-plan hook |
| **Oracle** | Tool discoveries included in compactions | Oracle results added to `key_insights` |
| **Gladiator** | Observations inform what to compact | Failure patterns highlight important context |
| **Vigil** | Files checkpointed alongside context | Quicksave protects files during compaction |

## Requires

```
claude mcp add praetorian -- npx claude-praetorian-mcp
```

© vvkmnn · MIT · Vvkmnn/claude-emporium

Similar skills

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

From the same set20

The whole set →
restore-praetorian restore-praetorian is a Claude Code command that retrieves past work from praetorian memory. It helps resume tasks by finding recent summaries or searching saved session context. CX Codex +1 ★ 78repo stars compact-praetorian compact-praetorian — a Claude Code command that writes the current session context into praetorian memory so it persists across sessions. Trigger it after research, exploration, or any decision worth keeping. CX Codex +1 ★ 78repo stars review-gladiator review-gladiator processes recorded observations across sessions, clusters recurring patterns, and suggests actionable workflow rules. CX Codex +1 ★ 78repo stars claude-oracle claude-oracle searches 17 sources for relevant skills, plugins, and MCP servers. It runs before planning and after Bash errors. CX Codex +1 ★ 78repo stars claude-vigil claude-vigil saves file checkpoints and automatically quicksaves code before risky bash operations like rm or git reset. Roll back edits whenever an agent command goes wrong. CX Codex +1 ★ 78repo stars 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

Project sponsors

Companies that keep this analytics open