Claude-Mind: Skill for Claude Code

.claude/skills/drain-temp/SKILL.md

drain-temp is a skill for Claude Code from zkysar1/Claude-Mind. It costs 237 tokens per session (6,567 once invoked), scanned A, original, MIT.

A process for moving temporary working documents into the agent’s long-term knowledge stores, then archiving the processed files.

In plain words
What is it for?
Use it to process analyses, briefings, audits, design documents, and snapshots, routing reusable information to the knowledge tree, reasoning bank, or guardrails.
Why use it?
It stops important analysis from remaining hidden in a temporary folder where later context loading and retrieval cannot find it.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is zkysar1/Claude-Mind's own configuration. It tells Claude Code how to work on Claude-Mind 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 Claude-Mind configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is Bash: bash core/scripts/temp-drain-purge.sh # add --dry-run when the drain is --dry-run.

Reuse

Borrowing it

Nothing to install: this file belongs to zkysar1/Claude-Mind. 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/zkysar1/Claude-Mind/main/.claude/skills/drain-temp/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/zkysar1/Claude-Mind

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 drain-temp

README.md
[![agentmods](https://agentmods.dev/badge/skills/zkysar1/claude-mind/drain-temp/github.svg)](https://agentmods.dev/skills/zkysar1/claude-mind/drain-temp)
Your own site
<a href="https://agentmods.dev/skills/zkysar1/claude-mind/drain-temp"><img src="https://agentmods.dev/badge/skills/zkysar1/claude-mind/drain-temp/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 drain-temp

Your own site · 80×15
<a href="https://agentmods.dev/skills/zkysar1/claude-mind/drain-temp"><img src="https://agentmods.dev/badge/skills/zkysar1/claude-mind/drain-temp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 237 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,567 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: 2 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 Tool Misuse · line 163
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 340
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.00237 $0.06567
Opus 5 $0.00118 $0.03284
Sonnet 5 $0.00047 $0.01313
Haiku 4.5 $0.00024 $0.00657

Measured yesterday against content hash 00df55050d6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

drain-temp 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 yesterday.

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/drain-temp/SKILL.md · 408 lines

How it starts

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

/drain-temp — Temp Store Drain Engine

Encodes the value out of agents/<agent>/temp/ into the one long-term retrieval surface (the knowledge tree + supplementary stores), then archives each processed file to temp/drained/. This is the mechanism that makes temp/ a STAGING area rather than a slush directory: every working doc either drains into knowledge or is discarded — nothing lives in temp/ permanently.

Hybrid skill: the user invokes it ("drain temp", "encode everything in temp"); the aspirations loop invokes it when aspirations-precheck flags temp_drain_needed (temp/ accumulated past the drain threshold). Writes to the tree / reasoning bank / guardrails — requires assistant or autonomous mode.

Why this exists

A working document written to temp/ is in none of the retrieval stores until it is drained — invisible to /prime and retrieve.sh. Draining is how that knowledge becomes durable and findable. See core/config/conventions/temp-store.md.

Phase 0: Load Routing Context

Bash: load-conventions.sh temp-store learning-routing
→ Read the returned paths not already in context. learning-routing.md carries the
  "where does this learning go?" decision tree used in Phase 2 classification.

Phase 1: Enumerate Undrained Files

1. Resolve the bound agent's temp dir via the canonical path helper (never
   hardcode an agent name — _paths.sh exports AGENT_DIR for $MIND_AGENT):
   Bash: source core/scripts/_paths.sh; TEMP_DIR="$AGENT_DIR/temp"; echo "$TEMP_DIR"
2. List undrained working docs — files DIRECTLY under temp/ (NOT under drained/):
   Bash: ls -1 "$TEMP_DIR"/*.md "$TEMP_DIR"/*.json 2>/dev/null
   (drained/ is the archive subdir — never re-drain it; the glob above does not
   descend into it.)
2b. ALSO list the THIRD-CLASS residue — everything matching NEITHER the
   *.md/*.json glob above NOR Phase 1.5's ephemera suffixes:
   Bash: find "$TEMP_DIR" -maxdepth 1 -type f ! -name '.*' \
       ! -name '*.md' ! -name '*.json' ! -name '*.log' ! -name '*.txt' \
       ! -name '*.py' ! -name '*.sh' ! -name '*.err' ! -name '*.raw' \
       ! -name '*.out' ! -name '*.bak*'
   These are NOT auto-drained; CLASSIFY each one in Phase 2 alongside the docs
   (same routing table, same 3b probe where the shape is probe-able).
   WHY AT CENSUS TIME AND NOT LATER: Phase 2.5's stamp gate condemns exactly
   this population, so meeting it there means meeting it as a list of files you
   are about to DELETE. Measured twice on the same box (2026-08-27 and
   2026-08-30, echo/cc-03): both passes correctly retracted the stamp per
   guard-4864, and substantially the same five files came back — because a
   correctly-refused stamp protects them from deletion while nothing ever
   classifies them, so they can never be legitimately discharged either. Two
   correct mechanisms composing into a permanent blind spot. Retracting is safe
   and INSUFFICIENT; this step is what lets the stamp pass on merit. The 08-30
   pass classified all five in minutes and one turned out to be a working
   compile gate that existed nowhere else on the box. (rb-9792, g-001-104.)
3. IF no drainable files (.md/.json): set docs_count=0 and skip Phase 2-3, but
   STILL run Phase 1.5 — pure ephemera (.log/.txt) may need purging even when no
   docs remain (the g-115-1727 case: 7 ephemera survived a full doc-drain).
   Report "temp/ is clean" + DONE only if Phase 1.5 ALSO purges nothing.
4. IF --file <name> given: restrict the list to that one file under "$TEMP_DIR"
   and SKIP Phase 1.5 (single-file drain is a targeted op, not a full sweep).
5. Sort oldest-first (timestamped filenames sort lexically = chronologically).

Read the full file on GitHub · 408 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. yesterday Changed · +2 lines 00df55050d6e
  2. 5d ago Changed · +19 lines 05ee3125b868
  3. 9d ago First seen · 387 lines · 237 tokens per session scan A ef4a1707c966

Subscribe to this mod's changes

drain-temp is a skill published in the GitHub repository zkysar1/Claude-Mind (5 stars, last pushed yesterday), licensed MIT. It adds 237 tokens to every session and 6,567 once invoked, about $0.0012 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.