cortex-distill

cortex-distill is a skill for Claude Code, Codex from XBlueSky/cortexes. It costs 41 tokens per session (4,124 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/xbluesky/cortexes/cortex-distill
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, Codex.

Or install cortexes, the plugin that ships this one along with the rest of its 6 skills, 5 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.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.svg" alt="Measured on agentmods" 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 4,124 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00041 $0.04124
Opus 5 $0.00020 $0.02062
Sonnet 5 $0.00008 $0.00825
Haiku 4.5 $0.00004 $0.00412

Measured today against content hash 216e078af7f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 today.

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 · 407 lines

How it starts

The opening of the file, as written. The whole thing — 407 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>.

Show the pending list count and ask to proceed.

Step 1.5: Schedule the Batch (only when queue > 1 file)

Size the queue before opening any Raw:

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

Partition by RAW size (the raw column) and present the plan for approval (do not auto-run):

  • Normal lane — Raws whose raw size fits well inside one session budget (default 100K chars of raw-derived output). Process a batch this session, strictly one Raw at a time.
  • Monster lane — Raws whose complete review clearly exceeds one session budget. One Raw per dedicated session; expect BUDGET_EXHAUSTED + distill-plan resume --new-session continuations.

Carry remaining lanes forward with a cortex-takeoff baton. When a plan is mid-flight, record its plan_id in the baton — machine state lives in the plan cache, the baton only points at it.

Step 2: Stage 1 — Has Insight (map-first)

One Raw at a time. NEVER Read the full Raw file; NEVER judge from an L3/L3* projection. All original text arrives through bounded pages.

  1. Start (or resume) the plan:

    cortex-vec distill-plan start <raw-file>
    

Read the full file on GitHub · 407 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. today Changed 216e078af7f1
  2. 4d 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 (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 41 tokens to every session and 4,124 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-08-30.

Related

Other skills, from other repositories

semantic-search

Code search for this repo — pick the right Beacon tool for the question: exact symbol lookup, reference tracing, file outline, or semantic search.

sagarmk/beacon-plugin · 32 tokens

rethink

Challenge system assumptions against accumulated evidence. Triages observations and tensions, detects patterns, generates proposals. The scientific method applied to knowledge systems. Triggers on "/rethink", "review observations", "challenge assumptions", "what have I learned".

agenticnotetaking/arscontexta · 51 tokens

architect

Research-backed evolution advice for your knowledge system. Analyzes health reports, friction patterns, and derivation history to propose specific changes with research justification. Never auto-implements — proposals require your approval.

agenticnotetaking/arscontexta · 42 tokens

ask

Query the bundled research knowledge graph for methodology guidance. Routes questions through a 3-tier knowledge base — WHY (research claims), HOW (guidance docs), WHAT IT LOOKS LIKE (domain examples) — plus structured reference documents. Returns research-backed answers grounded in specific claims with practical…

agenticnotetaking/arscontexta · 87 tokens

release-gatekeeper

End-to-end release validation for Connapse — the 'final boss' before any version ships. Downloads the latest alpha from GitHub Releases, deploys an isolated Docker instance (separate from production), then systematically tests every feature: UI via Playwright, API via curl/REST, MCP tools, search quality, security…

Destrayon/Connapse · 183 tokens

stats

Show vault statistics and knowledge graph metrics. Provides a shareable snapshot of vault health, growth, and progress. Triggers on "/stats", "vault stats", "show metrics", "how big is my vault".

agenticnotetaking/arscontexta · 45 tokens