Quick actions
Launch an agent from a ticket, set up new worktrees, and save project scripts.
Tegment saves three kinds of project automation, each running at a different moment:
- Quick actions: run when you start work on a ticket, usually to launch a coding agent.
- Post-creation commands: run automatically every time a worktree is created.
- Templates: project scripts you run on demand.
You set all three up in Tegment's UI, so you never have to write a config file by hand. Post-creation commands and templates are saved to your repo's .tegment/config.json so they're shared with everyone who opens the project; quick actions are kept in your app settings. The JSON shown below is just what Tegment writes, for reference.
Quick actions#
A quick action launches a coding agent when you create a worktree from a ticket, with a prompt already pointed at that ticket. You set a default per source (Jira, GitHub issue, GitHub PR); when you start work from that source, Tegment runs its default, or you can pick another.
Configure them under Settings → Quick Actions. They can be global or scoped to one project, and they're an app setting, not part of the repo config.
Pick an agent
Each quick action targets an agent. Set it to Any to write one prompt that works across every agent (you pick the concrete agent when you start work, or Tegment uses your default agent), or target a specific one (Claude Code, OpenCode, Gemini, Codex, or Cursor) when you want a prompt tuned to it. See Supported agents for what each one can do.
Write the prompt
A quick action carries a prompt: you write what the agent should do, and Tegment builds the actual command for the chosen agent from its agent settings. The prompt can reference the ticket through variables:
Implement {key}: {title}Available variables include {key}, {title}, {description}, {type}, {priority}, {labels}, {url}, and {worktreePath}, plus {branch} and {baseBranch} for GitHub PRs. For a long prompt, set the quick action's delivery to a temporary file, and Tegment renders the prompt, writes it out, and passes the file to the agent automatically.
You choose how the agent gets the ticket's context. The cleanest way is to pass just the key and let the agent fetch the rest through Tegment's built-in MCP server, for example with a prompt of Implement {key}. Use the tegment MCP server to fetch the details. You can also hand the agent the content directly with {description}, or lean on whatever integration your agent already has.
Agent commands and flags#
A quick action carries the prompt; the command Tegment actually runs comes from each agent's own settings. Open Settings → AI Agents, pick an agent, and you can adjust how it's launched:
- Command: the executable Tegment runs, e.g.
claude. - Prompt flag: the flag the prompt is passed with. Leave it empty to pass the prompt as a positional argument, or set one like
-pif the agent expects a flag. - Restore flag: the flag that resumes the agent's previous session, e.g.
--continue. - Extra arguments: anything else to append on every launch (optional).
- Auto-approve flag: the flag that lets the agent act without stopping for per-step confirmation, e.g.
--dangerously-skip-permissions.
Tegment combines these with the quick action's prompt to build the final command, so you configure an agent once and every quick action that targets it (or Any) inherits that setup.
Post-creation commands#
These run, in order, right after a worktree is created, ideal for getting a fresh checkout ready: install dependencies, copy a local env file, generate types.
{
"postCreationCommands": [
{ "name": "Install", "command": "npm install", "continueOnError": false, "order": 0 },
{ "name": "Copy env", "command": "cp {main_repo_path}/.env ./", "continueOnError": true, "order": 1 }
]
}name: label shown while the command runs.command: the shell command, run in the new worktree directory.order: commands run from low to high.continueOnError: whentrue, a failure doesn't stop the commands that follow.
Tegment runs them in sequence and shows progress for each one. You can skip them for a given worktree when you create it.
Templates#
Templates are reusable project scripts you run on demand in a worktree: npm install, a dev server, Storybook, a test watcher, a lint pass. Each opens in a terminal pane.
{
"templates": [
{ "name": "Dev server", "command": "npm run dev", "runMode": "visible", "category": "Run", "order": 0 },
{ "name": "Typecheck", "command": "npm run typecheck", "runMode": "background", "order": 1 }
]
}name/command: label and the command to run.runMode:visibleopens a terminal pane you can watch;backgroundruns it without taking a pane.workingDirOffset: optional path relative to the worktree root to run in (for monorepo subfolders).category/order: group and sort templates in the picker.