Context Hygiene & Session Management

Context Hygiene & Session Management is a skill for Claude Code, Codex from Bilal140202/the-lord-of-the-skills. It costs 40 tokens per session (700 once invoked), scanned A, original, MIT.

A workflow for managing long AI coding conversations and their session boundaries. It preserves useful progress before recommending a fresh chat when the work becomes too large or changes direction.

In plain words
What is it for?
Use it to decide when to split unrelated work, finish a handoff, save progress, and start the next task with a cleaner context.
Why use it?
Long conversations can make an AI lose track of constraints, repeat work, or invent details as irrelevant history accumulates.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to decide when to split unrelated work, finish a handoff, save progress, and start the next task with a cleaner context.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os
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 Bilal140202/the-lord-of-the-skills --skill kingdaddy007__my-os
Clone the repo
git clone --depth 1 https://github.com/Bilal140202/the-lord-of-the-skills

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 Hygiene & Session Management

README.md
[![agentmods](https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os/github.svg)](https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os)
Your own site
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os/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 Hygiene & Session Management

Your own site · 80×15
<a href="https://agentmods.dev/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os"><img src="https://agentmods.dev/badge/skills/bilal140202/the-lord-of-the-skills/kingdaddy007__my-os.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 700 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.00040 $0.00700
Opus 5 $0.00020 $0.00350
Sonnet 5 $0.00008 $0.00140
Haiku 4.5 $0.00004 $0.00070

Measured 12d ago against content hash b5984b88a12d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Context Hygiene & Session Management 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 12d 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.

skills/fangorn/claude-code/Kingdaddy007__my-os/SKILL.md · 66 lines

How it starts

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

Context Hygiene & Session Management

Purpose

AI context windows degrade as conversations grow. After ~30+ exchanges, the AI loses track of earlier constraints, starts hallucinating details, and wastes tokens re-reading irrelevant history.

This skill teaches Anti-Gravity to actively manage session boundaries automatically — securing all progress to disk before the user moves to a clean chat window.

When to Advise a Session Split

Recommend the user open a new chat window when:

  1. The task changes significantly. If we finished debugging and are now building a new feature, that is a new session.
  2. The conversation exceeds ~30 exchanges. Context quality degrades. Proactively say: "We've covered a lot. I recommend starting a fresh chat for the next piece so I stay sharp."
  3. Multiple unrelated tasks are being discussed. Each task deserves its own clean context.
  4. A micro-task sequence is complete. After finishing a planned set of tasks, suggest: "Good stopping point. For the next batch, a fresh session will give you better results."

How to Execute a Handoff (The Zero-Friction Method)

Never ask Beloved to manually copy-paste a "Handoff Brief." Instead, perform these two steps automatically:

Step 1: Secure Long-Term Knowledge (Memory)

Before suggesting a split, ensure all permanent knowledge from this session is written to disk:

  • Did we make an architectural choice? Write it to .agents/memory/decisions-log.md.
  • Did we learn what not to do? Write it to .agents/memory/mistakes-to-avoid.md.
  • Did we establish a new convention? Write it to .agents/memory/common-patterns.md.

Step 2: Secure Immediate State (Workflow)

Update .agents/workflow-state.json so the next session knows exactly where to resume. Ensure the notes, key_decisions, and phases fields are perfectly up to date.

Reference format from GLOBAL_MEMORY.md:

{
  "workflow": "build-feature",
  "current_phase": "IMPLEMENT",
  "completion_pct": 64,
  "notes": "Finished the UI layout. Next session must focus on wiring the submit button to the API.",
  "key_decisions": ["Used Flexbox instead of Grid for the main container"],
  "blockers": []
}

Read the full file on GitHub · 66 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. 12d ago First seen · 66 lines · 40 tokens per session scan A b5984b88a12d

Subscribe to this mod's changes

Context Hygiene & Session Management is a skill published in the GitHub repository Bilal140202/the-lord-of-the-skills (4 stars, last pushed 6d ago), licensed MIT. It adds 40 tokens to every session and 700 once invoked, about $0.0002 per session on Opus 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.