agentleFS
peopleforresterpeopleforrester/claude-dotfiles/skills/optimization/continuous-learning/SKILL.md

continuous-learning

Skill3 starsChanged 8 months agoMITView on GitHub

Patterns for Claude Code to learn from project context and improve over time. Covers CLAUDE.md refinement, error pattern recognition, codebase conventions discovery, and feedback incorporation. Use to optimize Claude Code's effectiveness across sessions.

31 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use clickhouse-io, configure-ecc and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • WorldFlowAISkill

    clickhouse-io

    ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

    Also in 10 projects that use this

  • saxon-ySkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 5 projects that use this

  • OpenAISkill

    swiftui-patterns

    Build macOS SwiftUI scenes and components with desktop patterns. Use when shaping windows, commands, toolbars, settings, split views, or inspectors.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Update it when you discover project-specific patterns.

    line 28
  2. Distinctive:

    Before writing code, scan the codebase for patterns:

    line 48
  3. Distinctive:

    Match what exists: Don't introduce a new pattern unless asked.

    line 58
  4. Distinctive:

    When the same error appears multiple times, document the fix:

    line 79
  5. Distinctive:

    If the user says "we don't do it that way" or corrects your approach:

    line 107
  6. Distinctive:

    Before the session ends, consider updating CLAUDE.md with:

    line 138

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Continuous Learning

Strategies for Claude Code to build and maintain project knowledge across sessions.

Knowledge Sources

1. CLAUDE.md as Living Memory

CLAUDE.md is the primary mechanism for persisting knowledge between sessions. Update it when you discover project-specific patterns.

## Discovered Patterns

### Error Handling
- This project uses Result<T, AppError> everywhere — never throw
- All API errors return { error: string, code: string } format

### Testing
- Integration tests require Docker: `docker compose up -d` first
- Test DB resets between suites via `beforeAll` in conftest

### Gotchas
- The `user.status` field is a string enum, not a boolean
- Migrations must be generated with `--name` flag or CI rejects them

2. Convention Discovery

Before writing code, scan the codebase for patterns:

Step 1: Check imports     → How does this project import modules?
Step 2: Check error style → Custom errors? Result types? Try/catch?
Step 3: Check naming      → camelCase? snake_case? What prefixes?
Step 4: Check test style  → describe/it? test()? What assertions?
Step 5: Check structure    → Feature folders? Layer folders? Flat?

Match what exists. Don't introduce a new pattern unless asked.

3. Git History as Context

Recent commits reveal current development focus:

# What changed recently?
git log --oneline -20

# Who changed this file and why?
git log --oneline -5 -- path/to/file.ts

# What does the team's commit style look like?
git log --format="%s" -10

Error Pattern Recognition

Build Recurring Error Log

When the same error appears multiple times, document the fix:

## Common Errors

### "Module not found: @/components/..."
**Cause**: Path alias not configured in tsconfig
**Fix**: Add `"@/*": ["./src/*"]` to tsconfig paths

### "ECONNREFUSED 127.0.0.1:5432"
**Cause**: PostgreSQL not running
**Fix**: `docker compose up -d postgres`

Resolution Strategy

1. Search CLAUDE.md for known error     → Apply documented fix
2. Search git log for similar errors    → Check how it was fixed before
3. Search codebase for error message    → Find error origin
4. Search dependencies for breaking     → Check changelogs
5. Minimal reproduction                 → Isolate the problem

Feedback Incorporation

When the User Corrects You

If the user says "we don't do it that way" or corrects your approach:

  1. Understand — Ask why if the reason isn't clear
  2. Apply — Fix the current code immediately
  3. Record — Add the convention to CLAUDE.md for future sessions
  4. Verify — Confirm the updated approach matches expectations

When Tests Reveal Patterns

Test failure → Read full output → Identify pattern → Document in CLAUDE.md

Examples of test-revealed patterns:

  • "Tests expect ISO 8601 dates, not Unix timestamps"
  • "API tests need auth header: Authorization: Bearer test-token"
  • "Snapshot tests must be updated with --update flag"

Session Handoff

Start of Session Checklist

1. Read CLAUDE.md                    → Understand project context
2. Read recent git log               → Understand current work
3. Check for open issues/PRs         → Understand priorities
4. Check CI status                   → Know if builds are passing

End of Session Updates

Before the session ends, consider updating CLAUDE.md with:

  • New gotchas discovered during this session
  • Patterns that were unclear and are now understood
  • Commands that were useful (build, test, deploy)
  • Environment setup steps that were non-obvious

Anti-Patterns

Anti-PatternBetter Approach
Guessing project conventionsScan 3-5 existing files first
Ignoring test failuresRead full output, fix root cause
Repeating the same mistakeDocument fix in CLAUDE.md
Overloading CLAUDE.mdKeep under 2000 tokens, be concise
Assuming stack/toolsCheck package.json, Cargo.toml, etc.

Checklist

  • CLAUDE.md reviewed at session start
  • Codebase conventions discovered before writing code
  • Errors documented with cause and fix
  • User corrections recorded in CLAUDE.md
  • Session discoveries summarized before handoff

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.