/cf-learn
Medium~1K–2.5K tokens injected into promptExtract human learning docs from coding sessions.
Context footprint: ⚡⚡ (medium) — what does this mean?
The /cf-learn skill creates learning documentation from your coding sessions. It captures what you learned, insights gained, and techniques used. Unlike /cf-remember (project context for AI recall), this creates educational notes for the human to learn from. These docs can be hosted as a personal knowledge base or served via MCP.
💡 Looking for a deeper, conversational breakdown of what happened and why during a task? Check out /cf-teach — it explains everything like a sharp friend over coffee, covering approach, alternatives, tradeoffs, mistakes, and transferable lessons.
💡 To see what you've learned so far, run cf host to view the learning notes in your browser or using cf mcp to integrate with other LLM clients.
Usage
/cf-learn [arguments]
Or run without arguments to extract learnings from the current session. Your argument narrows what to extract, not what to name the file.
What It Does
- Analyzes Session — Reviews what you built and problems you solved
- Extracts Insights — Identifies key learnings and techniques
- Categorizes — Organizes by concept type (concepts, patterns, languages, tools, debugging)
- Creates Docs — Generates clear learning materials with examples
- Saves to Output — Stores in configurable directory (default:
docs/learn/) - Enables Sharing — Docs can be hosted as website or served via MCP
Examples
/cf-learn TypeScript generics and constraints
/cf-learn
# Auto detect the key knowledge based on the conversation
# Auto-invoked after substantial new knowledge
Configuration
All settings are optional. Configure in .coding-friend/config.json (local, overrides global) or ~/.coding-friend/config.json (global).
| Setting | Default | Description |
|---|---|---|
learn.language | en | Language for learning notes (falls back to top-level language, then en) |
learn.outputDir | docs/learn | Where to store learning docs (relative to project root, or absolute) |
learn.categories | See table below | Subdirectories and their descriptions |
learn.autoCommit | false | Auto git-commit after writing |
learn.readmeIndex | false | Index mode: false (none), true (single README), "per-category" (separate README per category) |
Default Categories
| Category | Folder | Examples |
|---|---|---|
| Concepts | concepts | Dependency injection, event sourcing |
| Patterns | patterns | Repository pattern, observer pattern |
| Languages | languages | TypeScript generics, Python decorators |
| Tools | tools | Prisma migrations, Docker compose |
| Debugging | debugging | Race condition fix, memory leak hunt |
You can override these categories in your config to match your preferred organization.
Auto-Invocation
cf-learn activates automatically when you:
- Solve a complex technical problem
- Learn a new pattern or technique
- Overcome a major debugging challenge
- Complete a feature with novel architecture
cf-learn vs cf-teach
Both skills write to the same docs/learn/ directory, but serve different purposes:
/cf-learn | /cf-teach | |
|---|---|---|
| Purpose | Concise reference notes | Deep narrative explanation |
| Format | Structured (What / Why / How / Gotchas) | Flowing prose storytelling |
| Tone | Technical reference docs | Friend explaining over coffee |
| Length | Short, dense | Long-form narrative |
| Output path | {dir}/{category}/{name}.md | {dir}/{category}/{name}.md |
| Trigger | Auto-invoke + slash command | Slash command only |
| Best for | "What is X?" — future quick recall | "Why did we do it this way?" — genuine understanding |
Use /cf-learn to build a reference library of concepts and patterns. Use /cf-teach when you want to truly understand what happened during a session — the reasoning, the tradeoffs, and the lessons.