About ctx-index
ctx-index is a skill for indexing local project content for later search, using the `ctx_index` MCP tool or the `context-mode` CLI. It guides safe indexing with file and depth limits, exclusions for noisy or sensitive paths, and reporting of the indexed source and counts.
Key features
- 01Index local project content
- 02Prefer the `ctx_index` MCP tool
- 03Fall back to the CLI
- 04Set bounds and exclude paths
- 05Report source and indexed counts
Use cases
- 01Prepare a repository for later searches
- 02Avoid indexing secrets or generated files
MCP support
Prefers the `ctx_index` MCP tool to index a path; if MCP tools are unavailable, it uses the `context-mode index` CLI command.
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ mksglu/ context-mode --skill ctx-indexAfter installing, type/ctx-indexin Claude Code to confirm it loaded.
Details
From the project READMEContext Mode Index
Index local project content for later search.
Instructions
- Prefer the
ctx_indexMCP tool when it is available. - Ask for a path only if the user did not provide one and the current project root is ambiguous.
- Use
path, not large inlinecontent, so file bytes do not enter the conversation. - For repository indexing, pass conservative bounds and a clear source label:
ctx_index({
path: ".",
source: "project:<name>",
maxDepth: 5,
maxFiles: 200
})
- If MCP tools are unavailable, fall back to the CLI:
context-mode index . --source project:<name>
- Report the indexed source label, file count or section count, and the matching search command:
ctx_search({ source: "project:<name>", queries: ["..."] })
Safety
- Do not index dependency directories, build outputs, secrets, or generated artifacts.
- Prefer
--excludeorexcludefor project-specific noisy paths. - For broad repos, ask the user before raising
maxFilesabove 500.
Comments
Markdown supported