Search and index

Search and indexing: find any output again

Context Mode Engine puts every large output, file, folder and web page you index into one SQLite FTS5 database (SQLite full-text search) per project, on your machine. When you need that test log or that doc page again, the agent calls ctx_search and gets the five best matching parts back in 1.7 ms median.

Free · Local · Private · Forever

Context Mode Engine is source-available under the Elastic License 2.0. Free to use, for all time. It runs on your machine and keeps your data in ~/.context-mode.

Key facts

What it is
Two tools of the free plugin: ctx_index stores a file, a folder, a text or a URL, and ctx_search finds the matching parts again.
Who it is for
Anyone whose agent needs an answer from output it saw earlier in the session, or from docs it reads again and again.
Agents
All ten agents that run the plugin. The list is on Agents.
Measured result
ctx_search answers in 1.7 ms median (range 1.6-2.0 ms), 5 runs of 20 queries over 8 indexed files; ctx_index stores 155 ms per MB of real files (benchmark, 2026-10-31).
Scope
One database per project in ~/.context-mode/projects/. Search covers this session, this worktree (the default) or the whole project.

The answer was in that log ten minutes ago

Your agent ran the tests, read a long log and moved on. Now you ask about one error in that log. The agent runs the tests again or reads the whole file again. That costs time and fills the context window with the same bytes twice.

Context Mode Engine keeps that output for you. The agent asks a short question and reads back only the part that answers it.

What goes into the index

The index fills in two ways.

The Engine cuts each item into chunks of at most 4,096 B. A Markdown chunk stays inside one heading section and carries its heading path as its title. A code block that fits in one chunk stays whole.

All of it goes into ~/.context-mode/projects/<projectKey>/context.db, one file per project, outside your repo. ctx_index stores 155 ms per MB, median of 5 runs over 3 real files of 0.6 MB (raw results, line 120).

What ctx_search gives back

One search matches words and names at the same time, so timeout also finds "timed out" and authMid finds src/authMiddleware.ts, and the agent gets back the best matching parts, each with its source label.

  1. Hits from the current session come first, then the rest by score.
  2. When a word matches zero rows, it tries a spelling fix from the words in the index.
  3. It returns 5 hits per reply. Each snippet is at most 800 B, or a whole code block of at most 2,048 B. A More: line gives the call for the next page.

A search takes 1.7 ms median (range 1.6-2.0 ms), 5 runs of 20 queries over 8 indexed files (raw results, line 119).

Each hit line names its source and chunk number. Here is the shape of a reply, with example labels:

Query "timeout":
test-output #4: Error in api/retry.test.ts: request timeout after 5000 ms ...
docs/api.md #12: ## Retries  Each call waits 5,000 ms, then ...
More: ctx_search({queries:["timeout"], offset:5})

Pick a scope

ScopeWhat it searches
sessionThis session only
worktreeThis worktree, all sessions (the default)
projectEvery worktree of this project

Other inputs: source picks one item by its label, sort:"timeline" lists hits oldest first, and source:"decision" searches only the rows where you answered a question.

What you get

The agent finds an earlier answer with one short call and reads a few hundred bytes in place of the whole log. Your index stays on your disk. The Engine deletes an item after 30 days with zero reads, keeps each project at 500 MB or less, and ctx_purge deletes a session, a source or a whole project when you ask.

Prompts to give your agent

Paste one into your agent. Each prompt shows in full.

Prompt
Index the docs folder with ctx_index, then answer my next questions with ctx_search.
Prompt
Search the earlier test output with ctx_search for "timeout" and show the top hit.

Get started free

Context Mode Gateway: your coding agent costs less and remembers your project. Context Mode Engine installs from your terminal.

After you sign in, the console gives you one command to connect your coding agent.

Read the docs