/ctx:ctx-learning-addfrom ctx
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
Ships in ctx. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Record a learning in LEARNINGS.md.
Three questions: if any answer is "no", don't record:
Learnings should capture principles and heuristics, not code snippets.
If the user provides only a title, ask:
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 learning add: the conversational
approach lets you automatically pick up session ID, branch, and commit
from the provenance line already in your context window.
ctx learning add "Title" \
--session-id SESSION --branch BRANCH --commit HASH \
--context "..." --lesson "..." --application "..."
Example: behavioral pattern:
ctx learning add "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:
ctx learning add "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:
ctx learning add "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"
When a flag value would be denied: if a --context/--lesson/
--application value contains a substring that trips a permissions.deny
rule on the literal command string (e.g. a path like /usr/local/bin),
put the fields in a JSON file and pass --json-file instead — the values
never reach the command line, and the schema gates still apply:
cat > /tmp/learning.json <<'EOF'
{
"title": "Hooks run in a subprocess",
"context": "env vars set in a hook did not persist to the session",
"lesson": "hook stdout is the only channel back to the agent",
"application": "relay via stdout, never the environment",
"provenance": {"session_id": "abc12345", "branch": "main", "commit": "68fbc00a"}
}
EOF
ctx learning add --json-file /tmp/learning.json
This skill records principle-level lessons discovered through real work. It does not unilaterally promote material from adjacent skills:
/ctx-convention-add's job and requires explicit user ask./ctx-decision-add if the user wants it elevated.Light compression for clarity is allowed; new facts are not.
Before recording, verify:
Confirm the learning was added.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub activememory/ctx --plugin ctx54 skills in this plugin
/ctx-agentLoad full context packet. Use at session start or when context seems stale or incomplete./ctx-architectureBuild and maintain architecture maps. Use to create or refresh ARCHITECTURE.md and DETAILED_DESIGN.md. Supports principal mode for deeper analysis: vision, future direction, bottlenecks, implementation alternatives, gaps, upstream proposals, and intervention points./ctx-architecture-enrichEnrich architecture artifacts with code intelligence data. Takes existing /ctx-architecture output as baseline, verifies and quantifies with GitNexus MCP (blast radius, execution flows, domain clustering, registration sites). Run after /ctx-architecture, not instead of it./ctx-architecture-failure-analysisAdversarial failure analysis for codebases. Generates falsifiable incident hypotheses: race conditions, ordering assumptions, cache staleness, error swallowing, ownership gaps, idempotency failures, and scaling cliffs. Produces DANGER-ZONES.md with evidence-backed, ranked findings./ctx-archiveArchive completed tasks. Use when TASKS.md has many completed items cluttering the view./ctx-blogGenerate blog post draft. Use when documenting project progress, sharing learnings, or writing about development experience.Other plugins' skills for the same job