refresh_index
Aligns the full-text search index with on-disk files. Reindexes changed content, ingests new markdown files, and removes stale entries for deleted files.
Instructions
Reconcile the FTS index against disk. For a project (project_id set), re-runs discoverFiles. For the KB (project_id null/omitted), walks knowledge/, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent — running twice is a near no-op. Skips files >5MB and standard junk dirs (node_modules, .git, dist, build, etc.). No external auth or rate limits. Returns {scope, newly_indexed, refreshed, pruned}. Use after editing files outside CtxNest, or when diff_against_disk reports drift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project ID. Pass null or omit to reindex the Knowledge Base. |