技能 编程开发 本地项目内容索引

本地项目内容索引

v20260601
ctx-index
该工具可将本地文件或目录内容索引到一个持久化的知识库中。这样做能确保后续的搜索操作无需重新读取原始文件,就能高效地检索出项目中的相关、聚焦的代码片段或信息。适用于大型代码库的知识组织和高效检索。
获取技能
134 次下载
概览

Context Mode Index

Index local project content for later search.

Instructions

  1. Prefer the ctx_index MCP tool when it is available.
  2. Ask for a path only if the user did not provide one and the current project root is ambiguous.
  3. Use path, not large inline content, so file bytes do not enter the conversation.
  4. For repository indexing, pass conservative bounds and a clear source label:
ctx_index({
  path: ".",
  source: "project:<name>",
  maxDepth: 5,
  maxFiles: 200
})
  1. If MCP tools are unavailable, fall back to the CLI:
context-mode index . --source project:<name>
  1. 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 --exclude or exclude for project-specific noisy paths.
  • For broad repos, ask the user before raising maxFiles above 500.
信息
Category 编程开发
Name ctx-index
版本 v20260601
大小 1.28KB
更新时间 2026-06-03
语言