Advanced

Self-Improving Claude

Make Claude learn from your corrections so you don't repeat yourself.

The problem

Claude doesn’t learn from you. Every conversation starts from zero.

You correct a mistake. Claude uses the wrong format, doesn’t follow your preferences, forgets how you like things done. You fix it. Next session? Same mistake. You fix it again. And again.

This loop continues forever because there’s no memory between sessions. Your preferences aren’t saved. Without a way to learn, you repeat yourself indefinitely.

The solution

What if Claude could learn from corrections? Not through magic, but through simple files:

  1. You correct something — “No, I prefer shorter emails”
  2. Claude notices — “That seems like a preference”
  3. It gets saved — Added to a file Claude reads next time
  4. Next session knows — Claude starts with your preferences loaded

The mechanism is simple: skills files that Claude reads, and a reflection process that updates them.

How it works

Skills as memory

Skills are just text files Claude reads. They can include learned preferences:

# Email Writing

## Instructions
Write emails that are clear and professional.

## Learned Preferences
- User prefers shorter emails (under 150 words)
- Always include a clear call-to-action
- Casual tone is okay for internal emails

The “Learned Preferences” section gets updated through reflection.

The reflect pattern

After a session, Claude can analyze what happened:

  1. Corrections (high confidence) — “No, make it shorter”
  2. Things that worked (medium confidence) — User seemed happy with this
  3. Observations (low confidence) — Worth noting, needs review

A /reflect command triggers this analysis and proposes updates.

The loop

Session → Corrections → Reflect → Update Skills → Next Session

Over time, Claude accumulates your preferences. You stop repeating yourself.

The goal

Correct once, never again. Claude learns from you, and you can see exactly what it learned.

Trying it out

Manual reflection

After a session where you made corrections:

/reflect

Claude analyzes the conversation and proposes skill updates. You approve or modify.

What it looks like

Signals detected:
- HIGH: User said "always keep emails under 150 words" → Add to Email preferences
- MEDIUM: The bullet-point format worked well → Note in formatting section
- LOW: User seemed to prefer morning meetings → Queue for review

Proposed update to email-writing.md:
+ - User prefers shorter emails (under 150 words)

Apply these changes? [y/n]

Important caveats

  • Review before saving — Auto-learned patterns can be wrong
  • Context matters — A preference in one situation may not apply everywhere
  • False positives — Not every correction is a permanent preference
  • Keep it pruned — Periodically review and clean up learned preferences

Manual /reflect with approval is safer than fully automatic updates.

For developers

The same pattern works for code preferences and development workflows.

Skills as learnable memory

# frontend-design.md

## Button Styles
- Always use the project's Button component from @/components/ui
- Never create ad-hoc styled buttons
- Use variant="primary" for main actions

## Learned Preferences (auto-updated)
- User prefers Tailwind over CSS-in-JS
- Always use lucide-react for icons, not heroicons

Hooks for automation

Claude Code hooks can trigger reflection automatically:

{
  "hooks": {
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/reflect.sh"
          }
        ]
      }
    ]
  }
}

Skill evolution over time

With git, you can see how skills evolve:

commit a1b2c3d - Add SQL injection check to code-review.md
commit e4f5g6h - Update button preferences in frontend-design.md
commit i7j8k9l - Add TypeScript strict mode preference

Each correction becomes part of Claude’s accumulated knowledge.

Why this beats embeddings

Traditional memory systems need embedding models, vector databases, similarity search. This approach: markdown files that Claude reads directly. Simple, inspectable, editable.

You can open the skill file and see exactly what Claude “knows.” Change it directly if it’s wrong.