Skip to content

/query

Manually search the cortex vault (Notes, Projects, Raw) for existing notes

From plugin
cortexes
256 skills6 commands2 hooks
> /plugin marketplace add XBlueSky/cortexes
> /plugin install cortexes@cortex

Command definition

query.md
name: query
description: Manually search the cortex vault (Notes, Projects, Raw) for existing notes
argument-hint: "[what to search for]"
disable-model-invocation: true
allowed-tools:
  - Read
  - Glob
  - Grep
  - Bash(cortex-vec search:*)
  - Bash(grep:*)
  - Bash(git rev-parse:*)
  - Bash(git remote get-url:*)

Invoke the `cortexes:cortex-query` skill and follow it for the actual search. Command frontmatter cannot load a skill for you, so invoke it explicitly with its fully qualified name via the Skill tool.

Argument handling:

  • With arguments → treat `$ARGUMENTS` as the search query verbatim. Do not

reword or narrow it; the user's phrasing is the query.

  • No arguments → ask the user what to search for, then run the search with

their answer. Do not guess a query from the conversation, and do not search the whole vault "to see what's there".

This command is user-invoked only (`disable-model-invocation: true`), so running it **is** the user's explicit request — using-cortex signal 1. Search even if the session earlier picked "直接開始工作" at SessionStart.

Follow the skill's layered strategy: `cortex-vec search` first (repo-scoped by default inside a git repo, overridable with "search all"), exact-match search as the supplement, and `Raw/` only on request. Present results in the skill's response format, and read a full page only when the user picks one.

This command pre-approves only what the search itself runs — `cortex-vec search`, `grep`, and the two read-only `git` calls used to detect the repo — rather than shell access in general. Each entry is scoped to the subcommand: `git remote get-url`, not `git remote`, which would also cover `add`, `remove`, `rename` and `set-url` — write operations a read-only search has no business pre-approving. `cortex-vec status` is deliberately absent; the search flow never calls it. `grep` is on the list because the vault usually sits outside the session's working directory, where the Grep tool cannot reach.

Scoped Bash does not escape the workspace boundary the way a blanket `Bash` approval did. `cortex-vec search` is unaffected (it takes no path argument), so the normal path still works; only the grep fallback needs the vault to be inside the working directory or added with `/add-dir <vault_path>`. If that bites, say so explicitly rather than reporting an empty result.

If `cortex-vec` is not installed, say so and fall back to grep rather than failing. Semantic scoring needs `OPENAI_API_KEY`; without it `cortex-vec` degrades to its local BM25 index on its own, which is still a real search — report the degraded mode, don't call retrieval unavailable.

Read more
@xbluesky
Ships withcortexes

Personal knowledge vault plugin for Claude Code — session recording, memory distillation, and hybrid semantic + BM25 retrieval.

Stars on GitHub

Momentum

stars in total
25
Star history of XBlueSky/cortexes on GitHub, a chart by star-history.com

Other commands on cortexes.

broadcast
Auto-invoked

broadcast

Command

Run broadcast on a distilled Raw — update related existing pages conversationally

@xbluesky@xblueskyInstall Command
distill
Auto-invoked

distill

Command

Distill raw session records into refined Notes and Projects

@xbluesky@xblueskyInstall Command
evolve
Auto-invoked

evolve

Command

Save knowledge to the cortex vault (Notes or Projects) and update index

@xbluesky@xblueskyInstall Command
genesis
Auto-invoked

genesis

Command

Initialize cortex vault — set up config, vault structure, and rebuild index

@xbluesky@xblueskyInstall Command
takeoff
Auto-invoked

takeoff

Command

Create, resume, or clear a session hand-off baton (one per work line)

@xbluesky@xblueskyInstall Command

More commands from other plugins.

analyze-cohorts

analyze-cohorts

Command

Perform cohort analysis on user data — retention curves, feature adoption, and engagement trends

@phuryn@phurynInstall Command
again

again

Command

PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。

pua2mo20k
@tanweai@tanweaiInstall Command