Index files/directories into context-mode

VerifiedCaution

Index a local file or directory into context-mode's FTS5 knowledge base for targeted retrieval via ctx_search.

Sby Skills Guide Bot
Data & AIBeginner
8/29/2026
Claude CodeCursor
#context-management#indexing#full-text-search#mcp#retrieval

Recommended for

Automated summary

Indexes a local file or directory into context-mode's persistent FTS5 knowledge base so later ctx_search calls can pull focused snippets instead of rereading raw files.

Strengths

  • Passes a path instead of inline content, keeping file bytes out of the conversation
  • Recommends conservative bounds (maxDepth, maxFiles) and exclusions for noisy directories
  • Falls back to the CLI (context-mode index) when MCP tools are unavailable
  • Reports the source label, file or section counts, and the matching ctx_search command at the end

Limitations

  • Requires the context-mode MCP server or CLI to be installed locally
  • Retrieval is FTS5 keyword matching, not semantic similarity search
  • No incremental reindexing is described, so the index can go stale as content changes
When to use it

Use it when you expect to query a repo or docs folder repeatedly without rereading source files for each question.

When not to use it

Skip it for a one-off read of a single small file, or when you need semantic/vector retrieval rather than keyword search.

Security analysis

Caution
Quality score85/100

The skill performs local indexing via MCP or CLI, a legitimate file-access operation. The main risk is command execution via the fallback CLI and potential inclusion of secrets if the user provides a broad path without exclusions.

Findings
  • •Fallback uses a bash command without a declared allowed-tools entry, which could execute arbitrary context-mode CLI operations if path or flags are manipulated.
  • •Indexing local directories may inadvertently include sensitive files unless exclusions are strictly applied; the skill advises exclusions but does not enforce them.
How this analysis is made

Examples

Index the current repo
Index this repository into context-mode so I can search it later. Use a conservative file limit and label the source as project:my-app.
Index a docs folder
Index the docs/ directory into context-mode under the source project:handbook, and skip any build output folders.
Search what was indexed
Search the indexed source project:my-app for how authentication tokens are refreshed.

name: ctx-index description: | Index a local file or directory into context-mode's persistent FTS5 knowledge base so future ctx_search calls can retrieve focused snippets without rereading raw files. Trigger: /context-mode:ctx-index user-invocable: true

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.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/index-files-directories-into-context-mode-mte1lj9v/download' --output '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md.part' && mv '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md.part' '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md' && test -s '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ctx-index' && cp -R '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v' '.claude/skills/ctx-index'

Cursor
test -f '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md' && test -s '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/ctx-index' && cp -R '.skill-downloads/index-files-directories-into-context-mode-mte1lj9v' '.cursor/skills/ctx-index'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/index-files-directories-into-context-mode-mte1lj9v'

openskills read 'index-files-directories-into-context-mode-mte1lj9v'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/index-files-directories-into-context-mode-mte1lj9v/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills