Index Content
ctx_indexIndex documentation or knowledge content into a searchable BM25 knowledge base. Chunks markdown by headings, storing only a brief summary to preserve LLM context. Retrieve specific sections on demand using search.
Instructions
Index documentation or knowledge content into a searchable BM25 knowledge base. Chunks markdown by headings (keeping code blocks intact) and stores in ephemeral FTS5 database. The full content does NOT stay in context — only a brief summary is returned.
WHEN TO USE:
Documentation from Context7, Skills, or MCP tools (API docs, framework guides, code examples)
API references (endpoint details, parameter specs, response schemas)
MCP tools/list output (exact tool signatures and descriptions)
Skill prompts and instructions that are too large for context
README files, migration guides, changelog entries
Any content with code examples you may need to reference precisely
After indexing, use 'ctx_search' to retrieve specific sections on-demand.
When path is provided, a content hash is stored for automatic stale detection in search results.
Do NOT use for: log files, test output, CSV, build output — use 'ctx_execute_file' for those.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Raw text/markdown to index. Provide this OR path, not both. | |
| path | No | File path to read and index (content never enters context). Provide this OR content. | |
| source | No | Label for the indexed content (e.g., 'Context7: React useEffect', 'Skill: frontend-design') |