Claude-skill-registry cortex
Automatic session tracking and memory system for Claude Code. Activates when working in git repositories to track file changes, commits, and session context. Creates .cortex_log.md (session history), .cortex_status.json (current state), and .cortex_handoff.md (next steps) for session continuity across conversations. Use when needing persistent memory, session handoffs, or work history tracking.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/cortex" ~/.claude/skills/majiayu000-claude-skill-registry-cortex && rm -rf "$T"
skills/data/cortex/SKILL.mdCortex - Session Orchestration & Universal Logging
Cortex is an automatic memory system that traces all work across sessions and enables skills to communicate with each other.
What Cortex Provides
- Automatic session tracing - Tracks all file changes, git operations, and major events
- Agent handoffs - Seamless context transfer between sessions
- Inter-skill communication - Python API for skills to share data and patterns
- Pattern detection - Analyzes work patterns to recommend new skills (via Synapse)
Core Files Generated
Cortex automatically maintains three files in your project root:
- Human-readable session history with detailed narrative.cortex_log.md
- Machine-readable current state and metrics.cortex_status.json
- Quick start guide for next session.cortex_handoff.md
These files are automatically updated throughout your work session.
How It Works
Automatic Tracing
Cortex runs automatically via git hooks. Every time you:
- Make file changes
- Commit code
- Complete a task
Cortex updates the memory files with context about what happened and why.
Agent Handoffs
When starting a new session, Claude reads
.cortex_handoff.md to understand:
- What was done in the last session
- Current repository state
- Priority next steps
- Recent work context
Inter-Skill Communication
Skills can use Cortex's Python API to communicate:
from cortex_api import add_cortex_event, get_cortex_memory, get_pattern_analysis # Record an event add_cortex_event("api_call", "Called GitHub API", { "endpoint": "/repos/user/repo", "status": 200 }) # Query memory recent_events = get_cortex_memory(filter_type="api_call", limit=10) # Analyze patterns (used by Synapse) patterns = get_pattern_analysis(days=7, threshold=5)
See API_REFERENCE.md for complete documentation.
Installation
Run the installation script to set up git hooks:
cd .claude/skills/cortex/scripts ./install.sh
This configures Cortex to automatically track your work.
Usage
Manual Session Tracing
To manually update Cortex files:
python3 .claude/skills/cortex/scripts/trace_session.py
Manual Handoff Generation
To generate a handoff document:
python3 .claude/skills/cortex/scripts/handoff_generator.py
Using Cortex API in Your Skills
-
Import the API:
from cortex_api import add_cortex_event, get_cortex_memory -
Record events during your skill's operation
-
Query patterns to inform decisions
-
Cortex handles all file locking and persistence
Integration with Synapse
Cortex's pattern analysis powers Synapse automatic skill generation:
- Cortex tracks recurring patterns (API calls, data processing, etc.)
- Synapse queries Cortex for patterns above a threshold
- Synapse automatically generates skills when patterns reach critical frequency
- New skills use Cortex API to record their own events
This creates a self-improving system where skills emerge from actual usage patterns.
Files and Scripts
Scripts
- Updatestrace_session.py
and.cortex_log.md.cortex_status.json
- Createshandoff_generator.py.cortex_handoff.md
- Python API for inter-skill communicationcortex_api.py
- Sets up git hooksinstall.sh
References
- API_REFERENCE.md - Complete Cortex API documentation
- WORKFLOWS.md - Common Cortex usage patterns
- MULTI_LLM.md - Using Cortex with GPT, Gemini, etc.
Best Practices
- Let it run automatically - Don't manually trace unless needed
- Check
at session start - Quick context refresh.cortex_handoff.md - Use Cortex API in custom skills - Enables automatic pattern detection
- Commit Cortex files with your work - Preserves memory across machines
Multi-LLM Support
Cortex works with Claude Code, GPT, Gemini, and other CLI-based LLMs. The memory files use universal markdown and JSON formats.
See MULTI_LLM.md for LLM-specific integration guides.
Cortex is the foundation of DeepSynth's self-improving skills system.