Create and Edit Recipes
Authoring a recipe: the Recipe Manager and its actions, importing, the editor and its panel cards, saving or cloning the layout you currently have open, setting a project default worktree recipe, and the variables a recipe can substitute into a prompt.
The Recipe Manager
The Recipe Manager is a dialog for managing every recipe in one place. Open it from the action palette (Shift-Command-P Control-Shift-P Control-Shift-P and search for "Manage recipes"), or with the Manage recipes button under the recipe cards on the empty-canvas launcher.
A Filter recipes… field and an Import menu stay pinned at the top while the list scrolls. Below them, recipes are grouped by source:
- Global recipes ("Yours, in every project").
- Project recipes ("Yours, in this project only"), with the current project's name beside the heading.
- Team recipes ("Committed to .daintree/recipes/ and shared with everyone on the repo"), shown when the repository holds any.
- Plugin recipes ("Provided by installed plugins, in every project"), shown when an enabled plugin contributes any.
Each row carries the recipe name and, where they apply, a Pinned, Read-only or Overridden by team recipe badge. The line under it names the supplying plugin or the worktree a recipe is tied to, then the terminal count and what the recipe launches, then when it was last used, or "Never used". With no recipes at all, the dialog shows No recipes yet with buttons to create or import one.
Per-Recipe Actions
Each row has an Edit recipe button (the pencil) and a More actions menu (the ⋯ button):
| Action | Notes |
|---|---|
| Edit recipe | Opens the recipe editor. Not offered for plugin recipes, whose definitions are read-only. |
| Pin to canvas / Unpin from canvas | Lists the recipe first on the empty-canvas launcher. The same setting as the editor's Pin to canvas checkbox. |
| Duplicate recipe | Makes a copy under a name that collides with no existing recipe. A Global recipe's copy is Global, a project recipe's copy is written to the repository as a Team recipe, and a plugin recipe's copy becomes a Global recipe you own. |
| Save as team recipe… | Writes a copy of a Global, project or plugin recipe into .daintree/recipes/. Not shown for recipes already in the repository, or with no project open. See saving a recipe to the repo. |
| Copy as JSON | Copies the recipe as JSON. A brief "Copied" flash confirms it; a refused clipboard write shows an error toast with Retry. |
| Export to file… | Opens a save dialog to write a .json file. |
| Delete recipe… | Removes the recipe after confirmation. Not offered for plugin recipes: remove or disable the supplying plugin to withdraw its contribution. |
The delete confirmation distinguishes what can be recovered from what cannot: an in-repo recipe that has been committed can be restored from git, while a recipe stored only on this machine can't be. If the delete fails, the dialog keeps the error and the button becomes Retry delete.
Plugin recipes can retain local presentation preferences such as their canvas pin and issue-assignment choice without changing the plugin's definition. To customize commands, prompts, or panel layout, save a copy to the repository and edit that copy.
Creating Recipes
Click New in the header of the Global recipes or Project recipes section, depending on where you want the recipe to live. The same editor opens from Add recipe in Settings > Project > Recipes, and from Create new recipe… at the end of the recipes on the empty-canvas launcher, which ties the draft to that worktree so the prompt preview can fill in real values.
Saving the current layout
To turn panels you already have open into a recipe, open a worktree card's menu (the ⋯ button, or right-click the card), then Recipes > Save current layout as recipe…. The item appears once the worktree has open panels.
Daintree captures up to ten of the worktree's open panels, in the grid or the dock, and opens the editor on that draft. Nothing is saved until you click Create recipe. For each panel the draft records:
- its type, which for an agent is the agent it was launched as;
- a title, only if you set one yourself;
- a terminal's command, or a dev server's dev command;
- its after-exit behavior.
Initial prompts, agent arguments and environment variables are not captured. Add prompts and arguments in the editor before you save.
Importing Recipes
The Import menu beside the filter has two entries:
- Import from clipboard… opens the Import recipe dialog: an Import as selector (Project (current project only) or Global (all projects)) and a text area for the JSON.
- Import from file… opens a picker for
.jsonfiles. The recipe goes into the current project when one is open, and becomes Global otherwise.
Settings > Project > Recipes has the same dialog behind Import recipe. A
project import is written to .daintree/recipes/ like any other project recipe.
Import validation requires a name and a list of panels, and rejects a recipe with more than ten. It drops an individual panel rather than rejecting the whole recipe when the panel has an unknown type, or control characters in its command, arguments, dev command or environment variables. The import only fails if no valid panels remain afterward.
Separately, Daintree refuses to save any recipe, imported or edited, whose environment variable value looks like a credential. The error names the variable and the pattern it matched, so you can move the secret somewhere that is not written to disk in the recipe.
The Recipe Editor
The recipe editor opens as Create recipe or Edit recipe. Recipe-level settings sit at the top, panel definitions below, and the footer holds Cancel and Create recipe (or Update recipe). Closing it with unsaved edits asks whether to Discard changes.
Recipe-Level Fields
- Recipe name: required, and focused when the editor opens. Saving without one leaves the editor open with "Name the recipe to save it".
- Scope: Project (current project only) or Global (all projects). Project is unavailable when no project is open. On edit this is read-only, since scope cannot change after creation. See recipe scopes
- Pin to canvas: "List this recipe first on the canvas when a worktree has no open terminals". Pinned recipes lead the launcher, and form its Pinned group in list mode
- Auto-assign issue: whether the linked GitHub issue is assigned to you during quick worktree creation. Options: "Always assign to me" (default), "Ask before assigning", "Never assign". See Code Forge for issue linking setup
Panel Definitions
The Terminals (N/10) section holds one card per panel, from one to ten. Add terminal appends a card, and each card's remove button deletes it (the last card can't be removed). A card's Type is Terminal, an agent (Claude, Gemini, Codex, OpenCode), or Dev server, and its fields follow the type:
| Panel Type | Fields | After exit |
|---|---|---|
| Terminal | Title, Command | Send to trash (default), Keep for review, Remove completely |
| Agent | Title, Arguments (e.g. --model <model-id>), Initial prompt (supports variables) | Keep for review (default), Send to trash, Remove completely |
| Dev server | Title, Dev command (leave it empty to use the project default or auto-detect from package.json) | Send to trash (default), Keep for review, Remove completely |
Every field except the type is optional. An empty Title gives the panel its default tab label. Whatever you choose for After exit, a panel that fails is always preserved for debugging; the editor says so under each selector. All panels run in the active worktree's directory.
A panel can also carry environment variables, as an env object in the recipe's JSON. The editor has no
field for them: it keeps existing values when you edit a recipe, and you add new ones by importing JSON. A panel's
environment variables are layered over your agent environment as described below.
A recipe's agent panels can name any of Daintree's launchable agents; the stored type is an agent id, and the importer accepts every built-in one. The editor's own type dropdown is narrower, so the way to build a recipe around another agent is to arrange the panels you want and save the current layout, which records whatever each panel was launched as. When a recipe holds a type the dropdown doesn't list, the editor shows that type as an extra option rather than blanking the field. See Agents for the full roster.
Agent Presets and Launch Flags
The Arguments field on an agent panel takes any CLI flags the agent binary supports. Those flags are
saved in the recipe file and passed verbatim every time the recipe launches. This is where you pin a specific model
for a recipe, for example --model <model-id> for Claude Code.
Beyond those flags, a recipe launch resolves the agent's selected preset, to parity with launching that agent by hand. The worktree-scoped preset beats the agent-level default, and the preset's arguments, environment and behavioral overrides all fold into the spawn. If a worktree-scoped preset has gone missing, the launch falls back to the agent-level default rather than launching bare, and unlike a manual launch, a recipe run never rewrites your saved agent settings while doing so. See Agent Presets for the full resolution order.
Environment variables layer in one direction, each level winning over the one before it:
- Your global agent environment
- The resolved preset's environment
- The environment defined on the recipe's panel
The flags a recipe-launched agent started with are recorded on the panel, so restarting, resuming or continuing that session reproduces the same configuration instead of regenerating a command from whatever your settings say later.
--model <model-id> to the Arguments field, or
put it in the preset the recipe resolves.Cloning the Active Layout
When you create a new worktree in a project that has recipes, the Recipe field in the New Worktree dialog offers Clone current layout first, then the project's recipes with their scope labels, then No recipe. The same field appears when you create worktrees in bulk. Instead of running a saved recipe, Clone current layout snapshots every open panel in the source worktree and forwards that arrangement to the new one.
The snapshot carries a bit more than a saved recipe does. Along with the usual panel types, titles and commands, Daintree forwards the model each agent is running with, any launch flags it started with, and whether each panel was docked, so docked panels land in the new worktree's dock. The new worktree's agents spawn with the same model as the source session, even if that model was chosen mid-session rather than through a recipe.
These live-session values are forwarded, nothing more. They are stripped before anything is written to disk, so cloning a layout does not produce a saved recipe. To make the same model and flag combination reusable, save the layout as a recipe and add the flag to the Arguments field. See Worktrees for the New Worktree dialog and the bulk creation flow.
Default Worktree Recipe
You can pin one recipe as the default for every new worktree in the current project. The setting lives in Settings > Project > Recipes, which is also where recipes can be added, edited, imported and deleted outside the Recipe Manager. The list sits under a Terminal recipes heading, and every row shows its scope label, its terminal count, and badges for Overridden by team recipe, Default, and On empty grid (pinned to the canvas).
Each eligible recipe row has a pin button (Pin as default recipe). Pinning a recipe marks it with the Default badge. Only one recipe can be the default at a time, so pinning a new one clears the previous pin, and pressing the pin on the current default unpins it without deleting anything.
Deleting the default recipe from the Recipes tab clears the pin for you. If the pinned recipe stops being eligible another way (a Team recipe removed by a teammate's commit, or a project recipe that has since been shadowed), Settings shows a Default recipe unavailable warning with a Clear default button so you can pin a replacement.
The default does its work in the New Worktree dialog. When the dialog opens, it pre-selects your pinned recipe in the Recipe field. You can override it for any individual worktree before creating it, and the same default applies to bulk creation. The field resolves its starting value in this order:
- An explicit recipe passed in, for example from a bulk operation
- The recipe you last selected for that project, remembered per project
- The pinned default worktree recipe
- Clone current layout, as the fallback
Variables in Prompts
Initial prompts on agent panels support variable replacement using {{double_curly}} syntax. Variables resolve at run time from the worktree's context,
and the names are case-insensitive. The editor lists them under each Initial prompt field.
| Variable | Resolves To | Example |
|---|---|---|
{{issue_number}} | GitHub issue number linked to the worktree | #123 |
{{pr_number}} | Pull request number linked to the branch | #456 |
{{number}} | Issue number if set, otherwise PR number | #123 |
{{worktree_path}} | Absolute path to the worktree directory | /home/user/project |
{{branch_name}} | Git branch name | feature/issue-42 |
If a variable's context is missing, for example no issue linked, it resolves to an empty string. Unknown variable
names are left unchanged, and so is a known name written another way, such as {{ issue_number }} with spaces or {{issue-number}} with a hyphen. When both an issue and a PR are linked, {{number}} prefers the issue
number. A recipe run on a scratch workspace or a non-git folder has no branch or linked issue, so only {{worktree_path}} fills in there, with the folder's path.
The prompt preview
When an initial prompt contains a {{…}} token, the editor shows a Prompt
preview directly under it, so you see what the agent will actually receive rather than what you typed.
- With worktree context available (you opened the editor from a worktree, saved a worktree's layout, or are editing a worktree-scoped recipe), the preview reads Values from <branch> and shows the substituted text, with each filled-in value highlighted.
- Without worktree context, it reads Values fill in from the worktree at launch and highlights the variables in place.
- When context exists but a variable has no value in it, a warning line names it, for example "{{issue_number}} has no value in this worktree and launches empty".
- A token that isn't a recipe variable is underlined, with a note that it "isn't a recipe variable and is sent as typed".