codebase-indexer
Skill9 starsChanged 7 months agoMITView on GitHub
Status: π’ ALWAYS ACTIVE - This skill runs automatically before ALL code-related tasks Auto-invoke: When user asks about codebase structure, wants to find files by concept, or needs semantic search through code. ALWAYS RUNS FIRST for any code work. Description: Smart codebase navigation system using semantic embeddings and token-efficient indexing. Enables concept-to-file mapping without reading entire codebase. Triggers: - "find files related to [concept]" - "where is [feature] implemented" - "show me codebase structure" - "search codebase for [concept]" -β¦
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- heyEdem/codebase-indexertheir own version, first seen Mar 10, 2026
Other versions1 project uses a version of this.
Word for word Β· 0
None found.
Edited Β· 0
None found.
Wrote their own version Β· 1
- heyEdem/codebase-indexerβ 18same 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 repository140 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- alex-hormozi-pitchSkill
- AlgorithmSkill
- AnnualReportsSkill
- ArtGeneratorSkill
- artSkill
- autoplanSkill
- autoresearchSkill
- benchmarkSkill
- brainstormingSkill
- brand-guidelinesSkill
- brightdataSkill
- browseSkill
- BugHunterSkill
- CallIntelligenceSkill
- canarySkill
- canvasSkill
- carefulSkill
- ceo-advisorSkill
- cfo-advisorSkill
- cmmcSkill
- codexSkill
- CodingAgentSkill
- company-valuesSkill
- connect-chromeSkill
- CORESkill
- system-createcliSkill
- CreateskillSkill
- csoSkill
- cto-advisorSkill
- CybersecurityPlaybooksSkill
- defuddleSkill
- design-consultationSkill
- design-reviewSkill
- DevTeamSkill
- DiscordAdminSkill
- document-releaseSkill
- document-writerSkill
- doraSkill
- dpdpaSkill
- EmailManagerSkill
- executing-plansSkill
- fabricSkill
- fedrampSkill
- ffuf-web-fuzzingSkill
- find-communitySkill
- first-customersSkill
- FirstPrinciplesSkill
- form-croSkill
- freezeSkill
- gdpr-complianceSkill
- git-worktreesSkill
- GovernanceSkill
- grow-sustainablySkill
- gstack-upgradeSkill
- guardSkill
- hipaa-complianceSkill
- investigateSkill
- iso27001Skill
- iso27701Skill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
β0
Common Β· estimate
Many files like this have a rule of this kind.
β5
Distinctive Β· estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Auto-invoke: When user asks about codebase structure, wants to find files by concept, or needs semantic search through code.
- Distinctive: line 131
Lazy Loading: Only read files when user explicitly requests
- Distinctive: line 133
Concept Pruning: Only index relevant concepts (exclude node_modules, etc.)
- Distinctive: line 134
Incremental Updates: Only reindex changed files
- Distinctive: line 135
Query Expansion: Use embeddings to find related terms without full text search
β βCommonβ is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. βVery specificβ is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codebase Indexer
Status: π’ ALWAYS ACTIVE - This skill runs automatically before ALL code-related tasks
Auto-invoke: When user asks about codebase structure, wants to find files by concept, or needs semantic search through code. ALWAYS RUNS FIRST for any code work.
Description: Smart codebase navigation system using semantic embeddings and token-efficient indexing. Enables concept-to-file mapping without reading entire codebase.
Triggers:
- "find files related to [concept]"
- "where is [feature] implemented"
- "show me codebase structure"
- "search codebase for [concept]"
- "how is [X] organized"
- "semantic search"
Core Capabilities:
- Semantic Indexing
- Generate embeddings for code concepts
- Map concepts to file paths
- Token-efficient summaries
- Incremental updates
- Smart Navigation
- Natural language queries
- Concept-based file discovery
- Dependency mapping
- Related code suggestions
- Token Optimization
- Compressed file summaries
- Lazy loading of file contents
- Cached embeddings
- Query result ranking
Implementation:
Phase 1: Index Codebase
1. Scan project structure (file extensions: .ts, .tsx, .js, .jsx, .py, .go, .rs, etc.)
2. Extract key concepts from:
- File/directory names
- Export/class/function names
- Comments and docstrings
- Import statements
3. Generate embeddings for each concept
4. Store concept β file mappings in JSON index
5. Cache embeddings for reusePhase 2: Semantic Search
Given user query: "authentication flow"
1. Generate embedding for query
2. Compare with concept embeddings (cosine similarity)
3. Rank results by relevance
4. Return top N files with context summaries
5. Offer to open files or provide deeper analysisPhase 3: Concept Mapping
Maintain bidirectional index:
- Concept β Files (which files implement this concept)
- File β Concepts (what concepts does this file contain)
- Dependencies (what other concepts/files are referenced)
- Usage graph (where is this concept used)Commands to Create:
# Build initial index
~/.claude/skills/codebase-indexer/build-index.sh
# Search codebase
~/.claude/skills/codebase-indexer/search.sh "your query"
# Update index (incremental)
~/.claude/skills/codebase-indexer/update-index.sh
# Show concept map
~/.claude/skills/codebase-indexer/concept-map.sh "concept-name"
# Index statistics
~/.claude/skills/codebase-indexer/stats.shIndex Structure:
{
"version": "1.0",
"last_updated": "2026-01-25T23:00:00Z",
"project_root": "/path/to/project",
"concepts": {
"authentication": {
"files": ["src/auth/login.ts", "src/middleware/auth.ts"],
"related_concepts": ["authorization", "session", "jwt"],
"summary": "JWT-based authentication with middleware support"
},
"database": {
"files": ["src/db/connection.ts", "src/models/*.ts"],
"related_concepts": ["orm", "migration", "query"],
"summary": "PostgreSQL with Prisma ORM"
}
},
"embeddings": {
"authentication": [0.123, 0.456, ...],
"database": [0.789, 0.234, ...]
},
"file_summaries": {
"src/auth/login.ts": {
"concepts": ["authentication", "jwt", "validation"],
"exports": ["login", "verifyToken"],
"imports": ["jsonwebtoken", "bcrypt"],
"line_count": 127,
"token_estimate": 3500
}
}
}Token Efficiency Strategies:
- Lazy Loading: Only read files when user explicitly requests
- Summaries: Store 2-3 sentence summaries instead of full content
- Concept Pruning: Only index relevant concepts (exclude node_modules, etc.)
- Incremental Updates: Only reindex changed files
- Query Expansion: Use embeddings to find related terms without full text search
Integration with Claude Code:
# Hook into Claude Code's pre-processing
~/.claude/hooks/codebase-indexer-hook.sh
β Runs before each session
β Detects if project has index
β Injects relevant context based on user query
β Updates index if files changed (git status)Dependencies:
- Python 3.10+ (for embeddings)
- sentence-transformers (pip install)
- Optional: OpenAI Embeddings API (for higher quality)
Error Handling:
- Fallback to grep if embeddings unavailable
- Graceful degradation if index missing
- Auto-rebuild if index version mismatch
Performance:
- Index build: ~10-30s for medium codebase (1000 files)
- Query: <1s for semantic search
- Incremental update: <5s for 10 changed files
Example Usage:
User: "Where is the payment processing logic?"
Skill executes:
1. Generate embedding for "payment processing logic"
2. Search index for similar concepts
3. Return:
- src/payments/stripe.ts (0.92 similarity)
- src/services/billing.ts (0.87 similarity)
- src/api/webhooks/stripe.ts (0.81 similarity)
4. Show summaries for each file
5. Ask: "Would you like me to analyze any of these files?"Outputs:
.codebase-index.json- Main index file.codebase-embeddings.npy- Cached embeddings (numpy)~/.claude/logs/codebase-indexer.log- Operation logs
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.

