Code FlowDocs
GitHub ↗

Context and budgets

Open Context inspector before starting a run. Review file sources, omissions and size estimates; select individual modified files when you need the current working copy included.

Check what you are sending

The composer’s Context inspector previews explicit repository selections and attachment metadata before a run. Folder selections expand tracked files from the chosen committed base. Current modified or uncommitted descendants are not implicitly copied by a folder selection; select those individual files to stage their current copies. Explicit file previews use the current file where present and fall back to the selected base when it is missing locally. Each preview identifies its source and content hash.

Inspection is bounded to 50 selections, 200 result entries, 512 KiB per text file and 8 MiB of inspected text. Larger, binary, invalid UTF-8, symbolic and Git LFS material is reported as omitted. Credential names and Git internals are not previewed. Per-file sizes and approximate text-token counts are shown with aggregate inspected, omitted and attachment bytes. Unscanned file sizes and binary/image tokens remain unknown. Uploaded text estimates use byte size; uploaded contents are not sent to the inspector again.

Potential credential paths such as .env, private-key files, credential stores and .git are also rejected by actual context preparation and message attachment staging. A preview omission is not the sole defense. Selecting a symbolic file, a symbolic ancestor or a base symlink/submodule is refused before copying. Preview redaction only hides recognized secret patterns from this display; it does not rewrite other repository files. Agents can still read files already in their worktree according to their existing permissions.

Reference files are not pasted wholesale into prompts: the assembled request identifies their locations so agents can read them. Consequently, reference-file estimates and invocation-input budgets measure different things.

Enable an explicit Invocation context budget to choose a byte ceiling, an approximate token ceiling, or both. Its policy either records a warning or stops the run before a provider launch. Budgets default to unset and never infer a provider’s context-window size. The server measures the fully assembled per-turn prompt (including notes and selected memory already added by code-flow) plus its explicit JSON schema immediately before the adapter is invoked. A blocked attempt does not launch a CLI. Retrying with the same exceeded ceiling will block again; deliberately choose a suitable budget for a new run. Retries and fresh-session fallbacks are measured again with their actual current prompt.

Saved team presets capture this budget, including previous revisions and library import/export. Applying an older preset without a budget clears a current ceiling. The Effective settings inspector identifies the browser preference or exact preset revision that supplied the current budget. Version 1 preset libraries remain compatible when the optional contextBudget field is absent.

Evidence records exact UTF-8 prompt/schema byte counts, their aggregate, an approximate token count of one token per four bytes, a content hash, resumed-session status, exclusions and any exceeded ceilings. Prompt bodies are not duplicated into this size evidence. Earlier CLI conversations, hidden provider system instructions, protocol wrappers, tool outputs, later file reads, and image/audio tokenization are outside this measurement. An approximate guard cannot guarantee that the provider’s complete context fits its window.

POST /api/workspace/context accepts {repo,baseRef?,paths,attachments?:[{name,size}]} and returns source-labeled file results, attachment metadata, byte/token aggregates, omissions and limits. Run settings carry loop.contextBudget = {maxPromptBytes?,maxApproximateTokens?,policy:'warn'|'block'}. Both ceilings require positive bounded integers. The warning and block policies are enforced on the server and persisted with per-step input-size evidence.


Documentation library · Getting started · Local app help

Search documentation