From codemap
Navigates codebases using .codemap/ structural indexes to find symbol definitions (classes, functions, methods), explore file structures, and locate code by name. Enables targeted line-range reads to reduce token consumption.
npx claudepluginhub azidan/codemapThis skill is limited to using the following tools:
Navigate codebases efficiently using pre-built structural indexes stored in `.codemap/` directories.
Uses tree-sitter index for code navigation in Rust, Python, TypeScript, JavaScript, Go, Java, Scala, SQL: finds symbols, reads function implementations, traces callers, discovers tests.
Performs token-optimized structural code search using tree-sitter AST parsing to discover symbols, outline files, and unfold code without reading full files.
Searches codebases semantically with natural language queries to find implementations by concept (e.g., 'where is X', 'how does Y work'). Returns file paths, lines, and snippets.
Share bugs, ideas, or general feedback.
Navigate codebases efficiently using pre-built structural indexes stored in .codemap/ directories.
USE CodeMap when:
READ full files when:
# Find a symbol by name (case-insensitive)
codemap find "SymbolName"
# Filter by type
codemap find "handle" --type method
codemap find "User" --type class
codemap find "Config" --type interface
# Fuzzy search (word matching, typo tolerance, docstring search)
codemap find "user service" --fuzzy
codemap find "pricng" --fuzzy # Handles typos
# Show file structure with all symbols
codemap show path/to/file.ts
# Check if index is up-to-date
codemap validate
# View index statistics
codemap stats
codemap find "UserService"
Output:
src/services/user.ts:15-189 [class] UserService
(config: Config)
Instead of reading the entire file, read just lines 15-189:
Read src/services/user.ts lines 15-189
codemap show src/services/user.ts
Output:
File: src/services/user.ts (hash: a3f2b8c1)
Lines: 542
Language: typescript
Symbols:
- UserService [class] L15-189
- constructor [method] L20-35
- getUser [method] L37-98
(userId: string) : Promise<User>
- createUser [async_method] L100-145
(data: CreateUserDto) : Promise<User>
| Type | Description |
|---|---|
class | Class declaration |
function | Function declaration |
method | Class method |
async_function | Async function |
async_method | Async class method |
interface | TypeScript interface |
type | TypeScript type alias |
enum | Enum declaration |
The .codemap/ directory mirrors the project structure:
.codemap/
├── .codemap.json # Root manifest
├── _root.codemap.json # Files in project root
├── src/
│ ├── .codemap.json # Files in src/
│ └── services/
│ └── .codemap.json # Files in src/services/
For programmatic access, read the JSON files directly:
cat .codemap/src/services/.codemap.json
Before trusting cached line numbers (especially after context compaction):
codemap validate path/to/file.ts
codemap updateIf a project doesn't have a .codemap/ directory:
python3 --version && pip --version# Install codemap from GitHub (NOT from PyPI - there's a different package there)
pip install git+https://github.com/AZidan/codemap.git
# Initialize index
codemap init .
# Optional: Install git hooks for auto-updates
codemap install-hooks
IMPORTANT: Do NOT use pip install codemap - that installs a different package from PyPI. Always use the GitHub URL above.
codemap find before grep/glob--fuzzy when exact search fails: If codemap find returns nothing, retry with --fuzzy for broader matchingcodemap validate before trusting cached line numberscodemap show to understand file layout before diving inTask: "Fix the authentication bug in the login handler"
# 1. Find relevant symbols
codemap find "login"
# → src/auth/handlers.ts:45-92 [function] handleLogin
# 2. Check file structure
codemap show src/auth/handlers.ts
# Shows handleLogin and related functions with line ranges
# 3. Read only the relevant function (lines 45-92)
# ... make your fix ...
# 4. If you need related code, find it
codemap find "validateToken"
# → src/auth/utils.ts:12-38 [function] validateToken
# 5. If exact search misses, try fuzzy
codemap find "auth middleware" --fuzzy
# → src/auth/middleware.ts [file]
# → src/auth/handlers.ts:10-25 [function] authenticateRequest