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, intent tracking, 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. |
stagger_seconds |
1.0 |
Delay (seconds) between consecutive run launches. |
dedup_seconds |
0 |
Window (seconds) to suppress re-assigning the same task ID. |
stop_on_error |
false |
Halt the orchestration loop on the first unrecovered error. |
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}. |
[help]
Controls the help channel (clo ask / ask_user MCP tool / cloche threads).
| Key | Default | Description |
|---|---|---|
park_after |
"5m" |
Duration string. How long an ask blocks in place before parking the run: the container is committed and stopped, and the run’s state becomes parked until a reply resumes it. Overridable per ask with --no-park (clo ask) / no_park (ask_user), which disables parking and blocks in place instead. |
retention |
"720h" |
Duration string. How long archived threads (from completed tasks) are kept before the daemon’s daily sweep deletes them. |
Questions always flow via cloche threads, which needs no configuration. To also deliver them to a user-side integration, add one or more [[help.channel]] tables in the daemon (global) config — see User Configuration below.
[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.
[intent]
Controls requirement extraction and prompt injection for Intent Continuity. Requirements live in .cloche/intent/ and are prepended to agent-step prompts automatically; see the Intent Continuity page for the concepts, and the cloche intent command for the CLI.
| Key | Default | Description |
|---|---|---|
embedder |
(unset) | Pins the embedding adapter chain to "onnx", "ollama", or "keyword". Empty uses the default chain order (onnx → ollama → keyword, first available wins). |
model |
(unset) | Reserved for overriding the onnx adapter’s embedding model; not yet wired in. Use the CLOCHE_INTENT_MODEL env var today. |
token_budget |
0 |
Overrides the default selection budget (~2000 tokens) for requirements injected into a prompt. Zero means “use the default”. |
inject |
(unset) | Set to "off" to disable auto-prepending requirements to agent-step prompts project-wide. To opt out a single workflow or step instead, set intent_tracking = false in its config (this also excludes that step’s logs from collect-sources transcript mining). |
scan_after_tasks |
true |
Enqueue an incremental intent-scan run after each completed main orchestration task attempt. Set to false to keep the feature dormant until you run cloche intent scan by hand. |
[intent]
embedder = "onnx" # "onnx" | "ollama" | "keyword"; unset = default chain
token_budget = 0 # 0 = ~2000-token default
scan_after_tasks = true
# inject = "off" # disable injection project-wide
[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 (e.g. intent-scan) 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 reference this repository from workflow repos fields. |
path |
(required) | Path relative to the project root. |
url |
(unset) | Remote URL (informational; not used by the runtime). |
Repositories appear in cloche project output and in cloche project repos list. Workflows opt into a subset of repositories with the repos field, which the runtime enforces for container seeding and result extraction.
Example:
active = true
[orchestration]
concurrency = 2
stagger_seconds = 1.0
dedup_seconds = 300
stop_on_error = false
max_consecutive_failures = 3
[intent]
scan_after_tasks = true
[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"
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
[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
[[help.channel]]
Delivers agent help-channel questions to a user-side integration in addition to cloche threads. Daemon config only — these tables are not read from project config.
# ~/.config/cloche/config
[[help.channel]]
type = "slack"
channel = "#cloche" # default Slack channel
token_env = "SLACK_BOT_TOKEN" # env var holding the bot token (xoxb-...)
app_token_env = "SLACK_APP_TOKEN" # env var holding the app-level token (xapp-...)
[help.channel.channel_map] # optional: route cloche channels to distinct Slack channels
mazd = "#mazd-cloche"
| Key | Default | Description |
|---|---|---|
type |
(required) | Channel integration type. "slack" is the only supported type so far; an unknown type fails daemon start. |
channel |
(unset) | Default Slack channel to post to. |
token_env |
(unset) | Env var holding the Slack bot token. |
app_token_env |
(unset) | Env var holding the Slack app-level token (Socket Mode). |
channel_map |
(unset) | Table mapping cloche-side channel names (project names) to distinct Slack channels; cloche channels absent from the map fall back to channel. |
A channel that fails to initialize (e.g. missing token env var) only logs a warning and is skipped — the CLI channel keeps working regardless.