Review the current session and extract project-specific learnings — architecture decisions, code conventions, tooling quirks, domain knowledge, build/test commands — then persist them to the project CLAUDE.md and project auto-memory. Unlike /learn (which updates global agent directives), /plearn captures what is true about THIS codebase. Use at the end of any session where you learned something new about the project.
You are extracting project-specific knowledge from this session and persisting it to the project's CLAUDE.md and auto-memory. This is distinct from global agent behavior rules — you are capturing facts about this codebase.
Check in order:
./CLAUDE.md./.claude/CLAUDE.mdIf neither exists: create ./CLAUDE.md as a new file with the heading # Project Instructions and an empty body before proceeding. NEVER skip straight to updates without reading the existing file first — read it in full.
Re-read the full conversation. Collect every instance of:
| Signal | Examples |
|---|---|
| Build/test commands discovered | npm run dev, make test, pytest -x, custom scripts |
| File structure insights | "handlers live in src/api/", "models are co-located with tests" |
| Naming conventions | snake_case vs camelCase, file naming patterns, module layout |
| Architectural decisions | "we use Repository pattern", "no ORM — raw SQL via pg", "event-driven via Redis pub/sub" |
| Gotchas / non-obvious behaviours | "migration runner must be run before tests", "env var X is required", "DO NOT use library Y" |
| Domain knowledge | Business rules, entity relationships, special edge cases |
| Preferred libraries / tools | "use zod for validation", "axios not fetch", "vitest not jest" |
| Code patterns to follow | Reference implementations, style that differs from defaults |
| Things that broke | Bugs fixed, root causes found, traps to avoid |
| User corrections about the codebase | Any time user said "actually in this project we..." |
DISCARD:
~/.claude/CLAUDE.md via /learnFor each candidate finding:
Write all new and augmented entries. Organise into sections that match the file's existing structure, or use these defaults if starting fresh:
# Project Instructions
## Build & Test
<!-- commands to build, run, test — things Claude can't infer -->
## Architecture
<!-- patterns, constraints, key design decisions -->
## Code Conventions
<!-- naming, file layout, style rules that differ from defaults -->
## Libraries & Tools
<!-- preferred/required libraries; explicitly banned alternatives -->
## Gotchas
<!-- non-obvious behaviours, required setup steps, known traps -->
## Domain Knowledge
<!-- business rules, entity definitions, edge cases -->
Rules:
Read ~/.claude/projects/<project>/memory/MEMORY.md (create if absent — the directory already exists per auto-memory setup).
Add or update entries for:
Follow memory rules: index only in MEMORY.md (keep under 200 lines), deep notes in topic files.
## /plearn Results
Project CLAUDE.md: <path>
Entries added: N
Entries updated: N
Sections modified: <list>
Auto-memory updated: yes/no
Summary of what was learned:
- <one line per entry>
Run `/memory` to review auto-memory changes.
If zero learnings were found: say so clearly — NEVER invent entries to fill the file.