Folding
A chat's context file grows by one turn record per turn. Folding keeps it short: old turns become one line each, written by the board's code, not by a model.
After a turn
When a turn ends, the board appends the turn's record to the file. If the file is then larger than the fold limit, every turn older than the newest few moves into # Earlier as one line:
Turns 1–4:
- Turn 1 · 2026-12-06 09:02 UTC: Add a reset button → The reset button is in, and the tests pass.
- Turn 2 · 2026-12-06 09:40 UTC: Make the digits larger on phones → Done: 64 px below 600 px wide.
Each line holds the turn's number and time, the message that started it (at most 140 characters), an arrow and the start of the reply (at most 140 characters). If the turn stopped without a reply, the line ends with the reason instead. The tool lines of folded turns are dropped.
Settings
Three numbers in Settings, under Board, control this for the workspace:
| Setting | Default | Range |
|---|---|---|
| Fold old chat turns past | 20,000 tokens | 2,000 to 400,000 |
| Chat turns kept in full | 8 | 1 to 100 |
| Agent steps per turn | 100 | 1 to 500 |
The limit is in tokens because the model is billed and limited in tokens. Providers report tokens for a whole request, never for the file alone, so the board estimates the file at 4 characters per token.
A step is one call to the model. A turn ends when the agent replies or when it has used all its steps.
The agent's own folding
The agent can fold earlier, with its checkpoint tool: it chooses how many recent turns to keep (0 to 200) and may write its own summary of the older ones instead of the generated lines. It can also rewrite # Earlier as a whole, up to 12,000 characters. Like any change to the file, this takes effect from the next turn.
During a turn
A long turn can come close to the model's context window on its own, for example when a test prints a lot of output. Before each step the board estimates the size of the previous request. Past a share of the model's window, 90% by default (about 180,000 tokens of a 200,000-token window), it folds in the middle of the turn:
- the tool output the model has already seen in this turn is replaced with one line saying whether the tool succeeded;
- the output the model has not seen yet stays whole;
- the opening is replaced with the current context file, so notes the agent saved earlier in the turn now apply.
The full output stays in the turn's trace. The fold shows as a line in that turn, under its reply, and as a step in the turn's details:
Context was getting full (182,400 tokens); earlier tool output in this turn was shortened to one-line records
The share is set per workspace in Settings > Board, as "Fold during a turn at", from 50% to 99% of the model's window. The board takes the window as 200,000 tokens for Claude models (1,000,000 for their long-context variants) and 272,000 for Codex models.