context-guardian
Skill by sickn33
Context Guardian saves critical project data before Claude Code's automatic context compaction. It creates snapshots, checks their integrity and writes a transition briefing for the session that continues.
Install context-guardian
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/context-guardian ~/.claude/skills/context-guardianRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/context-guardian ~/.gemini/antigravity-cli/skills/context-guardianAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Context Guardian protects long technical sessions from losing details when Claude Code automatically compacts older messages. It works during a session. It extracts technical decisions, task state, applied fixes, changed code, errors and working commands, sorted into priority levels P0, P1 and P2. It then runs an integrity checklist and saves the results in three layers: a structured Markdown snapshot, an update to MEMORY.md, and a context-agent save. It also produces a transition briefing and a completeness check after compaction. The source says it is written for complex projects, such as ecosystems with many skills, security audits and architecture refactors. It complements the separate context-agent skill, which handles persistence between sessions.
Written from the project's SKILL.md and checked against it.
What it can do
- Structured extractionExtracts critical categories from the conversation and ranks them P0, P1 or P2 by loss risk.
- Integrity verificationRuns a checklist to confirm that modified files, bugs, decisions and pending tasks are complete.
- Redundant persistenceSaves a snapshot file, updates MEMORY.md and triggers a context-agent save.
- Transition briefingWrites a briefing with current state, pending tasks, critical decisions and key paths.
- Quick protocolGives a short fallback procedure when there is little time before compaction.
- Post-compaction checkReviews preserved context after compaction and loads or searches context-agent data if gaps remain.
What you need
- Python to run the context_snapshot.py script
- The separate context-agent skill for its save, load and search steps
- Write access to the snapshot data directory
Try asking
- Save a snapshot of this session before the context gets compacted
- Create a checkpoint with the pending tasks and critical decisions
- Run the integrity check on the current session state before compaction
Good to know
- The script only creates a template. It does not read the conversation or detect compaction.
- It does not promise full recovery or an exact percentage of the context window.
- Save and prune actions need explicit approval, and MEMORY.md must not be changed without authorization.
- context-agent is a separate dependency.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/context-guardian/SKILL.md, skills/context-guardian/scripts/context_snapshot.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md14 KB -
references/extraction-protocol.md4 KB -
references/verification-checklist.md4 KB -
scripts/context_snapshot.py8 KB
Alternatives to context-guardian
All alternatives →Set up and diagnose a local agentmemory installation. It covers MCP connections, environment variables, ports, auth and feature flags, and is for users getting started or checking a connection.
Analyzes a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit links and topic clusters. Built for people who maintain LLM-generated markdown wikis.
Saves and loads timestamped reports for AI assistants, with keyword routing for fast lookup. It also runs an Actionability Gate that checks report links before delivery. Intended for morning briefings, meeting digests and research reports.
Removes a personal fact, preference, relationship detail, topic or past event from Muse's active memory. It also stops existing copies and automations from bringing it back.
Git Context Controller (GCC) is a skill that stores agent memory as a versioned file system under .GCC/. It suits multi-step projects that need milestone tracking, branching and context recovery across sessions.
Guides an evidence-first reading of a book, article, PDF or document set. Built for readers who want claims, evidence and recall rather than a short summary.
Compare with agentmemory-config, understand-knowledge or reports
context-guardian: common questions
What does Context Guardian protect?
It protects critical project data, such as technical decisions, task state, applied fixes and working commands, before Claude Code compacts older messages. The source lists these as P0 categories.
Does Context Guardian need context-agent?
Its persistence layer calls the context-agent save command, and the source describes context-agent as a separate dependency. The snapshot step can run without it if the format in the extraction protocol is followed manually.
Can Context Guardian delete my snapshots?
The source says the skill can remove snapshots during pruning. It warns to confirm the data directory, keep a backup and get explicit approval before running save or prune.
How do I install context-guardian?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is context-guardian free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is context-guardian safe to use?
It scores 92 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to context-guardian?
Similar skills: agentmemory-config, understand-knowledge, reports, forget.
