Navigate hierarchical ai-docs indexes to find documentation. Check local docs FIRST for speed and curated context before web searching. Covers Claude Code, BAML, MCP, and other tracked libraries.
Navigate the hierarchical documentation system to find relevant context with minimal token usage.
| Variable | Default | Description |
|---|---|---|
| START_LEVEL | auto | auto, root, category, library, section, page |
| KEYWORD_MATCH | fuzzy | fuzzy (semantic) or exact matching for index navigation |
MANDATORY - Always start at the appropriate index level and drill down.
_index.toon files before loading pagespriority and when_to_use fields in indexesIf you're about to:
full-context.md for a simple questionSTOP -> Follow the Navigation Protocol below -> Then proceed
cookbook/level-selection.mdcookbook/keyword-matching.mdcookbook/page-loading.mdai-docs/
├── _root_index.toon # Level 0: All categories
├── libraries/
│ ├── _index.toon # Level 1: All libraries
│ ├── {library}/
│ │ ├── _index.toon # Level 2: Library sections
│ │ ├── {section}/
│ │ │ ├── _index.toon # Level 3: Section pages
│ │ │ └── pages/
│ │ │ └── {page}.toon # Level 4: Page summary
│ │ └── full-context.md # Everything (escape hatch)
| You Know | Start Here |
|---|---|
| Nothing | ai-docs/_root_index.toon |
| Category (libraries/frameworks) | ai-docs/{category}/_index.toon |
| Library name | ai-docs/libraries/{lib}/_index.toon |
| Library + section | ai-docs/libraries/{lib}/{section}/_index.toon |
| Exact page | ai-docs/libraries/{lib}/{section}/pages/{page}.toon |
Each index contains:
description or purpose - What this level containskeywords - Terms for matching your taskwhen_to_use - Guidance on when to drill deeperMatch your task against keywords:
Task: "Handle LLM retry failures"
Keywords to find: retry, error, failure, fallback, timeout
Navigate:
1. libraries/_index.toon -> "baml" has "llm|structured-output"
2. baml/_index.toon -> common_tasks mentions "error handling"
3. baml/guide/_index.toon -> "error-handling" page has "retry|fallback"
4. baml/guide/pages/error-handling.toon -> Exact info needed
DO:
@ai-docs/libraries/baml/guide/pages/error-handling.toon # ~400 tokens
DON'T:
@ai-docs/libraries/baml/full-context.md # ~15,000 tokens
For complex tasks, load several specific pages:
@ai-docs/libraries/baml/guide/pages/error-handling.toon
@ai-docs/libraries/baml/guide/pages/timeouts.toon
@ai-docs/libraries/baml/reference/pages/retry-policy.toon
Still far cheaper than full-context.md.
Only for:
_index.toon)