agentleFS
usibuildsusibuilds/claude-context-zones/skills/context-guardian/SKILL.md

context-guardian

Skill0 starsChanged 12 days agoMITView on GitHub

Track how full the current chat's context window is (green/yellow/red zones), alert once when a zone is crossed, and write a copy-ready handoff so work continues in a fresh chat without losing context. Use in long working chats, or when the user says "context check", "handoff" or "summary for a new chat".

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. Fandry96/k3-agentic-skills★ 27same name
    2. brunoflma/context-guardian★ 3same name
    3. elbayoumi/crewloom★ 3same name
    4. xiangu152/my_claude_skills★ 2same name
    5. charly-vibes/incitaciones★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every new message makes the model re-read the whole conversation, so long chats burn usage limits faster.

    line 13
  2. Distinctive:

    Do NOT print a meter on every reply while in green.

    line 30
  3. Very specific:

    After that, one short line at the end of each reply is enough (e.g.

    line 35
  4. Distinctive:

    When the user says "context check", give the zone, the estimate, and the biggest items (e.g.

    line 36

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context Guardian

Goal: the user never loses context, and never wastes tokens and quality on an overloaded chat. Reply in the user's language. Keep the handoff block in English (or the language of the project) so any chat can use it.

Why this matters

Every new message makes the model re-read the whole conversation, so long chats burn usage limits faster. Research on "context rot" shows answer quality also drops as context grows, and details in the middle of a long context are recalled worst. Working in short, focused chats with clean handoffs avoids both problems.

1. Estimate the context (every reply in a working chat)

Chat apps usually show no exact meter, so estimate:

  • Count everything in this chat: all messages, your replies, pasted text, attached files, tool results and project knowledge files.
  • Rough rule: 1 token ≈ 4 characters of English, ≈ 3 characters of code or non-English text written in Latin script. A full PDF page ≈ 500–800 tokens. An image ≈ 1,500 tokens.
  • Assume a 200K-token window unless the user says otherwise.
  • Be honest that this is an estimate. Round to the nearest 5%.
ZoneRangeMeaning
🟢 Green0–40%Normal work
🟡 Yellow40–60%Finish the current task, start nothing new
🔴 Red60%+Write the handoff, move to a new chat

2. Alerts

  • Do NOT print a meter on every reply while in green.
  • The first time the chat enters yellow, put this at the TOP of your reply (in the user's language): 🟡 Context ~<n>% — finish the current task here; start new topics in a new chat.
  • The first time it enters red, put this at the TOP: 🔴 Context ~<n>% — say "handoff" and I'll write a summary for a fresh chat.
  • After that, one short line at the end of each reply is enough (e.g. 🔴 ~70%).
  • When the user says "context check", give the zone, the estimate, and the biggest items (e.g. "2 PDFs ≈ 30K").

3. Handoff (when the user says "handoff", or after a feature is done)

Produce ONE copy-ready block, max ~50 lines:

# HANDOFF — <project / task> — <date>
## Goal
## Decisions made (with 1-line reason)
## Current status (done / in progress / not started)
## Key facts & numbers to keep
## Files / links involved
## Open questions / bugs
## Next 3 steps
## Instructions for the new chat
Continue from this handoff. Do not ask me to repeat context. Start with step 1.

Then tell the user: copy it → open a new chat (same Project if they use Projects) → paste → continue. In a Project, suggest saving it as HANDOFF.md in the project knowledge, replacing the previous one rather than adding a new file each time.

4. Token-saving nudges (only when relevant, max one per reply)

  • A big PDF/DOCX/XLSX was attached → suggest converting it to Markdown (e.g. Microsoft's MarkItDown) and attaching the .md next time.
  • The user starts an unrelated topic in a long chat → suggest a new chat for it.
  • The same long file was pasted twice → point it out.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.