[FEATURE] Incremental `CLAUDE.md` updates using last-scanned commit hash
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Running /init on a repo that already has a CLAUDE.md rescans the entire codebase from scratch every time. For large repositories this is expensive and slow, even when only a handful of files have changed since the last run. There's no way to do an incremental update, /init always treats the repo as if it's never been scanned before.
Proposed Solution
When /init generates or updates CLAUDE.md, store the current commit hash inside the file (e.g. as an HTML comment):
<!-- last-init: a3f8c21 -->
On subsequent /init calls, if this hash is detected:
- Run
git diff <hash>..HEADto identify what changed - Analyze only the diff rather than the full repo
- Merge updates into the relevant sections of the existing
CLAUDE.md - Update the stored hash to the new
HEAD
If no hash is found (first run, or manually removed), fall back to the current full-scan behavior.
Alternative Solutions
Currently the only option is re-running /init and accepting the full rescan cost, or manually editing CLAUDE.md by hand after changes.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- Developer runs
/initon a large repo —CLAUDE.mdis generated and hasha3f8c21is stored - Over the following week, 10 files are modified across a few commits
- Developer runs
/initagain to keepCLAUDE.mdcurrent - Instead of rescanning the entire repo, Claude diffs from
a3f8c21..HEAD, finds the changed files, and updates only the relevant sections - Hash is updated to the new
HEAD
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗