cortex-query
Search, browse, and export your Knowledge Cortex flat files.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "cortex-query"
description: "Search, browse, and export your Knowledge Cortex flat files."
license: "MIT"
---
# Knowledge Cortex — Query
Search, browse, and export your Knowledge Cortex flat files.
## When invoked
Read `{skill_path}/references/file-schema.md` for the storage format.
## Commands
| What user says | Action |
|----------------|--------|
| "cortex stats" | Show knowledge base stats |
| "cortex search QUERY" | Search across all records |
| "cortex client DOMAIN" | Full dossier for a client |
| "cortex contacts [filter]" | List contacts |
| "cortex export TYPE" | Export contacts, clients, knowledge, or comms |
| "cortex prune" | Remove low-value records |
## Usage
```bash
python3 {skill_path}/scripts/cortex-query.py stats
python3 {skill_path}/scripts/cortex-query.py search "QUERY"
python3 {skill_path}/scripts/cortex-query.py client domain.com
python3 {skill_path}/scripts/cortex-query.py contacts [filter]
python3 {skill_path}/scripts/cortex-query.py export contacts --format csv
python3 {skill_path}/scripts/cortex-query.py export knowledge --format json
python3 {skill_path}/scripts/cortex-query.py prune --dry-run
python3 {skill_path}/scripts/cortex-query.py prune
```
Print output directly to the user.
## Environment
| Variable | Default | Purpose |
|----------|---------|---------|
| `CORTEX_DIR` | `~/.cortex` | Storage root |
## References
- File schemas: `{skill_path}/references/file-schema.md`More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

