Index updater
Multi-agent orchestration plugin for Claude Code — 11 AI agents with intelligent model routing, 3-layer codebase indexing, and auto skill injection
npx -y skills add d3x293/code-crew --skill index-updaterAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 13 stars13 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Keeps the 3-layer codebase index fresh after file edits. Performs incremental updates by recomputing hashes and re-extracting metadata for only changed files.
SKILL.md
4.2 KB, as published. Nobody here has run it
Index Updater - Incremental Index Maintenance
Keeps .claude/crew-index.json and .claude/crew-symbols.json up-to-date after code changes without rebuilding the entire index.
When to Activate
- After any agent makes file edits (triggered by afterFileEdit hook or agent self-reporting)
- When an agent notices the index is stale (hash mismatch)
- Manually via
/crew reindexfor full rebuild
Incremental Update Process
Step 1: Identify changed files
The agent that made changes should report which files were modified. Alternatively, check file hashes:
For each file in crew-index.json:
1. Compute current hash: shasum -a 256 <filepath>
2. Compare with stored hash
3. If different → mark for update
4. If file deleted → mark for removal
Step 2: Update Layer 1 (crew-index.json)
For each changed file:
- Read the file
- Recompute: hash, size, lines, exports, imports, functions, classes
- Regenerate summary
- Replace the file's entry in crew-index.json
For deleted files:
- Remove the file's entry from crew-index.json
For new files (detected via Glob that aren't in index):
- Read and extract full metadata
- Add new entry to crew-index.json
Step 3: Update Layer 2 (crew-symbols.json)
For each changed file:
- Re-extract all symbols (functions, classes, methods) with signatures and line ranges
- Re-scan for calls to known symbols
- Update calledBy relationships for affected symbols in other files
- Replace all symbols for this file in crew-symbols.json
- Rebuild affected callGraph entries
Step 4: Update global metadata
- Recompute contentHash from all file hashes
- Update stats (totalFiles, totalLines)
- Update lastIndexed timestamp
Performance Rules
- Never rebuild entire index for a single file change
- Batch updates: If 3+ files changed in one edit cycle, update all at once
- Skip non-source files: Don't index changes to .json, .md, .yml unless they're in the monitored set
- Lazy callGraph: Only rebuild callGraph edges that involve the changed file
Agent Self-Reporting Protocol
Every agent prompt includes this instruction:
After making any file changes, report them for index update:
"FILES_MODIFIED: src/parser.js, src/scraper.js"
The orchestrator will trigger incremental index update for these files.
This is more efficient than hash-checking every file after every edit.
Staleness Detection
If an agent reads the index and finds information that doesn't match reality:
- The symbol doesn't exist at the listed line range
- A file listed in the index doesn't exist
- A function's signature has changed
Then: trigger incremental update for that specific file before proceeding.
Batch Update from Orchestrator
When called by the execution-orchestrator with a list of modified files after task completion:
Input: Deduplicated list of file paths reported by agents via FILES_MODIFIED
Process:
- For each file in the list:
- If file exists: Re-read the file, recompute SHA-256 hash, re-extract metadata (exports, imports, functions, classes, lines, summary). Replace the file's entry in
crew-index.json(Layer 1) and re-extract all symbols with signatures and line ranges forcrew-symbols.json(Layer 2). - If file was deleted: Remove the file's entry from both
crew-index.jsonandcrew-symbols.json. - If file is new (not in index): Read and extract full metadata, add new entry to both Layer 1 and Layer 2.
- If file exists: Re-read the file, recompute SHA-256 hash, re-extract metadata (exports, imports, functions, classes, lines, summary). Replace the file's entry in
- Rebuild affected
callGraphedges — only edges involving the changed files, not the entire graph - Update
calledByrelationships for symbols in other files that reference changed symbols - Update global metadata: recompute
contentHashfrom all file hashes, updatestats.totalFiles,stats.totalLines, setlastIndexedto current timestamp
Output: Report "{N} files updated, {M} new, {K} removed" back to the orchestrator
Performance: This should complete quickly for typical task outputs (1-10 files). For 10+ files, consider batching the Layer 2 symbol re-extraction.