Skip to main content

Agent Presets

How agent presets work in Daintree: the three preset sources, per-worktree overrides, fallback chains, shared project presets, and provider templates.

Updated
Reviewed

Presets

Presets are the agent-scoped launch configurations Daintree applies every time you start an agent. They come from built-in agents and your own settings alike.

A preset bundles flags, env vars, and behavior tweaks for a single agent so you can launch it pre-configured. Daintree merges presets from three sources, lets you set a default per agent and override it per worktree, and supports fallback chains so a preset can hand off to another when its provider becomes unreachable.

Presets are agent-scoped launch configurations. For multi-panel workspace layouts (multiple agents, terminals, and recipes laid out across worktrees), see Recipes instead.

What a Preset Is

Every preset is an AgentPreset object: a stable ID, a display name, and optional overrides for the agent's launch flags, environment, and UI behavior.

{
  "id": "plan-mode",
  "name": "Plan Mode",
  "description": "Read-only planning session",
  "env": { "ANTHROPIC_MODEL": "claude-opus-4-7" },
  "args": ["--mode", "plan"],
  "dangerousEnabled": false,
  "customFlags": "",
  "inlineMode": false,
  "color": "#36CE94",
  "fallbacks": ["default"]
}

The id is sanitized to [a-zA-Z0-9_.-] and capped at 100 characters. The name is what appears in toolbar menus and the preset picker.

Three Preset Sources

Daintree merges three sources of presets in priority order, first match wins:

  • Custom: your own presets, created in Settings > CLI Agents > Presets and stored per-user.
  • Project: shared JSON files in .daintree/presets/{agentId}/, committed alongside your code so teammates pick them up automatically.
  • Registry: built-in presets shipped with the agent itself (Mistral Vibe's five defaults, for example), plus Claude Code Router presets discovered at runtime.

If a custom preset has the same ID as a project preset, the custom one wins. That's the escape hatch for overriding a teammate's shared preset locally without touching the JSON.

Creating, Editing, and Deleting Presets

Open Settings > CLI Agents, pick an agent, scroll to the Presets section, and click Add Preset. The form covers name, description, environment variables, launch args, custom flags, the dangerous-mode toggle, the inline-mode toggle, a brand color, and the fallback chain.

Project presets are read-only in the UI for now. Author them by editing the JSON files in .daintree/presets/ directly, then use the Duplicate as custom action on the row to fork a copy you can edit through the form.

Note
Project presets carry a "Project Shared" badge in the picker. The UI can't edit them in place yet. Pick Duplicate as custom to fork one into your custom presets, or edit the JSON file by hand.

Default vs Per-Worktree Preset

Preset resolution runs in priority order:

  1. Per-worktree override: if one is set, it wins.
  2. Agent-level default: the preset marked as default in Settings.
  3. First available preset: whatever the registry returns first.

The agent-level default is stored as agentSettings.presetId and set from Settings > CLI Agents > Agent > Presets > Set as default. The per-worktree override is stored as agentSettings.worktreePresets[worktreeId] and set from the toolbar.

Tip
The toolbar dropdown writes to the per-worktree map. Picking a preset on one worktree doesn't change what launches on another. Setting an agent-wide default is a Settings action.

Launching With a Preset

Each toolbar agent button shows the name of the active preset when it isn't the bare default. To pick a different preset:

  • Right-click the agent button: opens a context menu with a Launch with Preset submenu listing every available preset. The current effective default for this worktree shows a checkmark.
  • Chevron picker: the dropdown arrow next to the button opens the same picker for mouse users.

Picking a preset launches a new session with that preset's flags applied and writes the choice to the worktree override.

Fallback Chains

The fallbacks field on a preset lists preset IDs to try in order if launching the primary preset fails. The cap is three entries per chain. When the chain is loaded, Daintree silently strips self-references, duplicates, and IDs that don't match any known preset.

Fallbacks fire on connection errors and hard auth failures. They don't fire on a bad-prompt rejection or an out-of-credits 402 response. Those go through the regular error path so you can step in.

A typical use: a primary preset pointing at a self-hosted OpenAI-compatible endpoint falls back to the registry default if the endpoint is unreachable.

Note
The cap is three fallbacks per preset. Self-references and unknown IDs are stripped silently when the chain loads, so a misconfigured entry won't crash the launcher. It just won't fire.

Shared Project Presets

Daintree reads shared presets from .daintree/presets/{agentId}/{preset-id}.json in the active project's root. One JSON file is one preset. Required fields are id and name. Everything else is optional and mirrors the AgentPreset shape above.

Daintree polls the directory every 30 seconds, so a teammate's git pull surfaces new presets without an app restart. Duplicates in the same agent directory keep the first-seen file and log a warning. Symlinks under .daintree/ are rejected on write, for safety.

Provider Templates

Some agents ship with provider templates for preset creation. Claude Code has six: anthropic-native, Z.AI, OpenRouter, DeepSeek, Ollama for local, and a custom OpenAI-compatible template. Create a preset From template and the non-secret env vars (base URL, model aliases, timeout) are pre-filled. API key fields stay blank for you to fill in.