MCPInstall

lessons

Capture and review lessons learned from coding sessions. Use to record insights, read past lessons, and improve over time.

Installs
50
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/johnlindquist/claude --skill lessons
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads lessons automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Lessons Learned

Capture insights and learn from past experiences.

Capture Patterns

Quick Lesson Capture

When you learn something valuable during a session:

# Write to lessons file
cat >> ~/.claude/lessons.md << 'EOF'

## [Date] - [Topic]

**Context:** What were you doing?
**Lesson:** What did you learn?
**Application:** When to apply this?

EOF

Structured Lesson

## 2024-01-15 - TypeScript Generic Constraints

**Context:**
Building a type-safe form library, struggled with generic types.

**Problem:**
Generic function wasn't narrowing types correctly.

**Solution:**
Use `extends` constraints to narrow:
```typescript
function getValue<T extends { value: unknown }>(obj: T): T['value'] {
  return obj.value;
}

Lesson: TypeScript generics need explicit constraints for type narrowing.

Tags: #typescript #generics #types


## Lesson Categories

### Bug Lessons

```markdown
## Bug: [Brief description]

**Symptom:** What happened
**Root Cause:** Why it happened
**Fix:** How to fix
**Prevention:** How to avoid in future
**Time Cost:** How long to debug (motivation to remember!)

Pattern Lessons

## Pattern: [Name]

**When to use:** Situations where this applies
**How to implement:** Basic structure
**Gotchas:** Common mistakes
**Example:** Working code

Tool Lessons

## Tool: [Name]

**What it does:** Brief description
**Key commands:** Most useful commands
**Gotchas:** Things that trip people up
**Alternatives:** Other options

Review Practices

Daily Review

# Review recent lessons
tail -100 ~/.claude/lessons.md

# Search for topic
grep -A 10 "typescript" ~/.claude/lessons.md

Weekly Audit

gemini -m pro -o text -e "" "Review these lessons from the past week:

$(tail -500 ~/.claude/lessons.md)

1. What patterns emerge?
2. What mistakes keep recurring?
3. What should be turned into automation?
4. What needs deeper study?"

Before Starting Work

# Get relevant lessons
TOPIC="authentication"
grep -B 2 -A 10 -i "$TOPIC" ~/.claude/lessons.md

Automation from Lessons

When a lesson appears multiple times, automate it:

Create Git Hook

# Lesson: Always run tests before commit
# → Create pre-commit hook

cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
npm test || exit 1
EOF
chmod +x .git/hooks/pre-commit

Create Snippet

# Lesson: This pattern is useful
# → Save as snippet

cat > ~/.claude/snippets/async-error-handling.ts << 'EOF'
async function safeAsync<T>(promise: Promise<T>): Promise<[T, null] | [null, Error]> {
  try {
    const result = await promise;
    return [result, null];
  } catch (error) {
    return [null, error as Error];
  }
}
EOF

Create Checklist

# Lesson: Keep forgetting these steps
# → Create checklist

cat > ~/.claude/checklists/pr-review.md << 'EOF'
# PR Review Checklist
- [ ] Tests pass
- [ ] No console.logs
- [ ] Types are explicit
- [ ] Error handling present
- [ ] Documentation updated
EOF

AI-Assisted Learning

Extract Lessons from Session

gemini -m pro -o text -e "" "Extract lessons learned from this coding session:

[Paste conversation or summary]

For each lesson:
1. What was learned
2. When it applies
3. How to remember it"

Connect Lessons

gemini -m pro -o text -e "" "Find connections between these lessons:

$(cat ~/.claude/lessons.md)

1. What themes emerge?
2. What knowledge gaps exist?
3. What should be studied next?"

Generate Quiz

gemini -m pro -o text -e "" "Create a quiz from these lessons:

$(tail -1000 ~/.claude/lessons.md)

Generate 5 questions that test understanding of key concepts."

Storage Options

File-based

# Single file
~/.claude/lessons.md

# By date
~/.claude/lessons/2024-01.md

# By topic
~/.claude/lessons/typescript.md
~/.claude/lessons/git.md

Memory Integration

# Save to basic-memory
basic-memory tool write-note \
  --title "Lesson: TypeScript Generics" \
  --folder "lessons" \
  --content "$(cat lesson.md)" \
  --tags "lesson,typescript"

Best Practices

  1. Capture immediately - Don't wait, you'll forget
  2. Be specific - Include code examples
  3. Note the cost - Time spent motivates remembering
  4. Review regularly - Lessons fade without review
  5. Automate repeated - Turn lessons into tools
  6. Tag consistently - Makes searching easier
  7. Connect to context - When does this apply?

FAQ

What does the lessons skill do?

Capture and review lessons learned from coding sessions. Use to record insights, read past lessons, and improve over time.

How do I install lessons?

Run npx skills add https://github.com/johnlindquist/claude --skill lessons in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/lessons/ (personal) or .claude/skills/lessons/ (project).

Which AI agents can use lessons?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is lessons safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains lessons?

It is published by johnlindquist in johnlindquist/claude. It has 50 recorded installs.

More from johnlindquist/claude

View all →

gemini-image

johnlindquist/claude

Analyze images using Gemini's vision capabilities. Use for image analysis, text extraction from screenshots, and visual content understanding.

Media & Creative1.2K installs

memory

johnlindquist/claude

Open the skill to read its SKILL.md instructions.

362 installs

raycast-extension

johnlindquist/claude

Open the skill to read its SKILL.md instructions.

321 installs

brainstorm

johnlindquist/claude

Open the skill to read its SKILL.md instructions.

deepwiki

johnlindquist/claude

Open the skill to read its SKILL.md instructions.

269 installs

think

johnlindquist/claude

Open the skill to read its SKILL.md instructions.

258 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.