Automated summary
Cortex is a persistent cognitive layer for Claude Code that stores, queries, and reasons about memories across sessions.
Strengths
- Persistent memory across Claude Code sessions
- Simple command-line interface with visual feedback
- Deep reasoning capabilities (reflection, inference) beyond simple memorization
- Export memories as JSON or Markdown
Limitations
- API costs associated with reasoning operations (approximately $0.01 per reflection)
- Requires the Cortex MCP server to be configured
- Memory consolidation can be expensive ($0.02)
Use Cortex when working on complex projects where contextual memory and cross-session learnings are vital for productivity.
Avoid Cortex for simple, one-off tasks where cross-session memory is unnecessary, to save on API costs.
Security analysis
SafeThe skill only instructs the use of MCP memory tools (cortex__query, cortex__reflect, etc.) and reads/writes local files in ~/.claude/memory/. There are no destructive operations, no remote code execution, no exfiltration of secrets, and no obfuscated payloads.
No concerns found
How this analysis is madeExamples
What did I do last time in this project?Remember: always validate JWT tokens before processing requests.How does the caching mechanism connect to the authentication system?Cortex - Claude's Cognitive Layer
Metadata
name: cortex description: Cross-session memory with deep reasoning - query, reflect, learn, consolidate version: 2.0.0 triggers:
- /cortex
- memory
- remember
- what did I do
- past sessions
- learnings
Overview
Cortex provides persistent memory across Claude Code sessions. This skill exposes the Cortex MCP tools as user-friendly commands with visual feedback.
Commands
| Command | Description | Cost |
|---------|-------------|------|
| /cortex | Show status and available commands | Free |
| /cortex help | Show detailed help with examples | Free |
| /cortex query <search> | Search stored memories | ~$0.001 |
| /cortex recall | Get context-aware memories for current task | ~$0.001 |
| /cortex reflect <topic> | Deep meta-cognitive analysis | ~$0.01 |
| /cortex infer <concepts> | Find connections between ideas | ~$0.01 |
| /cortex learn <insight> | Store a new learning | ~$0.01 |
| /cortex consolidate | Clean up and organize memories | ~$0.02 |
| /cortex stats | Show memory counts and API costs | Free |
| /cortex health | Verify all systems are working | Free |
| /cortex log | View recent activity log | Free |
| /cortex config | View/edit configuration | Free |
| /cortex export [format] | Export memories (json/md) | Free |
| /cortex session | Show current session summary | Free |
Visual Feedback
When Cortex processes, display neural activity:
╭──────────────────────────────────╮
│ 🧠 CORTEX ══════════════════════│
│ · ∿ · ∿ · ∿ · │
│ ◇━━━◇━━━◇ ◆━━━◆━━━◆ │
│ Haiku Sonnet │
│ querying... │
╰──────────────────────────────────╯
Instructions
When the user invokes /cortex or asks about memories/past sessions:
0. Help Command (/cortex help)
Display comprehensive help with groupings:
╭─────────────────────────────────────────────────╮
│ 🧠 CORTEX v2.0 - Claude's Memory Layer │
├─────────────────────────────────────────────────┤
│ QUICK │
│ /cortex Status overview │
│ /cortex help This screen │
│ /cortex stats Memory counts & costs │
│ /cortex health Verify everything works │
│ │
│ MEMORY (Haiku - fast, ~$0.001) │
│ /cortex query "X" Search memories │
│ /cortex recall Context retrieval │
│ │
│ REASONING (Sonnet - deep, ~$0.01) │
│ /cortex reflect "X" Meta-analysis │
│ /cortex infer A B Find connections │
│ /cortex learn "X" Store insight │
│ /cortex consolidate Clean up │
│ │
│ UTILITIES │
│ /cortex log Recent activity │
│ /cortex config View/edit settings │
│ /cortex export Export memories │
│ /cortex session Current session info │
│ │
│ NATURAL LANGUAGE │
│ "What did I do last time?" │
│ "Remember: always validate JWT first" │
│ "What patterns am I seeing?" │
│ "How does X connect to Y?" │
╰─────────────────────────────────────────────────╯
1. Status Command (/cortex or /cortex status)
Display current Cortex status:
╭─────────────────────────────────────────────╮
│ 🧠 CORTEX STATUS │
├─────────────────────────────────────────────┤
│ MCP Server: ✓ Connected │
│ Memories: 127 total │
│ • Skills: 23 │
│ • Patterns: 34 │
│ • Learnings: 45 │
│ • Insights: 25 │
│ Last Activity: 2 hours ago │
│ Session Cost: $0.02 │
╰─────────────────────────────────────────────╯
To get this data:
- Count lines in
~/.claude/memory/data/memories/*.jsonl - Check
~/.claude/memory/logs/for last activity - Read stats from MCP server if available
2. Query Command (/cortex query <search>)
╭──────────────────────────────────────╮
│ 🧠 CORTEX ═══════════════════════ │
│ · ∿ · ∿ · │
│ ◇━━━◇━━━◇ Haiku searching... │
╰──────────────────────────────────────╯
Use the cortex__query MCP tool with the search term.
Display results with relevance scores.
3. Reflect Command (/cortex reflect <topic>)
╭──────────────────────────────────────╮
│ 🧠 CORTEX ═══════════════════════ │
│ · ∿ · ∿ · │
│ ◆━━━◆━━━◆ Sonnet thinking...│
╰──────────────────────────────────────╯
Use the cortex__reflect MCP tool. This uses Sonnet for deep reasoning.
Include depth parameter: quick (512 tokens), moderate (1024), deep (2048).
4. Learn Command (/cortex learn <insight>)
╭──────────────────────────────────────╮
│ 🧠 CORTEX ═══════════════════════ │
│ · ∿ · ∿ · │
│ ◆━━━◆━━━◆ Sonnet analyzing..│
╰──────────────────────────────────────╯
Use the cortex__learn MCP tool to store the insight.
Report quality score and whether it was stored.
5. Stats Command (/cortex stats)
Read and display:
- Memory file sizes and counts
- API token usage from server stats
- Estimated costs (Haiku: $0.25/1M, Sonnet: $3/1M)
╭─────────────────────────────────────────────╮
│ 🧠 CORTEX STATS │
├─────────────────────────────────────────────┤
│ MEMORIES │
│ Skills: 23 entries (12 KB) │
│ Patterns: 34 entries (8 KB) │
│ Learnings: 45 entries (15 KB) │
│ Insights: 25 entries (6 KB) │
│ ───────────────────────────────── │
│ Total: 127 entries (41 KB) │
├─────────────────────────────────────────────┤
│ API USAGE (This Session) │
│ Haiku: 1,234 tokens ~$0.0003 │
│ Sonnet: 5,678 tokens ~$0.017 │
│ ───────────────────────────────── │
│ Total Cost: ~$0.02 │
╰─────────────────────────────────────────────╯
6. Health Command (/cortex health)
Run comprehensive health check:
╭─────────────────────────────────────────────────╮
│ 🧠 CORTEX HEALTH CHECK │
├─────────────────────────────────────────────────┤
│ MCP Server ✓ Connected │
│ Memory Files ✓ 5 files (127 entries) │
│ API Key ✓ Valid (sk-ant-...) │
│ Hooks ✓ SessionStart, SessionEnd │
│ Last Activity 2 hours ago │
│ Disk Usage 41 KB │
├─────────────────────────────────────────────────┤
│ STATUS: All systems operational ✓ │
╰─────────────────────────────────────────────────╯
To verify:
- Check MCP connection:
claude mcp list | grep cortex - Check files exist:
ls ~/.claude/memory/data/memories/ - Check API key:
[ -n "$ANTHROPIC_API_KEY" ] && echo "Set" - Check hooks:
grep -A3 "SessionStart" ~/.claude/settings.json
7. Log Command (/cortex log)
Show recent activity from logs:
╭─────────────────────────────────────────────────╮
│ 🧠 CORTEX ACTIVITY LOG (last 10) │
├─────────────────────────────────────────────────┤
│ 14:32 query "authentication" → 3 hits │
│ 14:28 learn "JWT pattern" → stored │
│ 14:15 recall (session start) → 2 items │
│ 13:45 reflect "debugging approach" → complete│
│ ... │
╰─────────────────────────────────────────────────╯
Read from: ~/.claude/memory/logs/*.log
8. Config Command (/cortex config)
Show current configuration:
╭─────────────────────────────────────────────────╮
│ 🧠 CORTEX CONFIGURATION │
├─────────────────────────────────────────────────┤
│ SESSION START │
│ Max memories injected: 5 │
│ Relevance threshold: 0.3 │
│ │
│ SESSION END │
│ Quality threshold: 0.4 │
│ Max extractions: 10 │
│ │
│ LADS (Learning) │
│ Evolution enabled: yes │
│ Evolution interval: 24h │
│ │
│ Config file: ~/.claude/memory/data/configs/ │
│ current.json │
╰─────────────────────────────────────────────────╯
Read from: ~/.claude/memory/data/configs/current.json
9. Export Command (/cortex export [format])
Export memories to file:
/cortex export # Default: markdown
/cortex export json # JSON format
/cortex export md # Markdown format
Output example for markdown:
# Cortex Memory Export
Generated: 2026-01-27
## Skills (23 entries)
- Authentication: Use JWT with refresh tokens...
- Error handling: Always log context...
## Learnings (45 entries)
- "Always validate JWT expiry before permissions"
- "Use circuit breaker for external API calls"
...
10. Session Command (/cortex session)
Show current session summary:
╭─────────────────────────────────────────────────╮
│ 🧠 CORTEX SESSION │
├─────────────────────────────────────────────────┤
│ Started: 14:00 (2h 32m ago) │
│ Working Dir: ~/.claude/memory │
│ Git Branch: master │
│ │
│ INJECTED AT START │
│ • JWT authentication pattern │
│ • Error handling best practices │
│ │
│ WILL EXTRACT AT END │
│ • MCP Resources implementation approach │
│ • Skill enhancement patterns │
│ │
│ API Usage: ~$0.02 │
╰─────────────────────────────────────────────────╯
This shows what memories were injected at session start and previews what will be extracted at session end.
Auto-Activation
This skill should auto-activate when the user says:
- "What did I do last time?"
- "Do you remember when..."
- "Check my past sessions"
- "What have I learned about..."
- "Search my memories for..."
When auto-activated, show the visual feedback and use the appropriate tool.
Error Handling
If MCP server is not connected:
╭──────────────────────────────────────╮
│ 🧠 CORTEX ═══════════════════════ │
│ ✗ MCP Server Not Connected │
│ │
│ Try: claude mcp list │
│ Check: ~/.claude.json │
╰──────────────────────────────────────╯
Examples
User: /cortex query authentication
Response: Shows neural animation, then displays matching memories about authentication patterns.
User: "What approach did I use for the login system?" Response: Auto-activates, queries memories, shows relevant past decisions.
User: /cortex learn "Always validate JWT expiry before checking permissions"
Response: Analyzes insight quality, stores if good, reports result.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/cortex-claude-s-cognitive-layer-mm78nnwg/download' --output '.skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg/SKILL.md.part' && mv '.skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg/SKILL.md.part' '.skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.
Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/cortex-claude-s-cognitive-layer-mm78nnwg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.