Build persistent CODEBASE.md in the vault for a project. Explores the codebase structure, conventions, and architecture. Use when the user says "index codebase", "map codebase", or "/index-codebase <project>". Takes a project name as argument.
Explore a project's codebase and produce a comprehensive CODEBASE.md reference in the vault.
The user provides a project name (e.g., my-app, api-server).
Map to codebase path and vault path using the Project-Codebase Mapping table in CLAUDE.md (always in system prompt), or from agent-os.config.json.
If the project name doesn't match any entry in the mapping, ask the user to provide the codebase path.
Use the Explore subagent (Task tool with subagent_type=Explore, thoroughness="very thorough") to analyze:
Read <vaultPath>/<projectVaultFolder>/CODEBASE.md if it exists.
Write to <vaultPath>/<projectVaultFolder>/CODEBASE.md:
---
date: YYYY-MM-DD
tags: [codebase, index, <project-name>]
auto-generated: true
---
# <Project Name> — Codebase Index
> Auto-generated by `/index-codebase`. Last updated: YYYY-MM-DD
## Overview
[1-2 sentence description of what this project does and its tech stack]
## Structure
<tree output, 2-3 levels deep, annotated>
## Dependencies
| Package | Version | Purpose |
|---|---|---|
| ... | ... | ... |
## Entry Points
- **Main**: `path/to/main` — [description]
- **CLI**: `path/to/cli` — [if applicable]
- **API**: `path/to/routes` — [if applicable]
## Architecture
[Description of the architecture pattern: MVC, service layer, etc.]
### Key Files
| File | Purpose |
|---|---|
| ... | ... |
## Configuration
| Env Variable | Purpose | Default |
|---|---|---|
| ... | ... | ... |
## Code Conventions
- [naming patterns, file naming, import style]
- [error handling approach]
- [logging approach]
## Tests
- Framework: [jest/pytest/etc]
- Location: [path]
- Run: [command]
## Known Issues / TODOs
- [ ] [TODO items found in code]
## Changelog
- YYYY-MM-DD: Initial index
After writing, display a brief summary:
Codebase indexed: <project>
Written to: <vaultPath>/<projectFolder>/CODEBASE.md
Files scanned: N
Key findings: [1-2 notable things about the codebase]
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer