Skip to content

Instantly share code, notes, and snippets.

@portdeveloper
Created January 6, 2026 13:10
Show Gist options
  • Select an option

  • Save portdeveloper/aa107908bd0717f9dde069aa25f0be59 to your computer and use it in GitHub Desktop.

Select an option

Save portdeveloper/aa107908bd0717f9dde069aa25f0be59 to your computer and use it in GitHub Desktop.
Claude Code skill: Auto-update CLAUDE.md on every commit
name description
update-claude-md
ALWAYS keep CLAUDE.md updated - both project structure AND learnings/corrections. Automatic on every commit.

Keep CLAUDE.md Updated

CLAUDE.md is the source of truth for how to work in this codebase. It contains:

  • Project structure and architecture
  • How to run, build, deploy
  • Corrections and learnings (things Claude got wrong and shouldn't repeat)

On Every Commit

  1. Make the commit for the user's changes
  2. Check if CLAUDE.md needs updating
  3. If yes: Update it, then make a SEPARATE commit with message "Update CLAUDE.md"

When to Update

Structure changes:

  • New files, directories, or architecture
  • New APIs, commands, or interfaces
  • Changes to setup, build, or deployment
  • New environment variables

Learnings and corrections:

  • User corrected a mistake → add to CLAUDE.md so it doesn't happen again
  • Discovered a project convention → document it
  • Found a gotcha or edge case → note it

When NOT to Update

  • Bug fixes that don't change architecture
  • Minor refactors
  • Dependency bumps

Rules

  • Keep updates minimal
  • Maintain existing format
  • If no CLAUDE.md exists, create one
  • CLAUDE.md update is ALWAYS a separate commit
  • When user corrects you, ask: "Should I add this to CLAUDE.md?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment