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
/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-praetorian@claude-emporiumWhat 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 migrationsand 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-emporiumThis installs the whole claude-praetorian plugin with all its skills
2Skills CLI (Vercel)
npx skills add Vvkmnn/claude-emporium --skill claude-praetorian -a claude-code3Manually: put the files in place
~/.claude/skills/claude-praetorian/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/claude-praetorian/
1Skills CLI (Vercel)
npx skills add Vvkmnn/claude-emporium --skill claude-praetorian -a codex2Manually: put the files in place
.agents/skills/claude-praetorian/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Vvkmnn/claude-emporium --skill claude-praetorian -a cursor2Manually: put the files in place
.cursor/skills/claude-praetorian/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Vvkmnn/claude-emporium plugins/claude-praetorian/skills/claude-praetorian2Manually: put the files in place
.github/skills/claude-praetorian/SKILL.md1Skills CLI (Vercel)
npx skills add Vvkmnn/claude-emporium --skill claude-praetorian -a gemini-cli2Platform CLI
gemini skills install https://github.com/Vvkmnn/claude-emporium --path plugins/claude-praetorian/skills/claude-praetorianManually: put the files in place
.devin/skills/claude-praetorian/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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