cortex-query

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 CodeCodex

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-query
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, Codex.

Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 756 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.00157 $0.00756
Opus 5 $0.00078 $0.00378
Sonnet 5 $0.00031 $0.00151
Haiku 4.5 $0.00016 $0.00076

Measured 2d ago against content hash c7e216924da6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 97 lines

How it starts

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

Cortex Query — Search the Vault

Search the cortex Obsidian vault using semantic search.

Resolve Vault Path

Read ~/.cortex/config.json to get vault_path. If the file doesn't exist, tell the user to run /cortex:genesis first.

Search Strategy (Layered)

Layer 1: Vector Search (primary)

Use cortex-vec for semantic search:

cortex-vec search "<query>" --n 5

cortex-vec is installed as a CLI tool (from PyPI via uv tool install cortex-vec or pip — see the README's Quick Start; /cortex:genesis offers the install when it is missing).

Context-aware filtering: If the current session is inside a git repo, detect the repo name and add --repo filter as default scope:

cortex-vec search "<query>" --repo <detected-repo> --n 5

The user can override this by saying "search all" or "search across everything".

Additional filters: Apply when the user specifies:

  • --type note|project|weekly — filter by content type
  • --category Nginx|Linux|... — filter by category

Interpreting scores:

  • Score > 0.80: High confidence match — present prominently
  • Score 0.60-0.80: Possible match — present as suggestions
  • Score < 0.60: Weak match — mention only if nothing better found

Layer 2: Exact Match (supplement)

If Layer 1 returns no strong results (all scores < 0.60), or if the user is searching for an exact string (command, config path, error message):

grep -ri "<query>" <vault_path>/Notes/ <vault_path>/Projects/

Show matching files with brief excerpts.

Layer 3: Raw Search (archive, on request)

Only when the user specifically asks about recent sessions or raw data:

grep -ri "<query>" <vault_path>/Raw/

Show matches with date and repo context.

Response Format

Present results to the user:

Found N results for "<query>":

1. [score] Title (Type, Category/Repo)
   → one-line summary

2. [score] Title (Type, Category/Repo)
   → one-line summary
  • Use wikilink format when referencing notes: [[note-name]]
  • If multiple matches, list them and ask which one to read
  • If user wants details → read the full file
  • For Weekly entries, show the date and summary line

Read the full file on GitHub · 97 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. 2d 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 (20 stars, last pushed 26d ago), licensed Apache-2.0. It adds 157 tokens to every session and 756 once invoked, about $0.0008 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

vera

Code search over the current repository. Before reading files to answer "where is X", "how does Y work", "find Z", or "what calls W", run vera search " " or vera references first. Use vera grep for exact strings and regex, vera structural for definitions, routes, and env reads. Do not read multiple files hoping to…

VeraTools/Vera · 96 tokens

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

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

create-tickets

Batch-create GitHub issues from a brainstorming discussion. Decomposes ideas into properly-sized tickets with labels, milestones, and project board placement. Trigger when user says: create tickets, make tickets, turn ideas into issues, create issues from brainstorm, create issues from discussion, batch create issues.

Destrayon/Connapse · 62 tokens

discover-work

Deep research across codebase, GitHub issues, discussions, project board, and architecture docs to discover new tasks, gaps, technical debt, and improvement ideas. Trigger when user says: discover work, find tasks, what needs doing, audit codebase, find gaps, technical debt audit, backlog discovery, brainstorm tasks…

Destrayon/Connapse · 77 tokens

next-task

Recommend the best next task to work on based on open GitHub issues. Analyzes priority, dependencies, milestone urgency, and codebase readiness. Trigger when user asks: what should I work on, what is next, next task, pick a task, what to do next, suggest work, prioritize tasks.

Destrayon/Connapse · 66 tokens