/codemap:codemapfrom codemap
Navigates codebases using structural indexes to find symbol definitions (classes, functions, methods) and explore file structure. Reduces token usage by reading targeted line ranges instead of full files.
Ships in codemap. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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 (works with .ts, .yaml, .md, etc.)
codemap show path/to/file.ts
codemap show config.yaml
codemap show docs/README.md
# 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 |
module | Ruby module |
singleton_method | Ruby singleton/class method |
key | YAML key/section |
section | Markdown H2 header |
subsection | Markdown H3 header |
subsubsection | Markdown H4 header |
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
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub azidan/codemap --plugin codemapOther plugins' skills for the same job