learn

A workflow for recording reusable lessons from difficult fixes, mistakes, and technical decisions.

In plain words
What is it for?
Use it after failed commands, repeated compile errors, corrected API usage, environment problems, or architecture decisions to update categorized knowledge files and their index.
Why use it?
It helps future sessions avoid repeating known problems by checking existing knowledge before adding a new entry.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/cookys/autopilot/learn
Any agent
npx skills add cookys/autopilot --skill learn
Clone the repo
git clone --depth 1 https://github.com/cookys/autopilot

Made for: Claude Code, Codex.

Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,471 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00139 $0.01471
Opus 5 $0.00069 $0.00736
Sonnet 5 $0.00028 $0.00294
Haiku 4.5 $0.00014 $0.00147

Measured 2d ago against content hash 64e2b6226be2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

learn scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

grep -ri "<keyword>" .claude/knowledge/*.md
evals/skill-onoff/packs/companions/learn/SKILL.md · 187 lines

How it starts

The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.

learn

Record reusable knowledge so future sessions avoid the same mistakes.

When to Record

Trigger Category
Bash command failed on path/config, then fixed env
Compile error took 2+ retries to fix build
Searched 3+ times to find a file/class env
API usage was wrong, then corrected api
Architecture decision required iteration arch

Flow

  1. Dedup check — search existing knowledge before writing:

    grep -ri "<keyword>" .claude/knowledge/*.md
    
    • Already recorded and complete: skip
    • Recorded but incomplete: update existing entry (Edit)
    • Not found: add new entry
  2. Read the target knowledge file (by category):

    • build-errors.md | debug-patterns.md | architecture.md | environment.md
  3. Append entry using this template:

    ## [Title]
    **Date**: YYYY-MM-DD | **Context**: what you were doing
    **Problem**: what went wrong
    **Solution**: what fixed it
    

    Add **Failed attempts**: and **Related**: lines only when they add value.

  4. Update INDEX.md "recent learning" table

  5. Rotate — keep recent list at 10 entries max:

    # If your project has a rotate script:
    node .claude/scripts/learn-rotate.js
    # Otherwise: manually trim the oldest entries
    

Categories

Category File Content
build build-errors.md Compile/link/CMake errors
debug debug-patterns.md Debugging techniques, crash patterns
arch architecture.md Design decisions, pitfalls
env environment.md Paths, Docker, config
api (in relevant file) API misuse patterns

Invocation

/learn [category] [brief description]

Examples:

/learn build Missing dependency — install with apt/brew/pip
/learn env Script path wrong — use relative path from project root

Session Learning Summary (L-size)

At the end of L-size tasks, produce a structured summary before the dev-flow session-end phase:

Read the full file on GitHub · 187 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 187 lines · 139 tokens per session scan B 64e2b6226be2

Subscribe to this mod's changes

learn is a skill published in the GitHub repository cookys/autopilot (11 stars, last pushed 2d ago), licensed MIT. It adds 139 tokens to every session and 1,471 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

article-writing

Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.

affaan-m/ECC · 57 tokens

a-evolve

Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on…

aiming-lab/AutoResearchClaw · 100 tokens

hive.chart-creation-foundations

Required reading whenever any chart tool is available. Teaches the one-tool embedding contract (call chartrender → live chart appears in chat AND a downloadable PNG lands in the queen session dir), the ECharts (data viz) vs Mermaid (structural diagrams) decision, the BI/financial-grade aesthetic baseline (no…

aden-hive/hive · 133 tokens

deck-course-module

暖纸背景 + Playfair, 左侧学习目标常驻, 含 MCQ 自测页.

nexu-io/html-anything · 25 tokens

code-documenter

Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.

zebbern/claude-code-guide · 39 tokens

creating-skills

Guide for creating Claude Code skills following Anthropic's official best practices. Use when user wants to create a new skill, build a skill, write SKILL.md, update an existing skill, or needs skill creation guidelines. Provides structure, frontmatter fields, naming conventions, and new features like dynamic context…

redai-infra/Relax · 70 tokens