ctx-learning-add
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
Best use case
ctx-learning-add is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
Teams using ctx-learning-add should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ctx-learning-add/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ctx-learning-add Compares
| Feature / Agent | ctx-learning-add | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
Record a learning in LEARNINGS.md. ## Before Recording Three questions: if any answer is "no", don't record: 1. **"Could someone Google this in 5 minutes?"** → If yes, skip it 2. **"Is this specific to this codebase?"** → If no, skip it 3. **"Did it take real effort to discover?"** → If no, skip it Learnings should capture **principles and heuristics**, not code snippets. ## When to Use - After discovering a gotcha or unexpected behavior - When a debugging session reveals root cause - When finding a pattern that will help future work ## When NOT to Use - General programming knowledge (not specific to this project) - One-off workarounds that won't recur - Things already documented in the codebase ## Gathering Information If the user provides only a title, ask: 1. "What were you doing when you discovered this?" → Context 2. "What's the key insight?" → Lesson 3. "How should we handle this going forward?" → Application ## Execution Provenance flags (`--session-id`, `--branch`, `--commit`) are **required**. Get these values from the hook-relayed provenance line in your context (e.g., `Session: abc12345 | Branch: main @ 68fbc00a`). **Prefer this skill over raw `ctx add learning`**: the conversational approach lets you automatically pick up session ID, branch, and commit from the provenance line already in your context window. ```bash ctx add learning "Title" \ --session-id SESSION --branch BRANCH --commit HASH \ --context "..." --lesson "..." --application "..." ``` **Example: behavioral pattern:** ```bash ctx add learning "Agent ignores repeated hook output (repetition fatigue)" \ --session-id abc12345 --branch main --commit 68fbc00a \ --context "PreToolUse hook ran ctx agent on every tool use, injecting the same context packet repeatedly. Agent tuned it out and didn't follow conventions." \ --lesson "Repeated injection causes the agent to ignore the output. A cooldown tombstone emits once per window. A readback instruction creates a behavioral gate harder to skip than silent injection." \ --application "Use --session \$PPID in hook commands to enable cooldown. Pair context injection with a readback instruction." ``` **Example: technical gotcha:** ```bash ctx add learning "go:embed only works with files in same or child directories" \ --session-id abc12345 --branch main --commit 68fbc00a \ --context "Tried to embed files from parent directory, got compile error" \ --lesson "go:embed paths are relative to the source file and cannot use .. to escape the package" \ --application "Keep embedded files in internal/assets/ or child directories, not project root" ``` **Example: workflow insight:** ```bash ctx add learning "ctx init overwrites user content without guard" \ --session-id abc12345 --branch main --commit 68fbc00a \ --context "Commit a9df9dd wiped 18 decisions from DECISIONS.md, replacing with empty template" \ --lesson "Init treats all context files as templates, but after first use they contain user data" \ --application "Skip existing files by default, only overwrite with --force" ``` ## Quality Checklist Before recording, verify: - [ ] Context explains what happened (not just what you learned) - [ ] Lesson is a principle, not a code snippet - [ ] Application gives actionable guidance for next time - [ ] Not already in LEARNINGS.md (check first) Confirm the learning was added.
Related Skills
ctx-add-learning
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
ctx-verify
Verify before claiming completion. Use before saying work is done, tests pass, or builds succeed.
ctx-skill-creator
Create, improve, test, and deploy skills. Full skill lifecycle from intent to working skill file.
ctx-sanitize-permissions
Audit tool permissions for dangerous or overly broad entries. Use to ensure safe agent configuration.
ctx-recall
Browse session history. Use when referencing past discussions or finding context from previous work.
ctx-prompt
Apply, list, and manage saved prompt templates from .context/prompts/. Use when the user asks to apply, list, or create a reusable template like code-review or refactor.
ctx-journal-normalize
Normalize journal source markdown for clean rendering. Use after journal site shows rendering issues: fence nesting, metadata formatting, broken lists.
ctx-import-plans
Import plan files into project specs directory. Use to convert external plans into project-tracked specs.
ctx-compact
Archive completed tasks and trim context. Use when context files are growing large.
ctx-check-links
Audit docs for dead links. Use before releases, after restructuring docs, or when running a documentation audit.
ctx-add-task
Add a task. Use when follow-up work is identified or when breaking down complex work into subtasks.
ctx-add-decision
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.