Use Lookout
Context and compaction
What the agent sees in a chat, how to add files and images to it, and how Lookout keeps long chats within the model's context.
The agent sees the chat so far, what you mention or attach, and what its own tools read. A chat also starts with your project's rules files, your memory (while Settings › Memory › Use memory is on), the skills the agent can use, and a few facts about the workspace: its folders, whether it's a git repository, your system and today's date.
Mention files, chats and more
Type @ in the message box and pick from the list, or keep typing to search it. ↑ and ↓ move, ⏎ inserts, Esc closes. The list groups Recent, Agents, Files, Chats, Projects and Skills.
| Mention | What the agent gets |
|---|---|
| A file | Its text, up to 20,000 characters, and where to read the rest |
| A folder | A list of what's in it |
| A chat | Its title and state, where to read its history, and how to send it a message |
| A project | Its folders, and where to read its chats |
| A skill | The skill's instructions |
| An agent | Who that agent is, in an agent's chat in the Mac app |
You can also type a path after @, such as @src/app.ts, and send it as it is: it attaches like a picked file.
- A mention is read once, when you send. A later edit or rename changes nothing already sent.
- A message takes up to 20 mentions, and its files attach up to 60,000 characters together. A file past that is named by its path, for the agent to read if it needs it.
- Binary files, and files your
.gitignore,.lookoutignoreor.cursorignoreexcludes, don't attach.
Attach images and files
Paste them, drop them anywhere on the chat or the new chat page, or click + and choose Image or File. While you hold a file over the page it shows where the file goes. Click an attachment to preview it. To remove an image, point at it and click the × on its corner; a file's × always shows.
An attachment alone is a whole message: send a screenshot with no words, and the agent works from the image.
- Images (PNG, JPEG, WebP and GIF): a model that reads images sees them, and a model that doesn't gets the image's path instead (the message box says so before you send). An image over 2048 pixels on its long side is scaled down when you attach it.
- Other files are saved by Lookout, and the agent gets their path and reads them with its tools.
- Each attachment can be up to 10 MB, and a message takes up to 20 images and 20 files.
Read the context meter
Once a chat fills a tenth of its model's context budget, a meter appears on the right of the status line under the message box: a ring and the percentage used. The ring turns amber from 75%. Hover it to see how many tokens the chat holds and where it will be summarized.
Click the meter for the Context panel: tokens used out of the model's budget, and Compact now.
What fills it names the part that takes the most of the chat's context and its share, and the two largest when they fit. Click it for every part, in tokens, together the size Lookout estimates for the next request:
- Setup is what every request starts with: the System prompt, the Tool definitions, your Rules, the Environment (the facts about the workspace; in an agent's chat, who the agent is too), your Memory (in an agent's chat, its ledger of open requests too) and the Skills the agent can use.
- Conversation is the chat so far: Messages (yours, and other agents' in an agent's chat), Agent replies (its words and tool calls, and under them the Thinking it carries from one request to the next), Tool results by tool with the five largest named, Summaries, Images, and the Notices Lookout wrote for the agent.
Under the parts, Last response's prompt is the size the provider counted for the agent's latest reply, split as the Usage tab splits tokens: Input (sent uncached), Cache write and Cache read. The estimate and that count differ by what the chat gained since the reply, and by how closely the chat's replies have taught Lookout the model's tokens.
Under that, Cache shows the share of the chat's prompt tokens read from the provider's cache, then its requests' tokens so far split the same way: Input (sent uncached), Cache write (where the provider reports it), Cache read, Output, and their Total. Where the price is known it adds the cost: Cost so far on an API key billed per token, At API prices on a subscription (what the same requests would cost billed per token). Warm cache says how long the cache stays warm if you send nothing, or Expired once your next message has to send the whole chat again. When the chat's rules run past their budget, Rules names each file that was cut and the line its rest starts at; click one to open it there.
The message box's send button says what ⏎ does. When the last turn stopped before it finished, an empty message box's send runs the stop's main action and draws it: a circling arrow for Retry or Try now, a clock for Wait for the reset, the send arrow for Continue on another model, which its name says. Hover it for the action's name, the same words as the stop's own button. While the agent works, the line under the message box says what a message does, Queue or Steer, and the key that sends it the other way; the send button's tooltip names it.
How compaction works
When a chat nears its model's summary point, Lookout makes room before the next request. Each model's point follows where its maker's own coding agent compacts it, close to the end of the window on most 1M models; a model with no such guidance uses 85% of its budget. The context meter shows the model's whole window, with a mark at the summary point; its hover names both.
- It clears older tool output the agent has already read. Cleared output is saved to a file the agent can read again. The chat shows Context cleared. Where the provider's cache makes the next request pay to send the chat again after a clear, and a cached read costs little, Lookout waits until a clear frees enough to be worth that, at the latest the summary point (93% of the budget on a model without one).
- If that isn't enough, it summarizes older turns. At the summary point it also summarizes when a summary frees more room for what the next request sends again than the clear did. When the chat is headed there, the summary is written ahead while the agent works, so the chat doesn't wait for it at the point. The chat shows Summarizing context while it waits for one, then Context summarized. The summary is written from what the agent saw, including output cleared earlier.
- If the chat is still over 85% with the summary in place, it clears the output its most recent steps still hold, which the agent has already read, then shortens output the agent hasn't read yet, largest first, until the chat fits.
The agent keeps your current request word for word, your earlier messages word for word as far as they fit, every skill you attached to an earlier message as it was attached, a summary of the work done since, and its most recent steps with their output as the agent read it (cleared again only if the chat still wouldn't fit). Output the agent hasn't read yet is never summarized. When it can't fit whole, the agent gets its beginning and its end, with which lines were left out and the file holding all of it, before anything else happens to it. A request that still wouldn't fit the model's window is never sent: the turn ends with Context window exceeded.
The tool calls of one step share about a third of the budget between them. A result past its share keeps its beginning and its end, and the rest is saved to a file the agent can read with the line numbers it names, so one step of many large reads can't fill the window.
Every request sends every image the chat still holds. Where a model's provider gets slow or refuses past a size, Lookout keeps a budget of image bytes per request: once a request would carry more, it clears the oldest images the agent has already seen until the request carries half the budget. Each cleared image leaves a line in its place with its name, size and the file that shows it again, which the agent reads when it needs the image back. The images in your current request, in the agent's latest step, and the five most recent always stay. Images count toward the context by their size, as each model's maker counts them.
Each compaction row shows the tokens before and after. Open it to read the summary and see which files the agent read again. Lookout keeps the chat's full context from before the summary in a file, and the agent can search it when it needs a detail the summary left out. Open original context shows that file in Finder; in a browser, Copy original context path copies its path.
Switching a chat to a model with a smaller context compacts it if it no longer fits. A summary written while the chat sat idle is used as it is; otherwise the model you left writes the summary while it still holds the chat in its cache, and if it can't, the new model writes it, taking the time it needs. Stop ends the wait and keeps what was cleared so far.
Long chats left idle
A provider keeps a chat cached for a while after each reply, and reading it from there costs a fraction of sending it again. When a chat of 100K tokens or more goes quiet, Lookout can use that time, set in Settings › Chat › Advanced › Before the cache runs out:
- Prepare (the default): shortly before the cache runs out, the agent writes a summary of the chat while it is still cached. If you come back after the cache ran out, the chat starts from that summary and its most recent steps, on whichever model you picked meanwhile, and shows Summarized while idle, before the cache ran out. If you come back sooner, the summary is dropped and nothing changes.
- Compact: the chat is summarized while it is still cached and shows the notice at once.
- Off: a quiet chat stays as it is.
Keep the cache warm (on by default) goes further where the provider offers it: shortly before the cache runs out, a short request reads the quiet chat from the cache so it stays cached as it is, for as long as that costs less than sending the chat again, and then the summary takes over. The same keeps a chat and its subagents cached while a long command runs. Each one shows on the Usage tab as Cache kept warm.
Some providers' caches also run out for every chat at one time of day, however recently it was read. Lookout plans for that: the summary is written a few minutes before, nothing is sent to keep a chat warm across it, and a chat you come back to after it starts from that summary.
The summary runs only on providers whose cache prices make it pay, never for an archived chat, while the agent or one of its subagents works or when the model's plan is nearly spent. While you type in the chat it waits until a minute after your last keystroke. With several accounts of one provider, the summary and the requests that keep the cache warm go only to the account holding the chat's cache, and only while your next message would go there too, and the chat stays on that account when you come back. Its cost shows on the Usage tab.
Compact by hand
Between turns, any of these summarizes the chat now:
- Type
/compact(or/summarize) and press⏎. - Click + › Compact context.
- Press ⌘K and choose Compact context.
- Click Compact now in the context meter's panel.
To say what the summary must keep, type it after the command: /compact keep the migration plan. The summary keeps
what you name in full detail. The words are an instruction for the summary only: they start no turn, and the agent
never gets them as a message.
Compacting by hand isn't available while the agent works: a /compact sent then stays in the message box, and Lookout says Compact once the turn ends. If there's nothing to summarize, Lookout says Nothing to compact.
When the context runs out
If a task's working set can't fit even after compaction, the agent stops using tools and replies with what's done, where things stand and what remains. The turn ends with Context full. Send a follow-up with a narrower request to continue.
Related
- Chats and projects: Projects hold your folders and their chats, and the message box sends, queues, steers and stops the agent's work.
- Rules: The instruction files a chat reads from each of its folders, how an edit reaches a running chat, and the ignore files that keep the agent out of paths.
- Memory: What Lookout remembers across chats, for you and for each project, and how to see and change it.
- Connectors and skills: Give the agent more tools with connectors, playbooks with skills, and both together with plugins.
- Models and providers: Connect the providers you have a plan with, then pick a model, its effort and its variant for each chat.