Skip to content

contox context

Build a focused context pack via V2 semantic search. Instead of loading the entire project brain, this command retrieves only the memory items most relevant to a specific task, keeping token usage efficient.

Usage

bash
contox context [options]

Options

FlagDescriptionRequiredDefault
--task <task>Description of the current task (used for semantic search)No--
--scope <scope>How much context to includeNorelevant
--budget <tokens>Approximate token budget for the context packNo4000

Scope values

ScopeDescription
relevantSemantic search for task-related items only (default)
fullComplete brain document, truncated to budget
minimalTop 5 highest-confidence items

Examples

Get context for a specific task:

bash
contox context --task "implement OAuth2 login flow"

Get minimal context:

bash
contox context --task "fix CSS layout bug" --scope minimal

Get full brain with a larger budget:

bash
contox context --scope full --budget 8000

Task-focused context with tight budget:

bash
contox context --task "add pagination to the users API" --budget 2000

How it works

When a --task is provided with relevant scope, the command:

  1. Sends the task description to the V2 semantic search engine
  2. Retrieves memory items ranked by relevance to the task
  3. Assembles a markdown document from the most relevant items
  4. Truncates to fit within the specified token budget

If semantic search is unavailable, the command falls back to the full brain document.

Notes

  • This command is an alternative to contox memory when you want targeted context rather than the full brain.
  • The relevant scope is most useful when your project brain is large and you want to minimize token usage while maximizing relevance.
  • The minimal scope is ideal for quick tasks where you only need the most essential project knowledge.
  • Without --task, the command defaults to the relevant scope but may return broader results since there is no task to focus the search on.