context-guardian

context-guardian is a skill for Claude Code, Codex from beel-collab/presets.dev. It costs 32 tokens per session (3,039 once invoked), scanned A, original, MIT.

A context-protection system that saves important project information before automatic context compaction. Context compaction reduces earlier conversation text to fit within limits.

In plain words
What is it for?
Use it when preserving context, taking snapshots, checking integrity, or preparing a complex project for compaction.
Why use it?
It is intended to prevent critical information from being lost while a long technical session is being shortened.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it when preserving context, taking snapshots, checking integrity, or preparing a complex project for compaction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/beel-collab/presets.dev/context-guardian
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add beel-collab/presets.dev --skill context-guardian
Clone the repo
git clone --depth 1 https://github.com/beel-collab/presets.dev

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-guardian

README.md
[![agentmods](https://agentmods.dev/badge/skills/beel-collab/presets.dev/context-guardian/github.svg)](https://agentmods.dev/skills/beel-collab/presets.dev/context-guardian)
Your own site
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/context-guardian"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/context-guardian/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-guardian

Your own site · 80×15
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/context-guardian"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/context-guardian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.03039
Opus 5.5 $0.00013 $0.01216
Sonnet 5.5 $0.00006 $0.00608
Haiku 4.5 $0.00003 $0.00304

Measured 1mo ago against content hash 5e7be149382c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-guardian scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude/skills/ai-ml/context-guardian/SKILL.md · 315 lines

How it starts

The opening of the file, as written. The whole thing — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Guardian

Overview

Guardiao de contexto que preserva dados criticos antes da compactacao automatica. Snapshots, verificacao de integridade e zero perda de informacao.

When to Use This Skill

  • When the user mentions "compactacao contexto" or related topics
  • When the user mentions "perda de contexto" or related topics
  • When the user mentions "snapshot contexto" or related topics
  • When the user mentions "preservar contexto" or related topics
  • When the user mentions "contexto critico" or related topics
  • When the user mentions "antes de compactar" or related topics

Do Not Use This Skill When

  • The task is unrelated to context guardian
  • A simpler, more specific tool can handle the request
  • The user needs general-purpose assistance without domain expertise

How It Works

Sistema de integridade de contexto que protege projetos tecnicoss complexos contra perda de informacao durante compactacao automatica do Claude Code. Enquanto o context-agent atua APOS as sessoes (save/load), o context-guardian atua DURANTE a sessao, detectando quando a compactacao esta proxima e executando protocolos de preservacao com verificacao redundante.

Por Que Isto Existe

O Claude Code compacta automaticamente mensagens antigas quando o contexto se aproxima do limite da janela. Essa compactacao e heuristica — ela resume mensagens para liberar espaco, mas inevitavelmente perde detalhes. Para projetos simples, isso funciona bem. Mas para projetos tecnicos pesados (como ecossistemas com 21+ skills, auditorias de seguranca, refatoracoes de arquitetura), a perda de um unico detalhe pode causar regressoes, re-trabalho ou inconsistencias graves.

O context-guardian resolve isso criando uma camada de protecao PRE-compactacao: extrai, classifica, verifica e persiste todas as informacoes criticas ANTES que a compactacao automatica as destrua.

Localizacao

C:\Users\renat\skills\context-guardian\
├── SKILL.md                          # Este arquivo
├── references/
│   ├── extraction-protocol.md        # Protocolo detalhado de extracao
│   └── verification-checklist.md     # Checklist de verificacao e redundancia
└── scripts/
    └── context_snapshot.py           # Script de snapshot automatico

Read the full file on GitHub · 315 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 315 lines · 32 tokens per session scan A 5e7be149382c

Subscribe to this mod's changes

context-guardian is a skill published in the GitHub repository beel-collab/presets.dev (3 stars, last pushed 5mo ago), licensed MIT. It adds 32 tokens to every session and 3,039 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

llm-wiki

Use when building or maintaining a self-contained personal knowledge base (an LLM wiki) in plain markdown. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki health, auditing article claims against their sources, critiquing a wiki source's reasoning, superseding stale knowledge, 'add to…

sammcj/agentic-coding · 82 tokens

authoring-claude-md

Creating and maintaining CLAUDE.md project memory files and .claude/rules/ rule files that provide non-obvious codebase context. Use when (1) creating a new CLAUDE.md for a project, (2) adding architectural patterns or design decisions to existing CLAUDE.md, (3) capturing project-specific conventions that aren't…

sammcj/agentic-coding · 93 tokens

graphify

Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community…

sammcj/agentic-coding · 76 tokens

skill-creator-primer

You MUST load this skill before the skill-creator skill AND before making ANY change to, or conducting a review of ANY Agent Skill. Triggers include creating, editing, reviewing, or contributing to any part of an Agent Skill (description, frontmatter, body, references, scripts, trigger evals, conflicts, etc).

sammcj/agentic-coding · 74 tokens

extract-wisdom

Extract wisdom, insights, and actionable takeaways from YouTube videos, blog posts, articles, or text files. Use when asked to extract wisdom or key insights from a given content source.

sammcj/agentic-coding · 43 tokens

apply-mantel-styles

Provides guidelines for applying Mantel's brand styles to diagrams and frontend components. Use when asked to create visuals that need to align with Mantel's branding.

sammcj/agentic-coding · 37 tokens