$npx -y skills add jamditis/claude-skills-journalism --skill claude-md-updaterUse this skill when the user asks to update CLAUDE.md, save a lesson, or persist something from the current session: phrases like "update claude.md", "what should we remember", "save this lesson", or "add to context". Scans the conversation for hard-won lessons, new file paths, i
| 1 | # CLAUDE.md auto-updater |
| 2 | |
| 3 | Analyze the current conversation to identify information worth persisting in CLAUDE.md for future sessions, then propose the edits for approval before writing anything. |
| 4 | |
| 5 | ## What to look for |
| 6 | |
| 7 | ### 1. Hard-won lessons |
| 8 | - Debugging sessions that revealed non-obvious causes |
| 9 | - Workarounds for platform or tool limitations |
| 10 | - Anti-patterns discovered through failure |
| 11 | - "The real problem was..." moments |
| 12 | |
| 13 | ### 2. New infrastructure |
| 14 | - New services deployed |
| 15 | - New endpoints or URLs |
| 16 | - New file paths or directories |
| 17 | - New credentials or tokens (reference only, never the values) |
| 18 | |
| 19 | ### 3. New workflows |
| 20 | - Commands that solve recurring problems |
| 21 | - Multi-step processes that work well |
| 22 | - Integration patterns between systems |
| 23 | |
| 24 | ### 4. Updated information |
| 25 | - Changed ports, IPs, or URLs |
| 26 | - New capabilities added to existing systems |
| 27 | - Deprecated or removed features |
| 28 | |
| 29 | ## Analysis process |
| 30 | |
| 31 | 1. **Scan the conversation** for keywords: |
| 32 | - "fixed", "solved", "the issue was", "turns out" |
| 33 | - "deployed", "set up", "configured", "installed" |
| 34 | - "new endpoint", "new service", "new path" |
| 35 | - "doesn't work", "limitation", "workaround" |
| 36 | |
| 37 | 2. **Categorize findings.** Only durable facts belong in CLAUDE.md: |
| 38 | - Hard-won lessons go to the "Hard-won lessons" section |
| 39 | - Infrastructure changes update the relevant section |
| 40 | - New workflows go to the appropriate section |
| 41 | - Transient, session-specific notes do **not** go in CLAUDE.md (see "What not to persist") |
| 42 | |
| 43 | 3. **Build the exact diff.** Produce a unified diff against the current CLAUDE.md showing the precise lines and sections to be added or changed. This diff is what the user approves, not a summary of it. |
| 44 | |
| 45 | 4. **Present the diff for approval** and write nothing until the user approves. |
| 46 | |
| 47 | ## Output format |
| 48 | |
| 49 | Show the exact patch first, then a short summary grouped by category: |
| 50 | |
| 51 | ```` |
| 52 | ## Proposed CLAUDE.md updates |
| 53 | |
| 54 | ```diff |
| 55 | --- a/CLAUDE.md |
| 56 | +++ b/CLAUDE.md |
| 57 | @@ section being changed @@ |
| 58 | existing context line |
| 59 | +new durable lesson, infra fact, or workflow |
| 60 | ``` |
| 61 | |
| 62 | Summary of the diff above: |
| 63 | - Hard-won lessons: [one line, if any] |
| 64 | - Infrastructure updates: [one line, if any] |
| 65 | - New workflows: [one line, if any] |
| 66 | |
| 67 | Apply this diff? Nothing is written until you approve. |
| 68 | ```` |
| 69 | |
| 70 | ## What not to persist |
| 71 | |
| 72 | CLAUDE.md is team-shared (checked into git) and advisory: it loads into every session, so it is for durable, infrequently-changing facts, not a running log. Per the project-memory skill, keep these **out** of CLAUDE.md: |
| 73 | |
| 74 | - Transient "what we did today" session summaries |
| 75 | - Anything that changes frequently |
| 76 | - Things Claude learns over time through corrections |
| 77 | |
| 78 | Route those to **auto memory** (`~/.claude/projects/<project>/memory/`, which Claude maintains on its own) or to a gitignored `CLAUDE.local.md` for personal notes. Putting them in CLAUDE.md bloats shared context and loads stale per-session facts into future sessions. |
| 79 | |
| 80 | ## Rules |
| 81 | |
| 82 | 1. **Never add sensitive values.** Reference where a credential is stored; never include the actual token. |
| 83 | 2. **Keep it concise.** CLAUDE.md should stay scannable; target under 200 lines. |
| 84 | 3. **Avoid duplication.** Check whether the information already exists before adding it. |
| 85 | 4. **Match the existing style.** Follow the tone and format of the current file. |
| 86 | 5. **Durable facts only.** Persist hard-won lessons, infrastructure facts, and workflows. Session-specific notes belong in auto memory or a gitignored `CLAUDE.local.md`, never the committed CLAUDE.md. |