Context, sessions and long tasks

What the agent knows about your project comes from three places: instruction files it reads at the start, what you attach to a message, and the conversation so far. This page covers all three, how sessions are saved and resumed, and how a long task stays within the model's window.

Updated .

Instruction files

Before the first message, the agent reads these files if they exist, in this order, and adds them to what the model is told on every call. Later files come later in the prompt, so where two disagree, the more specific one wins.

  1. ~/.clixad/CLIXAD.md: your own instructions, for every project.
  2. AGENTS.md in the project: the file many coding agents read, if the project has one.
  3. CLIXAD.md in the project: instructions for Clixad in this project.

Each file is cut at 20,000 characters, and the model is told what was left out and that it can read the rest when it matters. A project's files have to be inside the project: one that is a link to a file elsewhere is not read. Clixad does not read CLAUDE.md; if that is where your project's instructions are, copy what applies into AGENTS.md.

/init has the agent look through the project and write a CLIXAD.md, and the agent suggests it once in a project that has neither file. Keep these files short, because they are sent with every model call of every task and you pay for them on each one. Build commands, test commands, the layout of the code and rules the agent would otherwise get wrong are worth their place. Anything the agent can find out in one search is not.

A name and standing instructions saved on your account page reach every turn as well, in the terminal and in the browser.

How to write an AGENTS.md that coding agents follow covers what to put in the file, and which other agents read it.

Attaching files

Type @ and a path, and the file's contents go to the model with your message, so it does not spend a call reading it. The line you typed stays as you typed it on screen and in your history.

  • An image in PNG, JPEG, GIF or WebP is sent as a picture the model can see: @screenshot.png why is this button cut off?. The format is read from the file's contents, not its name.
  • A PDF is sent as its text, read on your machine. A scanned PDF has no text to read, and the agent says so.
  • A file too large for the model's window is cut at a whole line, and the agent says which lines went in.

Saving and resuming

A session is saved in ~/.clixad/sessions after every step the agent finishes, so an error, a lost connection or a closed terminal does not lose the work done so far.

  • clixad --continue picks up the last session in the current directory.
  • clixad --resume, or /resume inside the agent, lists the sessions in this directory to pick from. /resume all lists every directory.
  • A resumed session is drawn on screen as it was: your messages, the answers and the tool calls.
  • Pressing d twice on a row of the list deletes that session. The 200 newest sessions are kept.

/clear starts a new session and clears the screen. The old one stays saved and can be resumed.

Taking a message back

/undo takes your last message back into the input box, so you can change it and send it again. Two things it does not take back, and it says both every time: the credits the turn used, and the changes on disk. It names the files the agent wrote or edited for that message and counts the commands it ran. Use git for the files: commit before a task you may want to undo, and git diff shows what changed. How to undo what a coding agent changed has a git routine for it.

Long tasks

One message may run up to 100 model calls before the agent stops and asks you to continue. Most tasks need far fewer. /steps shows the limit, /steps 200 changes it for this install (from 10 to 500), and /steps default sets it back.

The agent stops sooner if four rounds in a row make the same tool calls and get the same results, because that is a stuck agent, not a long task. Either way it says why it stopped, that the work is kept, and what the turn cost. Typing "continue" carries on from where it stopped.

When the conversation gets long

A model has no memory between calls, so every call sends the whole conversation again, and it grows with each file read and each command run. Two things keep it inside the model's window.

Results are sized to the window. A file read returns as many whole lines as fit, and tells the model where to read on. A long command output keeps its beginning and its end. The cut is always said, so the model never mistakes part of a file for all of it.

Older parts are summarised. Once a request would be over three quarters of the model's window, the agent summarises the older part of the conversation and carries on with the summary and the recent steps. The summary is written by the model, so it is a model call and metered like one. Your newest message is never summarised. /compact does the same on request. On Claude Haiku 5.5, GPT-6 Luna and GPT-6 Sol a task can grow past that point before it is summarised, up to the length at which their providers start charging more, because the gateway refuses such a request for free before it is sent.

If a request is still too long for the model, the gateway refuses it before it is sent and nothing is charged; Troubleshooting says what to do.

Background commands and sub-agents

A command that does not end on its own, such as a dev server or a file watcher, runs in the background. The agent reads its new output when it needs to, and /bg lists these commands and stops them. Nothing the agent starts outlives the session: they are all stopped when you quit.

For a wide search across a large project, the agent can hand the search to a sub-agent. The sub-agent reads what it needs and reports back a summary, so the files it opened on the way stay out of the conversation you are paying for. Sub-agents can only read, never edit or run commands, and what they use is added to the turn's cost.

Reading the web

The agent can search the web and read pages, without asking you, because neither changes anything. A search goes through our gateway, which holds the search provider's key, and costs credits; Credits says how many. Reading a page happens on your machine and costs nothing beyond the tokens it adds. A page is converted to text with its links kept, and if it is too long, the agent is told it was cut.