Skip to content

Run agents on this computer ​

A local agent is a definition on your computer that the CLI starts as a child conversation. It uses the same conversation path every turn uses, so billing, quotas, model entitlement and cancellation stay with the Chainabit server. There is no background service and no second billing owner on your computer.

The CLI interface follows your account language. This page quotes the interface text as it appears in English.

You can start local agents yourself, with /agents in the conversation or chainabit agents run from a script, and in the interactive conversation Chao can hand a task to one of them for you; see Let Chao delegate.

Define an agent ​

An agent is a Markdown file in a .chainabit/agents folder; see Skills, plugins and agents on this computer for where it can live and which definition wins. Its front matter asks for what it needs:

markdown
---
name: reviewer
description: Reviews a change and reports risks
tools: read, search
maxTurns: 2
---
You review changes. Be brief and name the files you looked at.
FieldMeaning
toolsread, list, search, write, edit, delete, shell, skills, or the Claude Code names Read, Glob, Grep, Write, Edit, MultiEdit, Bash. Without it the agent can only read, list, search and load skills. disallowedTools is subtracted. An agent is never granted the tools that start agents.
model, provider, effortauto (default, the server's routing), inherit or a model key; effort is basic, thinking or pro. The server decides what your plan allows.
permissionModeplan, ask (also default), acceptEdits or auto. bypassPermissions and dontAsk are not supported and read as ask.
maxTurns1 to 5; default 1. A finished agent takes follow-ups up to this number of turns.
timeout90s, 10m or seconds, up to 30 minutes; default 10 minutes.
skillsUp to 8 skill names to preload.

Other fields (hooks, mcpServers, memory, isolation, initialPrompt) are reported and never run. The text after the front matter is the agent's instructions, up to 32 KiB. They reach the model as context that is not authoritative, and your own conversation is never sent to the agent unless you attach it.

What an agent may do ​

The agent's authority is the smallest of what its definition asks for, what you may do right now, and your organization's limit.

  • If you switch your conversation to Plan, running agents drop to Plan.
  • Bypass All is never passed to an agent.
  • An agent cannot start another agent.
  • A request that needs approval goes to you, the owner. Without a terminal to approve it, the request is refused.
  • A folder that is not trusted runs nothing; see folder trust.

These bounds can be lowered, never raised: 3 agents running at once, 20 per session, 10 waiting, one agent changing files at a time, a result of at most 16 KiB (longer results are cut with a marker), a wall clock of at most 30 minutes per agent, and an optional credit budget for the session.

Running agents bills credits through your plan or wallet exactly like your own turns. Set a budget when you run several of them.

Let Chao delegate ​

In the interactive conversation Chao can start one of your local agents by name when a task suits it, without you typing /agents run. Chao asks for an agent that is in effect here and gives it a task; it chooses nothing else about it.

  • Whether you are asked depends on your permission mode. In Plan and Ask before edits you are always asked. In Auto approve an agent that can only read starts without asking, and an agent that can change files asks. Bypass All changes none of this. The question is the card Approval required: Chao wants to run <name>: <task>, which lists the agent, the tools it may use, its approvals, model, time limit and task. You choose Deny or Allow once; approving runs exactly this, once. The tool card in the conversation reads Delegate.
  • The agent's authority is the usual smallest of three. Chao hands the task to a local agent "with at most this session's permissions". An agent still runs under its own definition, your current permissions and your organization's limit, and its own approvals and questions go to you as described below.
  • Nobody to ask means no run. Without a terminal approver the delegation is refused.
  • At most 5 minutes. One delegation lasts at most 5 minutes, including the time you take to decide. The agent's own timeout is shorter by a safety margin, and if Chao's turn ends or is cancelled, the agent stops.
  • Agents never delegate. An agent started this way cannot start another agent.
  • Limits apply, and nothing queues. The same bounds as for agents you start apply (3 running, 20 per session, one agent changing files at a time). A bound refuses the delegation instead of waiting.
  • Chao receives the final answer. It gets the agent's state, its answer (at most 16 KiB, cut with a marker) and its usage. While the agent works, the status line reads Running <name>.

The agent receives the task from this conversation, so its audience is inherited from it. The answer comes back from the agent, so this conversation's audience is narrowed by the agent's. Nothing the agent read or wrote becomes visible to a wider audience than both allow. If the server cannot confirm the agent's conversation is yours, the conversation becomes visible to you only, and if it cannot record the restriction, the answer is withheld.

Delegation is available only in the interactive conversation. From a script, start agents yourself with chainabit agents run.

Approvals and questions go to you ​

You own every agent you start. When one needs something from you, the conversation says waiting for you, the agent's clock pauses, and /agents show <agent> lists what is pending.

  • Approvals are labelled with the agent, as reviewer#1 · <action>.
  • Questions appear as the conversation's own question cards, titled reviewer#1 asks: …, behind any dialog that is already open. Esc leaves a question pending; /agents show <agent> asks it again. An agent offers questions to its model only when you can answer them.
  • With nobody to answer, or after 10 minutes without an answer, the agent stops. It never hangs.
  • When an agent stops, its open prompts disappear at once and the runs it already finished keep their usage.

In the conversation ​

CommandDoes
/agentsLists the agents on this computer, then the cloud workspace.
/agents run <name> [--bg] [--with-context N] <task>Shows what the agent may do and asks you to confirm, then runs it. /agents run --bg runs it in the background; /agents run --with-context N shares the last N messages of this conversation.
/agents show <agent>Shows its state, what it is allowed, turns, usage, result and anything waiting for you.
/agents send <agent> <message>Sends a follow-up to a finished agent.
/agents stop <agent|all>Stops one agent or all of them.
/agents attach <agent>Adds its result to your next message.
/agents budget <credits|off>Sets or removes the session credit budget.
/agents import <source> [--to user|project]Imports definitions.
/agents clearDeletes finished agents.

An agent is waiting, starting, running, waiting for you, done, failed, stopped, timed out or not started. Running the same task again returns the agent that already has it; chainabit agents run --fresh runs it again.

From the command line ​

bash
chainabit agents run reviewer --task "Review the changes in this folder"
chainabit --json agents run reviewer --task-file task.md
chainabit agents run --spec tasks.json --parallel 2 --budget 20 --events

Every option is in the chainabit agents run reference. A few things are worth knowing:

  • --budget <credits> starts no further agent once the credits settled in this run reach the number. Credits are the server's own figures; nothing is estimated.
  • --events prints one event per line in chainabit.agents/v1, a versioned format that only gains fields within v1. --json prints one object with the same fields.
  • --events --answers stdin lets a program be the owner: each agent.question event is answered with one line, {"type":"answer","questionId":"<id>","answers":[...]}. When standard input closes, unanswered agents stop.
  • Without a terminal, any approval an agent needs is refused. Exit code 0 means every agent completed; 4 a refused approval, 5 credits, quota or a budget or session limit that stopped further agents, 6 no connection, 130 an interruption, and 1 any other failure.

Why an agent did not start ​

MessageReason
Usage limits or credits are used up.Your plan or wallet cannot fund it.
An agent cannot start another agent.Agents are one level deep.
Another agent is changing files in this folder.One agent writes at a time.
A limit for this session is reached.The number of agents, the queue or the budget.
This folder is not trusted.Trust the folder first.
The definition is invalid.Its front matter has a problem; agents inspect shows it.
It needed an approval nobody could give.No terminal or owner answered.
It asked a question nobody here could answer, so it stopped.Nobody could answer, or nobody did in time.
The Chainabit API cannot be reached.Agents need the API to run.
This API cannot carry context between conversations.The server does not support it; see local conversation context.

When you close the CLI, running agents are cancelled within a few seconds. After a crash, the next start cancels agents whose owner is gone, and finished agents are deleted 24 hours after their session ended.

Built with purpose. chainabit.com