Personal knowledge vault plugin for Claude Code — session recording, memory distillation, and hybrid semantic + BM25 retrieval.
Auto-invoked ships a router so the right skill fires automatically as you prompt. No remembering which skill to call.
Normal is the plain upstream plugin, installed as-is. You invoke its skills yourself.
The plugin> /plugin marketplace add XBlueSky/cortexes> /plugin install cortexes@cortexAuto-invocation> /plugin marketplace add flowy-sh/flowy-core> /plugin install flowy-core> /plugin install flowy-cortex
Repo: XBlueSky/cortexes
What's inside
Cortexes turns your working memory into a searchable knowledge base. Every Claude Code session gets automatically recorded when it ends, then can be distilled and retrieved later.
Design philosophy: the vault is the source of truth (plain markdown + git); the vector store is just a rebuildable derived index.
# Add the marketplace, then install the plugin from it
/plugin marketplace add https://github.com/XBlueSky/cortexes.git#plugin
/plugin install cortexes@cortex
The marketplace is named cortex and the plugin inside it is cortexes —
hence cortexes@cortex. The marketplace name is kept from 1.x on purpose so
that existing marketplace add registrations keep working.
The CLI is published on PyPI as
cortex-vec:
# Recommended: isolated tool install via uv
uv tool install cortex-vec
# Or with pip
pip install cortex-vec
Upgrade with uv tool upgrade cortex-vec (or pip install -U cortex-vec)
after a plugin update. /cortexes:genesis checks for the CLI and offers this
install when it is missing. To run the unreleased development version
instead, install from the repo:
uv tool install "git+https://github.com/XBlueSky/cortexes.git@plugin#subdirectory=cortex-vec"
OPENAI_API_KEY is optional. Setting it enables embeddings, and with
them semantic (vector) search. Without it nothing breaks: search runs on
the local BM25 index, entirely on your machine and with nothing sent to
OpenAI — see Environment Variables.
/cortexes:genesis /path/to/your/vault
This sets the vault path and author info, and builds the semantic index.
"save to cortex" → manually save knowledge
"check cortex" → semantic search over the vault
"distill" → extract knowledge from Raw/
"broadcast" → fuse new Raw content into existing pages
2.0.0 renames the plugin from cortex to cortexes. Your vault, config
and indexes are untouched — there is no data migration.
Update the marketplace. In Claude Code run
/plugin marketplace update cortex (or remove and re-add it).
Start a new session. The marketplace manifest ships a renames
mapping (cortex → cortexes), so the rename is carried for you: the
update re-points your enabled plugin at cortexes@cortex, and the next
session start materializes it at 2.0.0. You do not need to uninstall
and reinstall. In between the two steps /plugin may still list the old
cortex row annotated Renamed to "cortexes" in the "cortex" marketplace — that is the migration staged, not an error. If you ever do
reinstall from scratch, the id is /plugin install cortexes@cortex.
Use the new command prefix. /cortex:* no longer resolves; every
command moved to /cortexes:* (/cortexes:genesis, /cortexes:evolve,
/cortexes:distill, /cortexes:query, /cortexes:broadcast,
/cortexes:takeoff). Natural-language triggers are unchanged — "存到
cortex" and "查 cortex" still work.
If your vault has a Weekly/ directory, move what you still want.
Weekly/ is no longer part of the vault taxonomy: 2.0 does not create it,
index it, search it, or list it. It was already unreachable — the weekly
report skill went in 0.22.0 and Weekly/ left the index back in 0.5.0 —
so this changes nothing about what you can find. Cortexes will not
move, rewrite, or delete an existing Weekly/; copy anything still worth
keeping into Notes/ or Projects/ yourself, at your own pace, and
whatever you leave stays where it is.
Upgrade the CLI too.
uv tool upgrade cortex-vec # or: pip install -U cortex-vec
cortex-vec 0.9.0 is the version this plugin release ships against. 0.8.0
is what carried the Weekly removal into the CLI — --type weekly is gone
from search --help and Weekly/ is no longer classified as a content
type — and 0.9.0 adds the cosine backfill and the retrieval-filter fixes
that 2.1.0's dedup and scoped search depend on. Older CLIs keep working,
but a scoped search on one still leaks out-of-scope pages and a
keyword-only hit still reports 0.00.
Nothing else changes. ~/.cortex/config.json, the vector/BM25 indexes
and caches, and the CORTEX_* environment variables all keep their names
and paths. No rebuild, no re-index, no config edit.
Live docs and changelog: https://cortexes.pages.dev (Cloudflare Pages,
generated from .cc-marketspec/dist/manifest.json).
See site/README.md for local builds.
| Command | Description |
|---|---|
/cortexes:genesis | Initialize the vault — set path, author, rebuild the index |
/cortexes:evolve | Manually save knowledge to Notes or Projects (also writes log.md) |
/cortexes:distill | Distill Raw/ session records into Notes/Projects (map-first navigation + two-stage evaluation + pending-merge exit) |
/cortexes:query | Search the vault — semantic (cortex-vec) with grep and BM25 fallbacks. Running it counts as an explicit request, so it searches even when the session opted out |
/cortexes:broadcast | Fuse newly distilled content into related existing pages (llm-wiki-style ingest) |
/cortexes:takeoff | Hand-off batons — curate temporary, non-git hand-offs for a later session to resume, one per work line ([topic] / resume [topic] / done [topic] subcommands) |
| Skill | Trigger |
|---|---|
| cortex-evolve | "save to cortex", "note this down", "remember this" |
| cortex-distill | "distill", "clean up raw", "distill raw records" |
| cortex-broadcast | "broadcast", "merge pending-merge", "fuse this into the vault" |
| cortex-takeoff | "hand off", "takeoff", "hand off to next session", "context is running low" |
| cortex-query | "check cortex", "have I noted this before", "is this in cortex" |
| Hook | Event | Behavior |
|---|---|---|
| Session Report | SessionEnd | On session end, filters the transcript through a TOML pipeline before writing to Raw/ |
| Memory Injection | SessionStart | Interactive menu — checks vault backlog status and asks what to do next |
Recording is automatic. Every session over 4 KB is written to your vault when it ends — there is no per-session prompt. Set
CORTEX_SKIP_RECORD=1to skip a session, and seePRIVACY.mdfor exactly what is captured, what is excluded, and what (if anything) leaves your machine.
Before writing to Raw/, the SessionEnd hook runs a TOML-driven filter pipeline that
strips tool output with no knowledge value (e.g. ls, volume listings,
repetitive build logs) — you can write custom filters per slash command so
what lands in Raw/ actually carries signal.
cortex repo
├── plugin branch (orphan) ← the Claude Code plugin (this file lives here)
└── main branch ← Obsidian vault data
~/.cortex/
├── config.json ← settings produced by genesis
└── vectorstore/ ← ChromaDB semantic index (local only, not in git)
Raw/YYYY/MM/DD/ ← session dumps (complete, distilled on demand)
Notes/<category>/ ← distilled technical knowledge
Projects/<repo-name>/ ← project notes organized by repo
_index.md ← vault-wide summary index
log.md ← chronological history of evolve/distill
Nothing machine-checks _index.md for consistency (reorganizing pages is the
one path that changes the index with no skill involved). See
docs/index-audit.md for the audit, and for the regex
traps that let a naive check pass while reporting the wrong set.
Every session:
SessionStart → surfaces available memory → user decides whether to load it
...work happens...
session ends → SessionEnd hook → filter → Raw/ (automatic, no prompt)
Anytime:
/cortexes:evolve → Notes/Projects + _index.md + log.md + vector store
/cortexes:query → vector search → precise file reads
Periodically:
/cortexes:distill → Raw → Notes/Projects (+ pending-merge → broadcast)
/cortexes:broadcast → pending-merge → fused into existing Notes/Projects
Hybrid retrieval (0.4.0+) — BM25 + vector dual streams, fused with Reciprocal Rank Fusion (RRF, k=60), default weights w_bm25=0.4 / w_vec=0.6:
~/.cortex/bm25/, kept in sync with ChromaDB by
rebuild/upsert/delete.text-embedding-3-small semantic search,
dual-vector (document body + bilingual summary), covering cases that are
semantically close but lexically different.OPENAI_API_KEY, or offline, this
automatically falls back to BM25-only, with no dependency on the
skill-layer grep fallback.Other layers:
The vault's semantic indexing tool, built on ChromaDB + OpenAI
text-embedding-3-small, paired with gpt-5.4-mini to generate a bilingual
summary as a second embedding (dual-vector) to improve recall for mixed
Chinese/English queries.
cortex-vec status # view index status
cortex-vec rebuild # full index rebuild
cortex-vec search "nginx certificate" # semantic search
cortex-vec search "oauth" --repo acme-core # filter by repo (narrows Projects/ only; Notes/ always pass)
cortex-vec search "sharing" --type project # filter by type
cortex-vec upsert Notes/Nginx/new.md # add/update a single document
cortex-vec delete Notes/Nginx/old.md # delete a document
cortex-vec search now defaults to BM25 + vector RRF hybrid, balancing exact
lexical matches with semantic similarity:
FAQ
cortexes is a Claude Code plugin of 6 hand-picked skills with a FLOW.md router. Install it once and the right skill fires as you prompt, with no slash command to remember. It is built for productivity work. It includes cortex-broadcast, cortex-distill, cortex-evolve. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it