index
Skill2 starsChanged 6 months agoMITView on GitHub
Build or refresh a vector index of the codebase at `.claude/state/codebase.db` for semantic search via `/search`. Opt-in for large codebases (>50k LOC); small projects get sufficient awareness from `.claude/state/architecture.md` + Grep
- Reads credentials
8 other projects use a version of this.
Adopted by
Most recently taken up by
- criptogus/brainstacktheir own version, first seen Aug 6, 2026
- codeboehm/maximtheir own version, first seen Jul 5, 2026
- sp-daewoon/chronicletheir own version, first seen Jun 3, 2026
- openai/pluginstheir own version, first seen May 13, 2026
- thoreinstein/obsidian-ragtheir own version, first seen Apr 11, 2026
- AnitChaudhry/10x-development-teamtheir own version, first seen Mar 22, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- openai/plugins★ 7.3ksame name
- benmarte/codemunch★ 7same name
- criptogus/brainstack★ 4same name
- sp-daewoon/chronicle★ 4same name
- thoreinstein/obsidian-rag★ 2same name
- AnitChaudhry/10x-development-team★ 0same name
- chanhyeok-made/ccx★ 0same name
- codeboehm/maxim★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- improveSkill
- teamSkill
- ccf-architecture-contractSkill
- ccf-build-and-envSkill
- ccf-change-controlSkill
- ccf-debugging-playbookSkill
- ccf-doc-sync-campaignSkill
- ccf-dogfood-and-driftSkill
- ccf-domain-referenceSkill
- ccf-failure-archaeologySkill
- ccf-onboarding-tourSkill
- ccf-parity-playbookSkill
- ccf-release-and-installSkill
- ccf-testing-and-qaSkill
- improveSkill
- teamSkill
- add-referenceSkill
- ai-updateSkill
- app-blueprintSkill
- buildSkill
- check-readinessSkill
- deploySkill
- developSkill
- draft-storySkill
- error-analyzeSkill
- factorySkill
- fetch-docsSkill
- generate-internal-appSkill
- impactSkill
- improveSkill
- iterative-reviewSkill
- merge-resolveSkill
- mock-endpointSkill
- planSkill
- promoteSkill
- refine-storySkill
- scaffold-design-systemSkill
- searchSkill
- setupSkill
- teamSkill
- skill-nameSkill
- update-trackerSkill
- validateSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Run bash .claude/hooks/codebase-index.sh stats first.
- Distinctive: line 62
After completion, surface to the user:
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Index — Build the Codebase Vector Index
For codebases where Grep + architecture.md aren't enough — typically >50k LOC — /index builds a SQLite + sqlite-vec index that powers /search. The index is gitignored, lives at .claude/state/codebase.db, and updates incrementally on subsequent runs.
Usage
/index full build (only files not yet indexed; subsequent runs are incremental)
/index --full force re-embed every file (use after changing chunking config)
/index --include='\.cls$|\.trigger$' index only Apex files (Salesforce)
/index --provider=local use Ollama local embeddings instead of Voyage/OpenAI
/index stats show index size, file count, age
/index purge delete the index entirelySetup
The index requires an embedding provider. Pick one before first run:
| Provider | Setup | Cost (1M LOC) | Quality | Privacy |
| voyage (default) | export VOYAGE_API_KEY=... (signup) | ~$2.50 one-time, $0.05/incremental commit | Best for code | API |
| openai | export OPENAI_API_KEY=... | ~$0.50 one-time | Good | API |
| local | ollama pull nomic-embed-text && ollama serve | Free, ~6hr initial on Mac | Lower | All local |
Configure via env vars (typically in .env or shell profile):
export CLAUDE_FRAMEWORK_EMBED_PROVIDER=voyage # or openai, local
export VOYAGE_API_KEY=<your-key>Process
Phase 1: Verify provider config
Run bash .claude/hooks/codebase-index.sh stats first. If no index, check $CLAUDE_FRAMEWORK_EMBED_PROVIDER and the corresponding API key. If unset, prompt the user to configure before proceeding.
Phase 2: Run the index command
bash .claude/hooks/codebase-index.sh index [args]The script:
- Walks the working tree via
git ls-files(respects.gitignore) - Filters by include globs (defaults to common code extensions; configurable via
--include) - For each file: computes git SHA, skips if already indexed at that SHA (incremental)
- Chunks the file into 40-line windows with 8-line overlap
- Embeds each chunk via the configured provider
- Stores
(file_path, line_start, line_end, content, sha, embedding)in SQLite
Streaming progress to stderr: indexing: <path> per file.
Phase 3: Report
After completion, surface to the user:
- Files indexed (count)
- Chunks created (count)
- DB size
- Time elapsed
- Cost estimate (if cloud provider)
Phase 4: Suggest next action
- First-time index: "Run
/search 'natural language query'to test the index. Try queries you'd otherwise grep for but can't ('where do we handle invoice numbers?')." - Incremental refresh: "Re-indexed N changed files in
<time>. Index is current."
State Files
| File | Purpose | Lifecycle |
.claude/state/codebase.db | SQLite index with chunks + embeddings | Built by /index; incremental on subsequent runs; purge with /index purge |
Gitignored under .claude/state/.
When /index Earns Its Place
| Project size | Recommendation |
| <10k LOC | Skip. Grep + architecture.md is sufficient. |
| 10-50k LOC | Optional. /search becomes useful for "where do we…" queries. |
| 50k-500k LOC | Recommended. Grep alone misses semantic neighbors. |
| 500k-5M LOC | Strongly recommended. The framework was extended for this scale specifically. |
| >5M LOC | Required. Plus consider GitNexus or similar for precise call graphs. |
Salesforce-Specific Notes
For a Salesforce org indexed via SFDX:
/index --include='\.cls$|\.trigger$|\.cmp$|\.html$|\.js$|\.flow-meta\.xml$'Tags Apex / LWC / Flow content distinctly (the chunk's file_path carries the metadata type via extension). Searches can filter:
/search "rate limit logic" --include=apexInitial index of a 1M-line org takes ~2-4 hours via Voyage; subsequent commits are seconds. Plan for "kick it off, walk away."
Edge Cases
| Scenario | Behavior |
| First run with no provider configured | Halt; tell user to set CLAUDE_FRAMEWORK_EMBED_PROVIDER and API key |
| API key unset for selected provider | Halt with the exact env var name |
git ls-files returns empty | Halt with "not in a git repo or no tracked files" |
| Chunking config changed | Pass --full to force re-embed |
| Network failure mid-index | Resume on re-run (incremental skip catches already-indexed files) |
| Hitting rate limits | Add sleep between API calls; configurable via CLAUDE_FRAMEWORK_INDEX_RATE_LIMIT (future) |
| Salesforce 1M+ LOC | Plan for hours; run in background (nohup ... &); check progress with /index stats |
Related
/search— query the index built by this skill.claude/state/architecture.md— broad map (refreshed by/improve); complements semantic search/impact— precise per-symbol cascade analysis (uses Grep, not the vector index)templates/hooks/codebase-index.sh— the bash engine
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

