code-context-engine icon indicating copy to clipboard operation
code-context-engine copied to clipboard

Critiical : Refresh the index regurlarly

Open arita37 opened this issue 7 months ago • 1 comments

@fazleelahhee thanks for the work !

Let the cce server refresh the index as follow:

 - Internal CRON: Daily at  03:00: time

      List of all file changes over the last 1 day
      Re-index those files.


``

Index freshness is CRITICAL for accuracy

arita37 avatar May 06 '26 12:05 arita37

CCE already keeps the index fresh through three mechanisms:

  1. Git hooks (installed by cce init): reindex runs automatically on every commit, checkout, and merge. Only changed files are re-processed (content-hash diffing), so this takes under 1 second.

  2. File watcher (cce watch): watches your project directory for file changes and reindexes in real-time. Run in a separate terminal for continuous updates.

  3. Lazy reindex on first query: if the MCP server detects recently modified files when you search, it triggers an incremental reindex before returning results.

A cron job on top of this would be redundant for most workflows since git hooks catch every meaningful code change. The gap is edits that haven't been committed yet, which cce watch covers.

If you're seeing stale results, check:

  • cce status shows the index exists and has chunks
  • Git hooks are installed: look for cce in .git/hooks/post-commit
  • Or run cce index manually after making changes

Is there a specific scenario where you're seeing stale results despite git hooks?

rajkumarsakthivel avatar May 07 '26 18:05 rajkumarsakthivel