Update claude learnings

From ulpi-io/browse · View interactive version

Update claude learnings is an AI agent skill from the GitHub repository ulpi-io/browse. Extract learnings about Claude Code behavior from a session and add them to the project's CLAUDE.md file. Use for behavioral rules, workflow patterns, and project-specific instructions that apply to the main Claude Code agent. Invoke via /update-claude-learnings after sessions revealing behavioral p

How to use this skill

Skill file

<EXTREMELY-IMPORTANT>

Before adding ANY learning to CLAUDE.md, you ABSOLUTELY MUST:

  1. Verify the learning is about Claude Code behavior (not application code or skill structure)
  2. Verify it applies to the main agent (not subagents or skill creation)
  3. Check for duplicates in existing CLAUDE.md sections
  4. Get user confirmation before writing

Adding learnings without verification = cluttered CLAUDE.md, conflicting rules

This is not optional. Every learning requires disciplined validation.

</EXTREMELY-IMPORTANT>

Update Claude Learnings

MANDATORY FIRST RESPONSE PROTOCOL

Before adding ANY learning to CLAUDE.md, you MUST complete this checklist:

  1. ☐ Identify the specific behavioral pattern from the session
  2. ☐ Verify this is about Claude Code behavior (not application code or skills)
  3. ☐ Verify it applies to main agent (not subagents)
  4. ☐ Categorize: Workflow Rules, Session Management, Scope Control, or Behavioral Patterns
  5. ☐ Check CLAUDE.md for existing related rules
  6. ☐ Formulate as actionable directive (imperative mood)
  7. ☐ Present learning to user for confirmation
  8. ☐ Announce: "Adding to CLAUDE.md: [category] - [brief description]"

Adding learnings WITHOUT completing this checklist = noise in project config.

Purpose

This skill captures learnings about Claude Code's own behavior in this project.

What it captures:

Output: Updates to project's CLAUDE.md file

Does NOT:

When to Use

Never add learnings proactively. Only when session revealed concrete patterns.

Decision Guide: Which Skill to Use?

Is the learning about...

Application code patterns?
├── Applies to subagents writing code
└── Use: /update-agent-learnings

Skill creation/improvement?
├── Structural patterns, quality signals
└── Use: /update-skill-learnings

Claude Code's own behavior?
├── Workflow rules, session management, scope control
└── Use: /update-claude-learnings (this skill)

| Learning Type | Example | Correct Skill |

|---------------|---------|---------------|

| Testing patterns | "Run tsc --noEmit after TypeScript edits" | update-agent-learnings |

| Skill structure | "Include EXTREMELY-IMPORTANT block" | update-skill-learnings |

| Workflow behavior | "Use /commit instead of git commit" | update-claude-learnings |

| Session behavior | "Checkpoint every 3-5 edits" | update-claude-learnings |

Step 1: Session Analysis

Gate: Identify at least one concrete behavioral pattern before proceeding to Step 2.

Review the current conversation/session for Claude Code behavioral patterns:

  1. Workflow discoveries:
  1. Session management discoveries:
  1. Scope control discoveries:
  1. Project-specific discoveries:

Step 2: Learning Extraction

Gate: User confirms extracted learning before proceeding to Step 3.

Present findings to user and ask for confirmation:

I identified the following Claude Code behavioral learning from this session:

**Category:** [Workflow Rules / Session Management / Scope Control / Behavioral Patterns]

**Learning:** [Description in imperative mood]

**Why:** [Brief explanation of what happened]

Should I add this to CLAUDE.md?

Use AskUserQuestion to:

Learning Classification

| Category | What It Covers | Section in CLAUDE.md |

|----------|---------------|---------------------|

| Workflow Rules | Skill usage, command patterns, tool preferences | ## Workflow Rules |

| Session Management | Checkpoints, timeouts, progress tracking | ## Workflow Rules > ### Session Management |

| Scope Control | Expansion rules, confirmation patterns | ## Workflow Rules > ### Scope Control |

| Behavioral Patterns | Project-specific behaviors, conventions | ## Behavioral Patterns |

Step 3: Update CLAUDE.md

Gate: CLAUDE.md updated successfully before proceeding to Step 4.

  1. Read current CLAUDE.md from project root
  2. Locate the appropriate section based on category
  3. Add new learning in imperative mood
  4. Preserve existing structure and content
  5. Update "Last updated" timestamp
  6. Write updated file

CLAUDE.md Structure

# Claude Code Project Configuration

---

## Workflow Rules

### Use Available Skills
- [skill usage rules...]

### Session Management
- [checkpoint rules, timeout handling...]

### Scope Control
- [expansion rules, confirmation patterns...]

---

## Project Context

### Repository Purpose
[project description]

### Key Directories
[important paths]

---

## Behavioral Patterns

[project-specific behaviors derived from sessions]

---

*Last updated: [date]*

Step 4: Verification

Gate: All checks pass before marking complete.

Check 1: Learning Added

Check 2: Learning Quality

Check 3: File Integrity

Check 4: Correct Scope

Pre-Update Checklist

Before updating, verify:

Error Handling

| Situation | Action |

|-----------|--------|

| Learning is about application code | Redirect to /update-agent-learnings |

| Learning is about skill structure | Redirect to /update-skill-learnings |

| CLAUDE.md doesn't exist | Create with standard structure |

| Category unclear | Ask user to clarify |

| Duplicate exists | Merge or skip, inform user |

| File structure broken | Fix structure before adding |

Safety Rules

| Rule | Reason |

|------|--------|

| Always get user confirmation | Ensures learnings are accurate and desired |

| Never delete existing content | Preserve project configuration |

| Keep learnings actionable | Vague rules don't help |

| Use imperative mood | Clearer directives |

| Preserve file structure | Maintains organization |

| Verify scope before adding | Wrong file = wrong audience |


Quality Checklist (Must Score 8/10)

Score yourself honestly before marking update complete:

Learning Identification (0-2 points)

Scope Verification (0-2 points)

User Confirmation (0-2 points)

File Integrity (0-2 points)

Category Placement (0-2 points)

Minimum passing score: 8/10


Common Rationalizations (All Wrong)

These are excuses. Don't fall for them:


Failure Modes

Failure Mode 1: Wrong Scope

Symptom: Added "Run tsc --noEmit after edits" to CLAUDE.md

Why Wrong: This is for subagents writing TypeScript, not main Claude Code

Fix: Use /update-agent-learnings instead

Failure Mode 2: Skill Pattern in CLAUDE.md

Symptom: Added "Include EXTREMELY-IMPORTANT block in skills"

Why Wrong: This is about skill structure, not Claude Code behavior

Fix: Use /update-skill-learnings instead

Failure Mode 3: Vague Rule

Symptom: Added "Be more careful with commits"

Why Wrong: Not actionable - what specific behavior?

Fix: Make specific: "Use /commit skill instead of manual git commit"

Failure Mode 4: Duplicate Added

Symptom: Same rule exists in multiple sections

Fix: Search CLAUDE.md before adding, merge if similar exists


Quick Workflow Summary

STEP 1: SESSION ANALYSIS
├── Review session for behavioral patterns
├── Identify workflow issues
├── Identify session management issues
├── Identify scope control issues
└── Gate: Concrete pattern identified

STEP 2: LEARNING EXTRACTION
├── Categorize the learning
├── Verify correct scope (not agent/skill learning)
├── Formulate as actionable directive
├── Check for duplicates
├── Present to user
├── Get confirmation
└── Gate: User approved

STEP 3: UPDATE CLAUDE.MD
├── Read current CLAUDE.md
├── Locate correct section
├── Add new learning
├── Update timestamp
├── Write file
└── Gate: File updated

STEP 4: VERIFICATION
├── Verify learning added correctly
├── Verify learning quality
├── Verify file integrity
├── Verify correct scope
└── Gate: All checks pass

Completion Announcement

When update is complete, announce:

CLAUDE.md updated.

**Quality Score: X/10**
- Learning Identification: X/2
- Scope Verification: X/2
- User Confirmation: X/2
- File Integrity: X/2
- Category Placement: X/2

**Learning Added:**
- Category: [category]
- Section: [section path]
- Learning: [brief description]

**File Updated:** CLAUDE.md

**Next steps:**
The learning will be active in future sessions.

Integration with Other Skills

The update-claude-learnings skill completes the learning system:

| Skill | Target | Audience |

|-------|--------|----------|

| update-agent-learnings | agent-learnings.md → agent files | Subagents writing code |

| update-skill-learnings | skill-learnings.md | Skill creators |

| update-claude-learnings | CLAUDE.md | Main Claude Code agent |

Complete Learning System:

Session reveals pattern
         │
    ┌────┼────────────────┐
    ▼    ▼                ▼
Subagent  Skill        Claude Code
pattern?  pattern?     behavior?
    │        │             │
    ▼        ▼             ▼
/update-  /update-     /update-
agent-    skill-       claude-
learnings learnings    learnings
    │        │             │
    ▼        ▼             ▼
agent-    skill-       CLAUDE.md
learnings learnings
.md       .md
    │
    ▼
Synced to
agent files

Workflow Chain:

Session reveals behavioral pattern
              │
              ▼
update-claude-learnings skill (this skill)
              │
              ▼
CLAUDE.md updated
              │
              ▼
Future sessions benefit from the rule

Examples

Example 1: Workflow Rule - Use Skills

Session Issue: Used git add && git commit instead of /commit skill.

Learning Extraction:

Result:

Added to CLAUDE.md under ## Workflow Rules > ### Use Available Skills

Example 2: Session Management

Session Issue: Complex task completed but no checkpoints provided.

Learning Extraction:

Result:

Added to CLAUDE.md under ## Workflow Rules > ### Session Management

Example 3: Project-Specific Behavior

Session Issue: Edited files in .claude/agents/ without running learnings sync.

Learning Extraction:

Result:

Added to CLAUDE.md under ## Behavioral Patterns

Example 4: Scope Redirect

Session Issue: User suggests adding "Run tests after code changes"

Analysis: This applies to subagents writing code, not main Claude Code behavior.

Action: Redirect to /update-agent-learnings instead of adding to CLAUDE.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.