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
| Flag | Description | Required | Default |
|---|---|---|---|
--task <task> | Description of the current task (used for semantic search) | No | -- |
--scope <scope> | How much context to include | No | relevant |
--budget <tokens> | Approximate token budget for the context pack | No | 4000 |
Scope values
| Scope | Description |
|---|---|
relevant | Semantic search for task-related items only (default) |
full | Complete brain document, truncated to budget |
minimal | Top 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:
- Sends the task description to the V2 semantic search engine
- Retrieves memory items ranked by relevance to the task
- Assembles a markdown document from the most relevant items
- 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 memorywhen you want targeted context rather than the full brain. - The
relevantscope is most useful when your project brain is large and you want to minimize token usage while maximizing relevance. - The
minimalscope is ideal for quick tasks where you only need the most essential project knowledge. - Without
--task, the command defaults to therelevantscope but may return broader results since there is no task to focus the search on.