cortex-distill

cortex-distill is a skill for Claude Code from XBlueSky/cortexes. It costs 41 tokens per session (5,164 once invoked), scanned A, original, Apache-2.0.

A skill for turning raw session records into organised notes and project documents. It uses a personal vault, which is a folder for storing and retrieving knowledge.

In plain words
What is it for?
Finding unprocessed records, planning batches, extracting useful knowledge, writing notes or projects, and updating the vault index.
Why use it?
It removes the need to manually sort useful information from long session logs and helps track which records have already been processed.

Skill for Claude Code

Written for Claude Code: SessionEnd hook event. Also seen: names the AskUserQuestion tool; positional $N argument; mentions Claude Code.

Part of the cortexes plugin — 6 skills, 6 commands, 2 hooks shipped together

Good fit Finding unprocessed records, planning batches, extracting useful knowledge, writing notes or projects, and updating the vault index.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xbluesky/cortexes/cortex-distill
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 XBlueSky/cortexes --skill cortex-distill
Clone the repo
git clone --depth 1 https://github.com/XBlueSky/cortexes

Made for: Claude Code.

Or install cortexes, the plugin that ships this one along with the rest of its 6 skills, 6 commands, 2 hooks.

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 cortex-distill

README.md
[![agentmods](https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-distill/github.svg)](https://agentmods.dev/skills/xbluesky/cortexes/cortex-distill)
Your own site
<a href="https://agentmods.dev/skills/xbluesky/cortexes/cortex-distill"><img src="https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-distill/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 cortex-distill

Your own site · 80×15
<a href="https://agentmods.dev/skills/xbluesky/cortexes/cortex-distill"><img src="https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-distill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,164 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 Prompt Injection · line 26
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Anti-Refusal · line 59
    Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
    Fix: Remove instructions that suppress warnings, disclaimers, or ethical commentary. Let the agent surface safety-relevant caveats to the user.
  • medium Excessive Agency · line 370
    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.00041 $0.05164
Opus 5.5 $0.00016 $0.02066
Sonnet 5.5 $0.00008 $0.01033
Haiku 4.5 $0.00004 $0.00516

Measured 28d ago against content hash 32755ab1b976, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cortex-distill 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 28d 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/cortex-distill/SKILL.md · 481 lines

How it starts

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

Cortex Distill — Refine Raw Records

Extract valuable knowledge from Raw/ session dumps into Notes/ and Projects/.

Resolve Vault Path

Read ~/.cortex/config.json to get vault_path. If the file doesn't exist, tell the user to run /cortexes:genesis first.

Step 1: Find Unprocessed Raw Files

List the distill queue:

cortex-vec distill-queue --root <vault_path>/Raw

This is position-anchored: a Raw counts as distilled only if a <!-- distilled: ... --> marker appears in its header (before the first ### User turn) or as its last non-empty line. Do NOT grep the marker string — a pipeline meta-session's body quotes it dozens of times (it printfs markers onto other files), so grep -rL '<!-- distilled:' silently drops genuine work from the queue. To check one file, use cortex-vec raw-state <file>.

Backlog hygiene (only when queue > 1 file)

SessionEnd reclaims the prefix snapshots of the Raw it has just written (reclaim-superseded --keep <that-file>), but it never looks at an existing backlog. Before sizing the batch, run the pairwise form once — no --keep — so strict-prefix duplicates leave the queue:

cortex-vec reclaim-superseded --root <vault_path>/Raw                       # list only
cortex-vec reclaim-superseded --root <vault_path>/Raw --apply --vault <vault_path>

Applying is safe: a candidate is removed only when it is a line-for-line prefix of a longer queued recording, so no content is lost.

That tool does NOT catch a second class of duplicate: the same transcript captured twice whose filter output diverged (the residue classifier is not deterministic — one copy kept a /context table, the other a Log Summary). Neither copy is a prefix of the other, and the two files may carry different repo: labels or even different dates. What they share is raw_bytes in the audit line — the size of the source transcript — so scan for collisions and treat each group as a triage hint, never as a deletion list:

Read the full file on GitHub · 481 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. 28d ago Changed · +74 lines 32755ab1b976
  2. 1mo ago Changed 216e078af7f1
  3. 1mo ago First seen · 407 lines · 41 tokens per session scan A 617df3e7dc8c

Subscribe to this mod's changes

cortex-distill is a skill published in the GitHub repository XBlueSky/cortexes (24 stars, last pushed 29d ago), licensed Apache-2.0. It adds 41 tokens to every session and 5,164 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other skills, from other repositories

llm-wiki

Build and maintain an LLM-curated knowledge base from papers, articles, transcripts, notes and project findings. Ingest sources into linked Markdown, answer questions with citations, lint or upgrade a wiki, and preserve useful synthesis across sessions and agents. Also capture verified task experience, consolidate…

praneybehl/llm-wiki-plugin · 130 tokens

setup

Set up and verify a first memtomem memory source. Use for onboarding, choosing an index path, or confirming that search works.

memtomem/memtomem · 29 tokens

status

Check memtomem configuration, storage, index counts, dense coverage, and warnings. Use when search is empty, degraded, or needs diagnosis.

memtomem/memtomem · 31 tokens

orient

Use when user invokes /orient with a topic keyword, entity type, project name, time qualifier, or combination. Also triggers on "what do we know about X", "remind me about X", "where did we leave off on X". Provides targeted context loading — searches the MCP Memory Server graph, knowledge files, journal entries, and…

harnessprotocol/harness-kit · 80 tokens

garden-tending

Tend the knowledge garden — diagnose vault health, condense project memos into project.md overviews, create/merge cross-project topics, fix broken links, archive superseded notes, extend trails. Trigger on "tend the garden", "condense", "update project overview", "check vault health", "where are we with X?", "what…

linxule/memex-plugin · 131 tokens

memory

Use when user invokes /memory with a subcommand (search, trace, add, episode, status). Also triggers on "search my memory for X", "add to memory", "what do I know about X" (when membrain is available), "memory status", "memory trace". Searches and manages the membrain knowledge graph via MCP tools or HTTP API.

harnessprotocol/harness-kit · 76 tokens