[FEATURE] Incremental `CLAUDE.md` updates using last-scanned commit hash

Resolved 💬 1 comment Opened Jun 4, 2026 by MickLabree Closed Jul 8, 2026

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:

  1. Run git diff <hash>..HEAD to identify what changed
  2. Analyze only the diff rather than the full repo
  3. Merge updates into the relevant sections of the existing CLAUDE.md
  4. 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

  1. Developer runs /init on a large repo — CLAUDE.md is generated and hash a3f8c21 is stored
  2. Over the following week, 10 files are modified across a few commits
  3. Developer runs /init again to keep CLAUDE.md current
  4. Instead of rescanning the entire repo, Claude diffs from a3f8c21..HEAD, finds the changed files, and updates only the relevant sections
  5. Hash is updated to the new HEAD

Additional Context

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗