cortex-query

cortex-query is a skill for Claude Code from XBlueSky/cortexes. It costs 125 tokens per session (2,114 once invoked), scanned A, original, Apache-2.0.

A search tool for finding and retrieving information from Cortex, an external personal memory made up of stored notes and project pages.

In plain words
What is it for?
Use it when checking what was previously recorded about a project, tool, or topic. It supports semantic searches and can return likely matching notes from the vault.
Why use it?
It helps recover earlier decisions or information without manually opening and reading the whole notes collection. Searches can be narrowed by the current repository, content type, or category.

Skill for Claude Code

Written for Claude Code: SessionStart hook event.

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

Good fit Use it when checking what was previously recorded about a project, tool, or topic. It supports semantic searches and can return likely matching notes from the vault.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xbluesky/cortexes/cortex-query
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-query
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-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-query/github.svg)](https://agentmods.dev/skills/xbluesky/cortexes/cortex-query)
Your own site
<a href="https://agentmods.dev/skills/xbluesky/cortexes/cortex-query"><img src="https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-query/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-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/xbluesky/cortexes/cortex-query"><img src="https://agentmods.dev/badge/skills/xbluesky/cortexes/cortex-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,114 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: 1 finding, up to medium

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 →

  • medium Rogue Agent · line 7
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
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.00125 $0.02114
Opus 5.5 $0.00050 $0.00846
Sonnet 5.5 $0.00025 $0.00423
Haiku 4.5 $0.00013 $0.00211

Measured 28d ago against content hash cd6a4e83690c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cortex-query 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 28d 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-query/SKILL.md · 199 lines

How it starts

The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cortex Query — Search the Vault

Search the cortexes Obsidian vault using semantic search.

When to Run This Skill

Run it in exactly two cases:

  1. The user explicitly asks. "查 cortex", "之前有記過嗎", "cortex 裡有沒有", "check my notes", "what did I write about X", or the /cortexes:query command. An explicit request is always sufficient on its own.
  2. using-cortex routes the request here after one of its four concrete signals fired (explicit request, reference to prior work, a topic the SessionStart hook actually listed, or resuming a previous session). That skill owns the decision; this one owns the search.

Do not run it

  • For general questions, or for fresh work with no prior-context signal.
  • Because a question is difficult, technical, open-ended, or touches infrastructure or internal tooling. Difficulty is not a signal.
  • When the user picked option 4 ("直接開始工作") from the SessionStart menu, skipped the menu, or said "don't check cortex" — that opt-out holds for the rest of the session until the user explicitly asks (case 1).
  • When the conversation, the current repo, or the current turn already supplies the answer.

An unprompted search costs the user tokens and latency, and unrelated notes pollute the answer. When no case applies, answer directly and do not mention the vault.

Resolve Vault Path

Read ~/.cortex/config.json and take vault_path. If the file is missing or has no usable vault_path, tell the user to run /cortexes:genesis first.

Do not read CORTEX_VAULT_PATH here. Only the SessionStart injection script and the takeoff.sh helper honour it; the write side — the SessionEnd recorder, evolve, distill, broadcast — resolves the vault from config.json alone, and the BM25/vector indexes live at a single fixed ~/.cortex/ location regardless. Honouring it on the read side would split reads and writes across two vaults while both shared one index. config.json is the one source of truth until a real multi-vault design lands.

Read the full file on GitHub · 199 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. 28d ago Changed · +14 lines cd6a4e83690c
  2. 1mo ago Changed · +88 lines · -32 tokens per session d56c405cc254
  3. 1mo ago First seen · 97 lines · 157 tokens per session scan A c7e216924da6

Subscribe to this mod's changes

cortex-query is a skill published in the GitHub repository XBlueSky/cortexes (24 stars, last pushed 29d ago), licensed Apache-2.0. It adds 125 tokens to every session and 2,114 once invoked, about $0.0005 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

Other skills, from other repositories

llm-wiki

Build and maintain an LLM-curated knowledge base from papers, articles, transcripts, notes and project findings. Ingest sources into linked Markdown, answer questions with citations, lint or upgrade a wiki, and preserve useful synthesis across sessions and agents. Also capture verified task experience, consolidate…

praneybehl/llm-wiki-plugin · 130 tokens

setup

Set up and verify a first memtomem memory source. Use for onboarding, choosing an index path, or confirming that search works.

memtomem/memtomem · 29 tokens

status

Check memtomem configuration, storage, index counts, dense coverage, and warnings. Use when search is empty, degraded, or needs diagnosis.

memtomem/memtomem · 31 tokens

orient

Use when user invokes /orient with a topic keyword, entity type, project name, time qualifier, or combination. Also triggers on "what do we know about X", "remind me about X", "where did we leave off on X". Provides targeted context loading — searches the MCP Memory Server graph, knowledge files, journal entries, and…

harnessprotocol/harness-kit · 80 tokens

garden-tending

Tend the knowledge garden — diagnose vault health, condense project memos into project.md overviews, create/merge cross-project topics, fix broken links, archive superseded notes, extend trails. Trigger on "tend the garden", "condense", "update project overview", "check vault health", "where are we with X?", "what…

linxule/memex-plugin · 131 tokens

memory

Use when user invokes /memory with a subcommand (search, trace, add, episode, status). Also triggers on "search my memory for X", "add to memory", "what do I know about X" (when membrain is available), "memory status", "memory trace". Searches and manages the membrain knowledge graph via MCP tools or HTTP API.

harnessprotocol/harness-kit · 76 tokens