clear-context

clear-context is a skill for Claude Code from athola/claude-night-market. It costs 33 tokens per session (3,328 once invoked), scanned A, original, MIT.

A procedure for handing an overfull AI coding session to a fresh subagent while preserving the work completed so far.

In plain words
What is it for?
It saves session state, starts a continuation at high context usage, and supports automatic handoffs during extended workflows.
Why use it?
It lets long tasks continue when the current conversation is nearly full, instead of losing useful working context or stopping midway.

Skill for Claude Code

Written for Claude Code: hooks in frontmatter. Also seen: mentions subagents; names the TodoWrite tool; mentions Claude Code.

Part of the conserve plugin — 15 skills, 6 commands, 5 agents shipped together

Good fit It saves session state, starts a continuation at high context usage, and supports automatic handoffs during extended workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/athola/claude-night-market/clear-context
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 athola/claude-night-market --skill clear-context
Clone the repo
git clone --depth 1 https://github.com/athola/claude-night-market

Made for: Claude Code.

Or install conserve, the plugin that ships this one along with the rest of its 15 skills, 6 commands, 5 agents.

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 clear-context

README.md
[![agentmods](https://agentmods.dev/badge/skills/athola/claude-night-market/clear-context/github.svg)](https://agentmods.dev/skills/athola/claude-night-market/clear-context)
Your own site
<a href="https://agentmods.dev/skills/athola/claude-night-market/clear-context"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/clear-context/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 clear-context

Your own site · 80×15
<a href="https://agentmods.dev/skills/athola/claude-night-market/clear-context"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/clear-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,328 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 27
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
  • high Excessive Agency · line 321
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • medium Excessive Agency · line 237
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00033 $0.03328
Opus 5 $0.00016 $0.01664
Sonnet 5 $0.00007 $0.00666
Haiku 4.5 $0.00003 $0.00333

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

Security

Grade A, and why

clear-context 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 8d 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.

plugins/conserve/skills/clear-context/SKILL.md · 404 lines

How it starts

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

Table of Contents

Clear Context Skill

Quick Start

When context pressure reaches critical levels (80%+), invoke this skill to:

  1. Save current session state
  2. Delegate continuation to a fresh subagent
  3. Continue work without manual intervention
Skill(conserve:clear-context)

When To Use

  • Proactively: Before starting large multi-chained tasks
  • Reactively: When context warning indicates 80%+ usage
  • Automatically: Integrated into long-running workflows

When NOT To Use

  • Context usage is under 50% - continue working normally
  • Mid-critical-operation where handoff would lose state
  • Consider "Summarize from here" first (Claude Code 2.1.32+): Before full auto-clear, try partial summarization via the message selector. This compresses older context while preserving recent work, often sufficient to relieve pressure without a full handoff.

The Auto-Clear Pattern

Since /clear requires user action, we achieve automatic context clearing without interruption through subagent delegation:

Main Agent (high context)
    ↓
    Saves state to .claude/session-state.md
    ↓
    Spawns continuation subagent (fresh context)
    ↓
    Subagent reads state, continues work

Thresholds

Level Threshold Action
WARNING 40% Monitor, plan optimization
CRITICAL 50% Prepare for handoff
EMERGENCY 80% Execute auto-clear now

Configuration (environment variables):

  • CONSERVE_EMERGENCY_THRESHOLD: Override 80% default (e.g., 0.75 for 75%)
  • CONSERVE_SESSION_STATE_PATH: Override .claude/session-state.md default

Auto-Clear Workflow

Step 1: Assess Current State

Read the full file on GitHub · 404 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 404 lines · 33 tokens per session scan A a86ca9ff3bf2

Subscribe to this mod's changes

clear-context is a skill published in the GitHub repository athola/claude-night-market (337 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 3,328 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-09-03.

Related

Other skills, from other repositories

setup

Initialize any folder as a Bedrock-powered Obsidian vault. Creates entity directories, copies templates, configures language and domain taxonomy, scaffolds connected example entities, and checks dependencies. Use when: "bedrock setup", "bedrock-setup", "/bedrock:setup", "initialize vault", "setup vault", "create…

ccplugins/awesome-claude-code-plugins · 90 tokens

sync

Re-synchronizes the vault with external sources. In default mode, scans the sources field of all entities, deduplicates URLs, fetches updated content from each source (Confluence, GDocs, GitHub, Markdown), performs incremental diff and delegates writing to /bedrock:preserve. With --people, scans actor repositories via…

ccplugins/awesome-claude-code-plugins · 138 tokens

preserve

Single write point for the vault. Centralizes entity detection, textual matching, entity creation/update, and bidirectional linking. Accepts structured input (list of entities), free-form input (text, meeting notes, session context), or graphify output (graph.json + obsidian markdown from /graphify pipeline). Use…

ccplugins/awesome-claude-code-plugins · 118 tokens

ask

Adaptive vault reader skill. Receives a natural language question, searches the vault first (Glob/Grep, entity reads, wikilink traversal), then self-assesses whether more context is needed. Escalates to /graphify for graph-level understanding or to /bedrock:teach for remote content ingestion only when the vault alone…

ccplugins/awesome-claude-code-plugins · 141 tokens

compress

Vault alignment engine. Detects and fixes 5 types of structural misalignments: broken backlinks, concept fragmentation, entity miscategorization, duplicated entities, and misnamed entities. Delegates all writes to /bedrock:preserve. Supports interactive mode (user confirmation) and cron mode (autonomous mechanical…

ccplugins/awesome-claude-code-plugins · 104 tokens

gdoc-to-markdown

Internal fetcher module for Google Docs and Sheets. Fetches content via MCP (preferred, when available), Google API with bearer token or public URL export (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:teach and /bedrock:sync — not intended for direct…

ccplugins/awesome-claude-code-plugins · 76 tokens