Configuration Reference
Cloche uses two configuration files: a per-project config and a global user config.
Project Configuration (.cloche/config.toml)
Created by cloche init. Controls orchestration behavior, attention thresholds, and per-agent settings for a single project.
Top-level
| Key | Default | Description |
|---|---|---|
active |
true |
Set to true to auto-start the orchestration loop when the daemon starts. If multiple active projects are nested (one is a subdirectory of another), only the outermost project’s loop is started. |
[orchestration]
| Key | Default | Description |
|---|---|---|
concurrency |
1 |
Maximum concurrent container runs. A run parked at a poll step releases its slot for the duration of the poll and reacquires one (ahead of new task launches) once the poll resolves, so waiting runs don’t count against this limit. |
emergency |
0 |
How many urgent tasks may launch above concurrency (0 = off). A task is urgent when its list-tasks entry has priority 0 or an urgent label. An urgent task launches at once while fewer than concurrency + emergency tasks are in flight; emergency tasks count against concurrency, so no ordinary task starts until the total is back under concurrency. With 0, urgent tasks only go to the front of the queue. Whether the daily budget cap stops emergency launches is [budget] emergency_overflow. cloche status shows use in the Slots line: Slots: 6/5 busy · 1/1 emergency · 0 queued. |
stagger_seconds |
1.0 |
Delay (seconds) between consecutive run launches. |
dedup_seconds |
0 |
Window (seconds) to suppress re-assigning the same task ID. Also how long a task is skipped after a lost claim-task. |
stop_on_error |
false |
Halt the orchestration loop on the first unrecovered error. A run stopped on request (cloche stop) does not count. |
max_consecutive_failures |
3 |
Stop the loop after this many consecutive failed runs. Run cloche loop to restart. |
[agent]
Controls how prompt steps are dispatched.
| Key | Default | Description |
|---|---|---|
mode |
"prompt" |
Dispatch mode for prompt (agent-type) steps. "prompt" launches a headless claude -p process inside the container. "mcp" parks prompt steps until an interactive MCP client calls init, next, and submit-result on the daemon’s MCP server (/mcp). Script steps are unaffected by this setting. |
[agent]
mode = "mcp" # "prompt" (default) or "mcp"
[agents.<name>]
Per-agent configuration. The section name matches the agent command (e.g. [agents.codex]).
| Key | Default | Description |
|---|---|---|
usage_command |
(unset) | Shell command run after each step using this agent to capture token usage. Output must be JSON: {"input_tokens": N, "output_tokens": N}. |
[git]
Identity used for cloche-authored git commits: the extraction commit made when results are pulled out of a container, and the scaffolded rebase/merge scripts that run on the host. Per-project values override the same keys in the global config at ~/.config/cloche/config. When both are unset, commits attribute to cloche <cloche@local>.
Use a distinct identity (for example a dedicated GitHub bot account or a users.noreply.github.com email) to keep agent-authored commits separable from your own and to let GitHub treat agent PRs as reviewable by you.
| Key | Default | Description |
|---|---|---|
name |
(unset) | GIT_AUTHOR_NAME / GIT_COMMITTER_NAME for cloche-authored commits. Falls back to cloche when unset. |
email |
(unset) | GIT_AUTHOR_EMAIL / GIT_COMMITTER_EMAIL for cloche-authored commits. Falls back to cloche@local when unset. |
ssh_key |
(unset) | Path to a private key used for git push in workflow scripts. ~ is expanded. |
Host scripts receive the resolved identity and push credentials as env vars (CLOCHE_GIT_AUTHOR_NAME, CLOCHE_GIT_AUTHOR_EMAIL, CLOCHE_GIT_SSH_COMMAND) — see the CLI reference environment variables. Any workflow script that commits or pushes on the bot’s behalf should honor these env vars with a local fallback, so it still works when nothing is configured. The scaffolded merge.py script follows this pattern.
[attention]
Thresholds used to derive the “Needs you” set — items that require human action — shown by cloche status and the web console (via the /api/projects, /api/projects/{slug}/attention, and /api/projects/occupancy endpoints and the daemon’s GetAttention RPC).
| Key | Default | Description |
|---|---|---|
repeat_failure_threshold |
3 |
Consecutive failed attempts for a task (or failed runs for a built-in workflow, within builtin_failure_window) before it is flagged. |
long_poll_threshold |
"2h" |
Duration string (e.g. "2h", "90m"). A poll step waiting longer than this is flagged. |
builtin_failure_window |
"24h" |
Duration string bounding how far back built-in workflow runs are considered for the repeated-failure check. |
The attention set is served from a per-project cache the daemon refreshes in the background; the refresh cadence is configured daemon-wide, not per project — see [attention] (daemon-wide) below.
[[repositories]]
Declares the source-code repositories available to the project. Each entry is a TOML array-of-tables item:
[[repositories]]
name = "backend"
path = "./repos/backend"
[[repositories]]
name = "frontend"
path = "./repos/frontend"
| Key | Default | Description |
|---|---|---|
name |
(required) | Identifier used to select this repository: a task’s repos field or cloche run --repos. |
path |
(required) | Path relative to the project root. |
url |
(unset) | Remote URL (informational; not used by the runtime). |
depends_on |
[] |
Repositories this one needs. A run selecting it also gets them, transitively, in its containers — without result branches unless they’re also selected. Unknown names and cycles are errors. |
Repositories appear in cloche project output and in cloche project repos list. Each run chooses a subset — a task’s repos field, or cloche run --repos — which decides what is copied into its containers and which repositories get result branches; see Repository Declarations. A project with more than one entry gets repo sub-tabs in the web console.
[dras]
| Key | Default | Description |
|---|---|---|
heartbeat |
"4h" |
Duration string. How long a DRA may go without a wake-up before cloche dra heartbeat wakes it. "off" disables. |
Example:
active = true
[orchestration]
concurrency = 2
stagger_seconds = 1.0
dedup_seconds = 300
stop_on_error = false
max_consecutive_failures = 3
[attention]
repeat_failure_threshold = 3
long_poll_threshold = "2h"
[agents.codex]
usage_command = "codex usage --last --json"
User Configuration (~/.config/cloche/config)
The global daemon configuration file. Created automatically by cloche init if it does not already exist.
[daemon]
| Key | Default | Description |
|---|---|---|
http |
localhost:8080 |
HTTP address for the web dashboard. The dashboard is not started if this is unset (and CLOCHE_HTTP is not set). |
llm_command |
(unset) | LLM command used by cloche init to analyze the project and fill in scaffold placeholders. Resolution order: --agent-command flag, CLOCHE_AGENT_COMMAND env var, this key, then claude if on PATH. |
debug |
(unset) | Address for the daemon’s pprof + state debug HTTP server (e.g. "localhost:7778"), used by cloche debug. Equivalent to cloched --debug-addr or the CLOCHE_DEBUG env var. |
Example:
[daemon]
http = "localhost:8080"
Anyone who can reach the console’s port can stop, delete, and start runs. Keep it bound to loopback unless you trust the network. See the Safety Guide.
Choose any available port. To bind to a specific interface:
[daemon]
http = "127.0.0.1:9090"
The CLI command cloche health also requires http to be set, since it talks to the daemon’s HTTP API. cloche tasks falls back to localhost:8080 when it is unset.
You can also pass the dashboard address as an environment variable instead of using the config file:
CLOCHE_HTTP=localhost:8080 cloched
[budget]
A daemon-wide daily usage cap: one cap for the whole daemon, not per project. Disabled unless usage_percent_per_day is set.
# ~/.config/cloche/config
[budget]
usage_percent_per_day = 10
grace = "30m"
emergency_overflow = false
| Key | Default | Description |
|---|---|---|
usage_percent_per_day |
0 (no cap) |
Share of the subscription’s weekly usage allowance that may be used per day, in percent. 20 is used up in 5 days, 14 (1/7) runs out just as the allowance resets, 10 leaves headroom. Resolution is about 1%, so caps below 1 aren’t meaningful. |
grace |
"30m" |
Duration string. How long runs already in flight may continue once the cap is hit, before they are parked. |
emergency_overflow |
false |
true lets urgent tasks launch past the cap while an emergency slot is free; nothing else does. |
How usage is measured. Every two minutes the daemon reads the “Current week” percentages printed by claude -p "/usage" (no model call, no tokens) and takes the fullest window. “Used today” is that percentage minus the reading at the start of the local day (persisted in ~/.config/cloche/budget.json, so a daemon restart keeps it). Because the figure comes from the account, interactive Claude Code sessions count too. This covers the Claude allowance only.
When the cap is hit:
- No new runs launch. Loop tasks and other daemon-launched work wait. Launching resumes on its own when usage is back under the cap — when the local day rolls over or the weekly window resets.
cloche runby hand still works, with awarning:on stderr.- Runs in flight get
graceto finish. After that they are parked (stateparked, the same ascloche loop stop --hard); runs waiting on a poll step spend nothing and are left alone. Continue a parked run withcloche resume <run-or-task-id>; it restarts from the interrupted step as a new attempt. - It shows up as a
Budget:line and abudget“Needs you” item incloche status.
If the usage can’t be read, nothing is blocked: the cap is not enforced, and the failure is logged and raised as a budget “Needs you” item. Per-project caps and a 5-hour-window cap are not implemented.
[attention] (daemon-wide)
The “Needs you” set for every registered project is computed by a background cache rather than by running each project’s tracker on every request. The cache recomputes on a timer — and immediately after a run reaches a terminal state or a help thread changes — so a project that hasn’t been refreshed yet reports an empty set (with computed_at unset) instead of blocking. The per-project thresholds live in each project’s .cloche/config.toml; the cache cadence is set here.
| Key | Default | Description |
|---|---|---|
refresh_interval |
"60s" |
Duration string. How often every registered project’s attention set is recomputed. |
max_parallel_refresh |
4 |
How many projects refresh concurrently, so one slow tracker script can’t delay the rest. |
# ~/.config/cloche/config
[attention]
refresh_interval = "60s"
max_parallel_refresh = 4