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

# Context and artifacts

> What's in a chat's context — the lane it starts in, attachments, the transcript, compaction, and how summaries carry work forward.

A chat's context is everything the agent can draw on: where it started, what you attach, and the running transcript of the session. The agent reads files directly from the lane's worktree on demand, so you don't paste source — point it at the right place and let it inspect.

## What the agent starts with

A new chat opens with its working context already set from the lane: the lane's **name, branch, and working directory** are injected so the agent knows which worktree it's in and where it can write. From there, its context is:

* Your prompt and any attachments you add.
* The lane's files, read on demand from the worktree.
* A linked Linear issue, when the lane already has one connected.
* The session transcript — the running record of the conversation.

## Attach the spec

When a task has acceptance criteria, attach the Linear issue from the composer so the agent works from the real spec instead of your paraphrase. ADE writes the issue into a per-session context file the agent can read, and — when the chat is on a lane — links the issue so it shows up in the next PR's "Linked Linear issues" block.

You can also attach images directly to a message — screenshots, mockups, or diagrams the agent should match or debug.

## The transcript and turns

Everything the agent draws — messages, reasoning, tool calls, commands, file changes, plans, and questions — is one stream of events that the UI renders as the transcript. Each exchange is a **turn**: your message, the agent's work, and a final marker that records the model, token usage, and (on a lane) a per-turn diff summary.

The transcript persists to disk, so a session survives an app restart. When you resume a chat, ADE rehydrates the provider's own session and injects a continuity summary, so the next turn picks up where you left off instead of starting cold.

## The context window

Long chats eventually fill the model's context window. Each provider compacts by itself as the context fills: it replaces older messages with a summary for the model. Your visible chat stays as it was.

### The context meter

The ring next to the send button shows how much of the model's window the chat uses. A small tick on the ring marks where the provider compacts. Click the ring to see the numbers, for example `312k of 1M used · compacts at 400k`, and to use **Compact now**. Compact now works for Claude, Codex, Pi, and OpenCode.

### Compaction in the transcript

Each compaction is one quiet row in the transcript:

* **Running:** `Compacting context · 481k tokens`. The chat's row in the sidebar and on the Work tab shows **Compacting…**.
* **Done:** `Context compacted · 481k → 6k · 28 s`, and who started it: `you asked`, `automatic`, or `ADE (near limit)`. Click the row to read the summary when the provider gives one.
* **Failed:** `Compaction failed · weekly limit on Work`, with **Retry**. A failed compaction does not change the meter.

### Set when a provider compacts

Open **Settings → Providers** and choose a provider. Find **Auto-compact**.

| Provider | What you can set |
| - | - |
| Claude | **Auto-compact at**: Auto (recommended) or 100k to 1M. You can also turn auto-compact off. |
| Codex | **Auto-compact at**: a token count, capped at the model's window. |
| OpenCode | Auto-compact on or off, the compaction buffer, and the recent tokens to keep. |
| Pi | Auto-compact on or off, the reserve tokens, and the recent tokens to keep. |
| Cursor, Droid, and other agents | Nothing. These compact by themselves. |

If you have more than one Claude or Codex account, each account card has its own **Auto-compact** choice. "Same as provider default" uses the provider setting. A change applies at the next turn.

> [!TIP]
>
> On a 1M-token Claude model, Claude compacts late by default. Each step of a turn re-reads the whole context, so a very long chat uses your plan limit fast. A lower value, such as 400k, compacts sooner and uses less of your limit. The summary keeps less detail.

### Compact first after an hour away

Claude keeps a chat's context in a cache for one hour. After that, your next message sends the whole context again. When a Claude chat has been idle for an hour and holds 100k tokens or more, a **Compact first** pill appears next to the context meter. Turn it on, and ADE compacts the chat first and then sends your message. If the compaction fails, ADE does not send the message.

In **Settings → Providers → Claude**, **After an hour idle** sets the pill to **Ask** (the default), **Always compact first**, or **Never**.

Compaction markers are part of the session history: started and completed updates merge into one row, and the next turn stays in the same chat.

When a session gets long:

* Continue if the agent is still on track.
* Ask the agent to summarize the current state.
* Start a fresh session in the same lane, seeded with that summary.
* Re-attach the key logs or screenshots rather than relying on old messages.

> [!WARNING]
>
> Compaction and summaries are useful, but they are not exact memory. Restate any critical constraint before asking the agent to continue past a compaction.

## Recover old context

Use **History** to reopen past transcripts, inspect their tool calls, and recover proof or PR links from earlier sessions. Claude and Codex provider-native histories can also be imported or forked into ADE when available; after import, future turns use the normal ADE chat transcript, diff, and lane boundaries.

A summary pulled from a finished session is the cleanest way to seed a new one in the same lane.

> [card] [Chat capabilities](https://ade-app.dev/docs/chat/capabilities.md)
>
> The full catalog of what a chat agent can do.

> [card] [Agent chat](https://ade-app.dev/docs/chat/overview.md)
>
> How a lane-scoped chat works, end to end.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.