cortex-distill
Distill raw session records into refined Notes and Projects. Use when the user says "提煉", "整理 raw", "distill", or "distill raw records".
llm-wiki style broadcast ingest — conversational update of related existing pages when a Raw has been distilled. Use when the user says "broadcast", "跑 broadcast", "compound this into the vault", "merge pending-merge", "process broadcast queue", or when cortex-distill invokes
$ npx -y skills add XBlueSky/cortexes --skill cortex-broadcast --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cortex-broadcastContext preview
The summary Claude sees to decide when to auto-load this skill.
llm-wiki style broadcast ingest — conversational update of related existing pages when a Raw has been distilled. Use when the user says "broadcast", "跑 broadcast", "compound this into the vault", "merge pending-merge", "process broadcast queue", or when cortex-distill invokes
name: cortex-broadcast description: > llm-wiki style broadcast ingest — conversational update of related existing pages when a Raw has been distilled. Use when the user says "broadcast", "跑 broadcast", "compound this into the vault", "merge pending-merge", "process broadcast queue", or when cortex-distill invokes broadcast inline after Step 8 commit (automatic dispatch for every new / pending-merge Raw).
Propagate insights from a distilled Raw into related existing Notes/Projects pages through conversational per-page edits.
Read `~/.cortex/config.json`:
jq -r '.vault_path' ~/.cortex/config.json jq -r '.broadcast.target_top_n // 5' ~/.cortex/config.json jq -r '.broadcast.target_min_score // 0.40' ~/.cortex/config.json
If the config file doesn't exist, tell the user to run `/cortexes:genesis` first.
The command supports three invocations:
| Form | Action | |------|--------| | `/cortexes:broadcast` (no args) | Pop the first (oldest) Raw from the eligible queue | | `/cortexes:broadcast <raw-path>` | Use the specified Raw (relative or absolute path) | | `/cortexes:broadcast --list` | Print the eligible queue and exit |
A Raw is eligible iff its marker meets **all** of:
either a path like `Notes/X.md` / `Projects/Y/Z.md`, **or** starts with `pending-merge:`; anything else — `(skip: routine)`, `(no insight)`, or the pre-Phase-1 legacy `(no extractable content)` — is ineligible).
`| no-broadcast:`.
Build the list via:
cortex-vec broadcast-queue --root <vault>/Raw
This applies the three criteria above against each Raw's authoritative marker (header marker, or last non-empty line) and returns the result FIFO by path. Do **NOT** `grep` the marker string — a meta-session's body quotes it many times, which fools a substring scan. To inspect one file, use `cortex-vec raw-state <file>`.
If the user invoked `--list`, print each queued Raw with:
if marker contains `pending-merge:`)
Format:
Eligible queue (N Raws):
1. Raw/2026/04/17/141013_session_webapi-Notification.md
outcome: pending-merge → Projects/libsynosysnotify/synooauth flow chart.md (0.48)
2. Raw/2026/04/17/163941_session_libsynosdk.md
outcome: new → Projects/libsynosdk/build-flag-semantics.md
Run /cortexes:broadcast to process the first, or /cortexes:broadcast <path> for a specific one.Exit after listing.
If no args: pick the first entry from the queue. If `<raw-path>` arg: verify it's eligible; abort with a clear error if not.
Read:
1. The Raw's full content (frontmatter + all sections). 2. The Raw's distilled marker; parse the outcome and (for pending-merge) the original target path and score.
Pick the **most content-ful Discovery or Decision bullet** — the longest bullet with concrete referents (symbols, file paths, bug mechanisms). This is the same heuristic as cortex-distill Stage 2 uses.
Run:
cortex-vec search "<bullet text>" --n <target_top_n>
If the Raw's frontmatter has `repo:`, also pass `--repo <name>` when the query topic looks repo-specific. Omit otherwise.
Filter results to those with `score >= target_min_score`.
If `cortex-vec` ran successfully but zero results meet `score >= target_min_score`:
Announce to the user before jumping:
No candidate pages scored at or above <threshold> for this Raw. Finalizing as broadcast: (no candidates). Marker will reflect this.
If the command errors (not found, ECONNREFUSED, etc.):
1. Read `<vault>/_index.md`. 2. Use your own semantic judgment to pick up to `target_top_n` candidate pages that look related to the Raw. 3. Note `candidates_source: llm-fallback` for the log entry later.
If the Raw's outcome is `pending-merge`:
include it** as a pre-selected entry at the top, with a note `(below current threshold)`. Original distill intent overrides current threshold.
Example of the menu line in this case:
[x] 1. Projects/libsynosysnotify/synooauth flow chart.md (0.48) ← pending-merge target (below current threshold) ```` All other candidates default to unchecked `[ ]`. ## Step 7: Present Menu and Confirm Display:
Broadcast target candidates for <raw-filename>:
[x] 1. <path> (<score>) ← pending-merge target (if applicable) [ ] 2. <path> (<score>) [ ] 3. <path> (<score>) ...
Toggle: number (1–N) to flip, 'a' all, 'n' none, then Enter to confirm. Cancel: type 'quit' to abort the menu without marking the Raw (no commits have been made yet).
Read the user's toggles until they confirm. Build the final selected list. If the list is empty after confirmation, jump directly to
Personal knowledge vault plugin for Claude Code — session recording, memory distillation, and hybrid semantic + BM25 retrieval.
Repo: XBlueSky/cortexes
Distill raw session records into refined Notes and Projects. Use when the user says "提煉", "整理 raw", "distill", or "distill raw records".
Save knowledge to the cortex vault. Use when the user says "存到 cortex", "記一下", "save to cortex", "記到筆記", "cortex evolve", or when the session-suggest hook…
Search and retrieve content from the cortexes vault — the user's external memory. Use when the user explicitly asks to search or recall the vault ("查 cortex",…
Create or resume a session takeoff baton — a curated, ephemeral, git-ignored hand-off note that lets the next Claude session continue a long-running task. A…
Use when the user asks to check the cortex vault, refers to earlier work ("last time", "that project", "we discussed", "之前那個", "上次的"), asks to resume something…