cortex-distill

cortex-distill is a skill for Claude Code from XBlueSky/cortexes. It costs 41 tokens per session (5,269 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,269 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.05269
Opus 5.5 $0.00016 $0.02108
Sonnet 5.5 $0.00008 $0.01054
Haiku 4.5 $0.00004 $0.00527

Measured 14d ago against content hash 4fd2528b3f2d, 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 14d 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 · 488 lines

How it starts

The opening of the file, as written. The whole thing — 488 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 · 488 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. 14d ago Changed · +7 lines 4fd2528b3f2d
  2. 2mo ago Changed · +74 lines 32755ab1b976
  3. 3mo ago Changed 216e078af7f1
  4. 3mo 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 (26 stars, last pushed 3d ago), licensed Apache-2.0. It adds 41 tokens to every session and 5,269 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

cortex-distill compared with skills from other repositories

cortex-distill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cortex-distillXBlueSky/cortexesSkill263d agoApache-2.0A41Claude Code
llm-wikipraneybehl/llm-wiki-pluginSkill1301mo agoMITA143Claude Code
orientharnessprotocol/harness-kitSkill13yesterdayApache-2.0A80Claude Code
memoryharnessprotocol/harness-kitSkill13yesterdayApache-2.0A76Claude Code
captureharnessprotocol/harness-kitSkill13yesterdayApache-2.0A73Claude Code
garden-tendinglinxule/memex-pluginSkill74d agoMITA131Claude Code
rostam-memoryrostamlabs/rostamSkill377d agoApache-2.0A47Claude Code