cc-reload-plugin: Instructions file for Claude Code

CLAUDE.md

cc-reload-plugin CLAUDE.md is an instructions file for Claude Code from betmoar/cc-reload-plugin. It costs 18,152 tokens per session, scanned A, original, MIT.

A maintainer guide for the cc-reload plugin, which keeps a Claude Code session's working context available across resets, resumes, and context compaction.

In plain words
What is it for?
It is for understanding the plugin's control flow, on-disk state, important assumptions, and the connections between files that must be updated together.
Why use it?
It explains the plugin's stored state, hooks, commands, and design constraints so maintainers can change it without breaking session continuity.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions CLAUDE.md.

This is betmoar/cc-reload-plugin's own configuration. It tells Claude Code how to work on cc-reload-plugin itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cc-reload-plugin configures →

Reuse

Borrowing it

Nothing to install: this file belongs to betmoar/cc-reload-plugin. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/betmoar/cc-reload-plugin/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/betmoar/cc-reload-plugin

Made for: Claude Code.

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 cc-reload-plugin CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/betmoar/cc-reload-plugin/claude-md/github.svg)](https://agentmods.dev/instructions/betmoar/cc-reload-plugin/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/betmoar/cc-reload-plugin/claude-md"><img src="https://agentmods.dev/badge/instructions/betmoar/cc-reload-plugin/claude-md/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 cc-reload-plugin CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/betmoar/cc-reload-plugin/claude-md"><img src="https://agentmods.dev/badge/instructions/betmoar/cc-reload-plugin/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18,152 This file is loaded in full into every session.
When invoked 18,152 The same file — it is already loaded in full.
Security scan A 1 finding. 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.18152 $0.18152
Opus 5.5 $0.07261 $0.07261
Sonnet 5.5 $0.03630 $0.03630
Haiku 4.5 $0.01815 $0.01815

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

Security

Grade A, and why

cc-reload-plugin CLAUDE.md scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fail-open-silent on literally anything going wrong (down, no `curl`, timeout, bad JSON, missing or
CLAUDE.md · 734 lines

How it starts

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

cc-reload — maintainer handoff

This file is the mental model for anyone (human or agent) changing this plugin. Read it before touching hooks/. The README explains what the plugin does for users; this explains why the code is shaped the way it is, which invariants are load-bearing, and how to change each piece without breaking the others.

What this is, in one paragraph

Four bash hooks + three slash commands + one skill that keep a Claude Code session's working thread alive across context resets. State machine on disk under the user's project at .reload/: a digest (session.md), a one-shot arm marker (pending, now stamped with its arming session id when known), a two-pass handshake marker (summarizing), a notify ladder (notified), a model/window stamp (model, one session: line per session since 0.5.0), per-project config (config), side-filed digests from a detected cross-session collision (session.<id>.md, since 0.3), and — since 0.5.0 — per-lineage arms (pending.<pid>, keyed on the Claude Code PROCESS id, which /clear keeps) and an append-only journal of every snapshot/arm/side-file/rehydrate. The fourth hook, PreToolUse, is a same-session enforcement point for the collision guard (and the journal's snapshot writer), not a new continuity mechanism. There is no daemon, no state anywhere else, and no network on the per-turn hot path — SessionStart makes one optional loopback-only lookup against a local cc-proxy (see the proxy_window() decision below), fail-open, never repeated per-turn. User-facing docs: README (short) + docs/how-it-works.md, docs/concurrent-sessions.md, docs/statusline.md.

Control flow (the whole system)

Stop hook (every turn end)
  ├─ summarizing marker present AND not another LIVE process's (invariant 22)?
  │     → PASS 2: consume marker; if digest exists, arm THIS lineage's slot (lib.sh arm_reload:
  │     `pending.<CLAUDE_PID>`, else bare `pending`) and VERIFY it with -f
  │     (not a regular file → "reload NOT armed", never "saved")
  │     (fresh digest → success msg; digest not rewritten this turn → arm anyway, warn honestly;
  │      no digest → do NOT arm, warn)
  │  (occupancy below = the last MAIN-THREAD assistant row of a tail window of the transcript,
  │   per-line parsed; full-file stream only if the window holds none — invariant 14)
  ├─ stop_hook_active && no marker? → stand down (broken handshake must never re-block = loop)
  ├─ occupancy < budget?          → clear the `notified` ladder, exit silently
  └─ occupancy ≥ budget           → branch on context_budget_mode (default notify):
        ├─ snapshot mode AND not armed_here (no consumable arm entry; a foreign LIVE arm does
        │   NOT count — F12; a stray directory DOES: -e, invariant 15)   [legacy `checkpoint` aliases here]
        │   → PASS 1: unless another LIVE process's `summarizing` sits there (then notify instead),
        │     write `summarizing` (sid + pid) and VERIFY it with -f (or refuse to block),
        │     emit {decision:"block"} re-injecting "write .reload/session.md, then STOP"
        └─ notify mode, OR snapshot mode already armed_here
            → laddered nudge: {systemMessage} only — never blocks, zero model tokens.
              Fires on first crossing, then only at last-notified +10 points (`notified`
              stores the %). Ladder unwritable → silent (else it would nag every turn).

PreCompact hook (manual /compact or auto-compaction)
  └─ arm this lineage's slot (arm_reload); on failure journal `arm-failed` (CC DISCARDS PreCompact's
     systemMessage — the SessionStart(compact) that follows surfaces it); if no digest exists,
     write a mechanical fallback stub (honest about being thin)

SessionStart hook (startup|resume|clear|compact|fork)
  ├─ stamp model id + resolved window to .reload/model, PER SESSION (`session:` line; Stop gets no
  │     model field — this bridges it; another session's startup never moves this one's window)
  ├─ startup|clear|compact (NOT resume|fork) → purge `notified`, and `summarizing` unless it is
  │     another LIVE process's (invariant 22); a handshake must not outlive its context (invariant 10)
  ├─ arms_here (own `pending.<pid>` first, then bare `pending` + ORPHANS whose pid is dead, newest
  │     first; a foreign LIVE arm is NEVER listed) empty?
  │     ├─ foreign live arm(s) exist → 🔒 notice "left in place, this session starts fresh", journal
  │     │     `defer`, exit — invariant 21
  │     ├─ source=compact and the journal's last event is `arm-failed` → surface it once (F06)
  │     └─ else do nothing (a deliberate /clear is respected)
  └─ else → resolve the digest: session.md, or, when its owner ≠ the arm's sid and a side-file
        `session.<armsid>*.md` exists, that side-file (this lineage's OWN thread — no warning);
        no side-file → session.md + the incoherence WARNING (never gates — invariant 3);
        consume every listed arm (one-shot); claim session.md (only when it is the source);
        inject as additionalContext + visible banner; warn above the 10,000-char hook-output cap
        (F05); journal `rehydrate`

PreToolUse hook (model Write/Edit)
  └─ path == $DIGEST && tool is Write|Edit?
       → journal `snapshot`; with a session_id → claim-digest.sh: foreign + fresh incumbent ->
         side-file (journal `sidefile`) + warn; ALWAYS exit 0 (permit)

Read the full file on GitHub · 734 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 Changed · +166 lines · +4,441 tokens per session 23d8e40fa71c
  2. 1mo ago Changed · +133 lines · +3,415 tokens per session b0b4868bed30
  3. 1mo ago Changed · +33 lines · +874 tokens per session de4e8bf54446
  4. 1mo ago Changed · +157 lines · +4,209 tokens per session 7beca7b18acf
  5. 1mo ago First seen · 245 lines · 5,213 tokens per session scan A 05e202842025

Subscribe to this mod's changes

cc-reload-plugin CLAUDE.md is an instructions file published in the GitHub repository betmoar/cc-reload-plugin (1 stars, last pushed 1mo ago), licensed MIT. It adds 18,152 tokens to every session, about $0.0726 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories