DocsGuides
Agent Mode
Chat with an agent that reads, edits and runs commands in your workspace, following a workflow or as a single agent.
Agent Mode is where most day-to-day work happens. Open it from the left rail. An agent can explore your code, edit files, run commands, search the web and ask you questions, within the permissions you set.
The message box
Type your request in the message box, which says Message agent.... A few things to know:
- Type
@to reference a file, so the agent looks at exactly what you mean. - Use Add Context to attach any file on disk to the prompt, or Folder to attach a folder.
- Choose a skill in the Select skill menu. New chats start with build. See Skills. While the chat follows a workflow, the menu stays on build and reads tools set per step, because each step's profile decides its tools.
- Choose a model in the model picker. A new chat starts on your default model; each chat keeps its own choice and saves it with the conversation. If you set up automatic model selection, AUTO appears here too. Reasoning-effort variants of a model are listed separately.
Workflow or single agent
Above the message box, the workflow bar's Mode menu picks how the chat runs:
| Choice | What happens |
|---|---|
| Single agent | One agent loop decides its own path. Good for quick questions and small edits. New chats start here. |
| Stage: … (for example Research & analyze) | A short run, usually read-only, that stops at a written result for you to read. Run the next stage in the same chat and it builds on that result. |
| Workflow: … (for example Plan, build, verify, or one you made) | The chat follows it step by step from start to finish, pausing where a step needs your answer, such as approving the plan. |
| Auto: choose a workflow for each message | Rusty picks the workflow, or the single agent, for each message. Needs OpenRouter and a JEV model. |
When a workflow is selected, its name appears as a chip (click the × on it to stop following the workflow) and its steps are listed in order, for example Request → Plan → Plan approval → Build → Verify → Acceptance → Manual checks → Result. While it runs, the bar tells you where it is: Running step 4 of 8: Build, with (waiting for permission) when a step is blocked on a command prompt, (waiting for your answer) when an approval card is open above the message box, or the attempt number when a step is retrying. When a step fails, the bar marks it and shows the error, and your next message resumes the run there.
The Allow flow switching checkbox lets a running workflow hand over to another. Auto mode answers everything a run would ask you (see below). The chevron at the left hides or shows the bar. See When a workflow asks you.
The workflow's final message is its result, so read it: a finished run means every step finished, not that every check passed.
Auto mode
Tick Auto mode in the workflow bar (it is there with or without a workflow, and while a run goes on) and no run waits for you:
- commands, checks and file writes are allowed, each once, as if you had clicked Allow once;
- an approval step is approved: the plan as written, manual checks untried, and steps marked Always ask a person too;
- a stuck task is tried once more, then skipped; a run is never stopped for you;
- a question the agent asks takes its first suggestion, or the agent is told to decide itself and say in its answer what it chose.
It is one switch for every chat and is remembered across restarts. It works at once: turning it on also answers what is already waiting. A workflow step answered this way says so in the chat (Plan approval: "Approve" was chosen by auto mode.). Turn it on for long jobs you leave alone, such as a goal with no loops= limit, and read the result afterwards.
Everything about workflows has its own section:
- Workflows: stages and pipelines, running one, answering its approvals, and steering a long job between stages.
- How workflows work: steps, handoffs, checks that send work back, approvals, task queues, subflows and limits.
- Built-in workflows: all 15, step by step.
- Auto flows: letting Rusty choose, and handing over mid-run.
- Profiles & workflows: customizing them and the JSON behind them.
With AUTO selected in the model picker, each workflow step also picks its own model. See Automatic model selection.
What agents can do
Depending on the profile and permissions in force, an agent can use tools such as:
| Tool | Purpose |
|---|---|
read_file, list_files |
Read files and explore the workspace. list_files gives an overview with no arguments, lists a folder with path (and depth for more levels), or finds files by name with glob, such as **/package.json. Dependency and build-output folders are left out. With smart file reading on, read_file returns only relevant sections. |
project_info |
Work out what kind of project the workspace holds and how to check it: languages and frameworks, the package manager, the install, typecheck, lint, test and build commands (from package.json scripts, Cargo, pyproject, go.mod, Makefile and your CI workflows), how to start dev servers, and whether dependencies are installed. Agents call it before running a build or test instead of guessing. Whatever allows read_file also allows it. A short summary of what it finds (the projects, which checks each has, and whether dependencies are missing) is also added to the agent's instructions when a chat starts, so it knows what it is working in from the first message. It is left out when the workspace takes more than a couple of seconds to scan, so it never holds up a chat. |
search_codebase |
Search your code. Also available as a ranked smart search. |
edit_file |
Change part of an existing file by replacing one exact piece of its text. It fails without touching the file if the text is missing or appears more than once. Whatever allows write_file also allows edit_file. |
write_file |
Create a new file, or replace a file's whole content. Replacing a file that already has content is refused unless the agent sets overwrite: true, so an accidental rewrite cannot silently drop code. |
run_check |
Run one of the project's own checks (typecheck, lint, test, build or format) and get a clear PASSED or FAILED. The commands come from project_info. A failure lists its errors as file:line: message, shows test counts, and says whether the cause is the code or the environment, for example dependencies that are not installed, in which case the agent installs them instead of editing code. A failing check is reported to the agent as a failed tool call. To run just one test while it works on it, the agent can give the test check a test_name or a test_file (for vitest, jest, pytest, cargo test and go test; other runners are refused, with a pointer to run_command). A filter that matches no test is reported as FAILED, never as a pass, because several runners exit successfully when nothing matched. The built-in Build, Refactor, Optimize and Verify profiles will not let an agent finish until it has run one (see completion gates). You approve each command as you would for run_command, and whatever allows run_command also allows run_check. |
install_dependencies |
Install the project's dependencies with its own package manager when project_info or a check says they are missing. It is not a check and never counts as having run one, so the agent runs the check again afterwards. Approved like run_command, and allowed wherever run_command is. |
run_command |
Run any other shell command, after you approve it. See Permissions & safety. |
web_search, web_extract, web_fetch |
Search the web and read pages. Needs a search provider for web_search. |
rusty_docs |
Look up Rusty's own documentation. See Ask about Rusty. |
report_progress |
Tell you how the work is going. |
ask_user_question |
Ask you a question and wait for the answer. |
Agents can also delegate parts of a task to subagents.
Ask about Rusty
You can ask the agent about Rusty itself, in the same chat you use for your code. It looks the answer up in the documentation and replies with the steps, the exact name and place of each setting, and a link to the page it used. For example:
- How does spec-driven development work?
- Why do I have JEV, and what does it do?
- Where do I turn on smart file reading?
There is nothing to set up. Ask in a Single agent chat, which is how new chats start, with any skill. Steps of a workflow do not have this tool.
The documentation ships with the app, so answers match the version you have installed. Looking something up needs no internet connection, search provider or approval. Writing the answer is an ordinary request to your chosen model, so you need a connected provider. If the documentation does not cover your question, the agent says so.
Permission prompts
When an agent wants to run a command, Rusty shows Command permission required and waits. You can Deny, Allow once, or allow the program for the rest of the session. Details are in Permissions & safety.
Chat history
Each chat is saved automatically in your workspace, under .rusty/chats/. Use the controls at the top of Agent Mode:
- New chat starts a fresh conversation.
- Show chat history and Hide history toggle the list of past chats.
- Refresh reloads the list.
- Delete chat removes one.
Long chats
A chat is one conversation. Each message you send continues the same agent session, so the agent still has everything from earlier in the chat: what it said, and also the files it read, the commands it ran and their results. A follow-up such as now fix what you found works from the evidence, not from a recap. The context bar above the chat grows as the chat goes on.
A chat starts a fresh session, carrying the earlier messages over as text, when it can't continue the old one:
- you switched the model, the skill or the mode (such as Plan);
- the previous run failed or you stopped it;
- a workflow ran in the chat;
- the chat was reopened after Rusty restarted.
A model can only read so much at once, so Rusty shrinks a long chat before sending it:
- In the session. As the conversation fills the model's window, old tool results are cut to a short note first, then the oldest steps are dropped. A tool call always stays with its result.
- Earlier messages carried into a fresh session. Once they take about 40% of the model's context window, the oldest are left out and the model is told how many were omitted. The model's window comes from the provider's model list, or else from a catalogue of known models; if neither has it, nothing is left out.
The opening request is always kept word for word.
Pinning a message. Hover over a message and select the pin to keep it word for word however long the chat gets. A pinned message shows Pinned; select it again to unpin. Pins are saved with the chat. Many pinned messages can make a chat larger than its usual budget.
Summaries. Your chat's model also writes a running summary of what aged out, so it stands in for the messages that were left out. After a run, the older messages are folded into the summary, which is saved with the chat and used from the next run on. Within a run, older steps are summarized the same way. Summaries are written in the background, so no request waits for one, and if one fails the trimming above keeps the request in budget. Each summary is one extra call on your chat's provider, recorded in Token Metrics. Summaries are on by default; turn off Summarize long conversations in Settings → Intelligence → Context compaction to only trim.
JEV ratings. With OpenRouter and a JEV decision model connected, like Automatic model selection, turn on Rate messages with JEV first (experimental) in the same place. Before a summary, JEV rates the older messages: essential ones stay word for word, disposable ones are dropped, and only the rest is summarized. Each rated batch is one Decisions API request.
Reviewing what changed
Agents edit the real files in your workspace. Review their work in Source control: open each file's diff, stage what you want to keep, and commit.
Tip
Give the agent a way to check its own work. Mention the test or type-check command in your request, or in the instructions of your Build profile, and the completion gate will hold the agent to it.