> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duckbrain.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# context

> Assemble a prompt-ready context block, filled to a budget

```bash theme={null}
duckbrain context "<query>" [--budget 4000] [--mode ...] [facets]
```

The payload view: takes the top-ranked hits and assembles a markdown block (`## title (path)` + snippet per hit), filling top-down until the character budget is reached. Designed to be pasted into a prompt or consumed directly by an agent.

`search` is for scanning and picking; `context` is for feeding a model. Same facets and modes apply to both.


## Related topics

- [For Agents](/agents.md)
