capy-cortex
Skill137 starsChanged 6 months agoMITView on GitHub
Autonomous learning system - learns from mistakes, reflects on sessions, and gets smarter over time. The AI brain.
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Stop: Extracts corrections and preferences from conversation
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Capy Cortex - Autonomous Learning System
You have a persistent learning brain powered by SQLite + FTS5 + sklearn TF-IDF. Knowledge is automatically loaded via hooks. This file describes manual operations.
Architecture
- Database:
~/.claude/skills/capy-cortex/cortex.db(SQLite + FTS5 + WAL) - Hooks (automatic, never call manually):
- SessionStart: Loads anti-patterns, preferences, principles
- UserPromptSubmit: Retrieves task-relevant rules via FTS5
- PreToolUse(Bash): Blocks known dangerous commands
- PostToolUseFailure: Records errors as anti-patterns
- Stop: Extracts corrections and preferences from conversation
- Scripts (for manual/scheduled use):
cortex.py: Core engine (retrieve, add rules, stats)reflect.py: Deep session analysisconsolidate.py: Cluster rules into principles (sklearn)bootstrap.py: Mine historical sessions
Manual Commands
# Check system health
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py stats
# Retrieve rules for a topic
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrieve "react typescript"
# Add a rule manually
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-rule "Always use TypeScript strict mode" "best_practice"
# Add an anti-pattern
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-ap "Never force push to main" "critical"
# Add a preference
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-pref "User prefers functional components over class components"
# Run consolidation (clusters rules into principles)
python3 ~/.claude/skills/capy-cortex/scripts/consolidate.py
# Retrain TF-IDF model
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrain
# Apply confidence decay
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py decayHow It Learns
- Automatic (via hooks): Errors are captured, corrections noted, preferences extracted
- Reflection: Deep analysis of session transcripts extracts patterns
- Consolidation: sklearn clustering groups similar rules into principles
- Decay: Old, unreinforced rules fade; validated rules strengthen
- Retrieval: Two-stage FTS5 + TF-IDF returns only relevant knowledge (O(1) context)
In this repository59 other files it gives its agents.
- skills/supabase-postgres-best-practices/AGENTS.mdAGENTS.md
- skills/supabase-postgres-best-practices/CLAUDE.mdCLAUDE.md
- 360-panorama-viewerSkill
- 3d-web-experienceSkill
- acid-labels-pptxSkill
- ai-image-generationSkill
- ai-video-generationSkill
- apricot-ritual-pptxSkill
- azure-host-pptxSkill
- better-auth-best-practicesSkill
- botanical-blur-pptxSkill
- building-native-uiSkill
- canvas-designSkill
- capy-video-gen-skillSkill
- claude-code-templatesSkill
- contract-first-agentsSkill
- coral-geyser-pptxSkill
- create-design-system-rulesSkill
- data-storytellingSkill
- film-creatorSkill
- find-skillsSkill
- frontend-slidesSkill
- gbro-collage-brollSkill
- generate-imageSkill
- goplacesSkill
- gradient-calendar-pptxSkill
- happycapy-feishuSkill
- happycapy-skill-creatorSkill
- happycapy-social-publisherSkill
- html-over-markdownSkill
- image-enhancerSkill
- latex-documentSkill
- llm-councilSkill
- mobile-app-developerSkill
- mobile-designSkill
- nano-banana-proSkill
- neon-motion-pptxSkill
- next-best-practicesSkill
- olive-rose-pptxSkill
- oss-contributor-swarmSkill
- pdfSkill
- pptxSkill
- prompt-improverSkill
- redbook-creator-publishSkill
- reddit-post-writerSkill
- reddit-post-writerSkill
- resume-assistantSkill
- signal-green-pptxSkill
- skill-creatorSkill
- slack-gif-creatorSkill
- supabase-postgres-best-practicesSkill
- treatment-plansSkill
- video-downloaderSkill
- video-framesSkill
- weatherSkill
- world-class-carouselSkill
- writing-clearly-and-conciselySkill
- xiaohongshu-recruiterSkill
- youtube-musicSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

