Impulsev1.2.0
Download

Tasks

A task is a branch checked out in its own folder and opened as its own workspace. You can work on several things at once, or let several agents work in parallel, without stashing, switching branches or keeping a second clone. This page covers the whole lifecycle: starting a task, what Impulse sets up for you, working in it, and archiving it when you're done.

#Why tasks

A normal checkout has one working tree, so it holds one piece of work at a time. When you're halfway through feature/forecast-cache and a bug report comes in, you have to stash or commit half-done work, switch branches, fix the bug, and switch back. If an agent is editing files in that checkout, you can't touch the same files without getting in its way, and two agents in one checkout can't work at the same time.

Tasks remove that problem. Each task gets its own folder with its own branch, so:

  • Your main checkout stays exactly as you left it while you fix the bug in a task.
  • An agent can work in one task while you work in another, or while a second agent works in a third.
  • Each task has its own terminals, file tree, git state and review, because each one is a separate workspace in the sidebar.

#Git worktrees in two sentences

A git worktree is an extra working folder attached to the same repository: it shares the repository's history, branches and objects, but has its own checked-out branch and its own files. Commits made in any worktree are immediately visible to all the others, because there is only one repository underneath.

Impulse's tasks are git worktrees with a naming convention and some setup on top. You don't need to run git worktree yourself.

#What a task gives you

When you create a task, Impulse:

  • Creates a new branch from the base you choose (by default, the branch you're on).
  • Checks it out in a folder beside your repository: <repo>.worktrees/<branch>. For ~/Code/trailhead, a task named fix-elevation lives in ~/Code/trailhead.worktrees/fix-elevation.
  • Copies over the untracked files a fresh checkout lacks, such as .env.
  • Gives the task ports and values of its own when the project settings name them (a dev server port, a database name), written into its .env so its dev stack doesn't collide with the main checkout's. See Ports and values for each task.
  • Opens the folder as a new workspace, grouped in the sidebar under its repository.
  • Notes the task in the repository's .git/impulse/tasks.json, with the branch it started from. That list is how Impulse knows which worktrees are its tasks; worktrees in <repo>.worktrees/ from before Impulse kept it count too.
  • Runs the project's setup script, then starts the agent you picked, in the task's first terminal.

When you're done, Finish Task… lands the work and cleans up: it syncs the task with its base, runs the project's checks, merges the branch and pushes it (or pushes it for review), and archives the task. Archive Task… removes the folder and keeps the branch, with Undo. Impulse marks tasks whose work has landed "merged", and Archive Merged Tasks… clears them all out at once.

#Start a task

#Where to start it

Where How
Menu bar File ▸ New Task… (on Linux, in the titlebar's menu)
Keyboard ⌥⌘N
Command palette ⇧⌘P, then type new task and choose New Task…
A workspace row's + button Hover the row in the sidebar, click +, then choose New Task from trailhead…
A workspace row's context menu Control-click (or right-click) the row and choose New Task…

The menu, shortcut and palette start a task from the repository of the active workspace (in the Scratch workspace, the repository of the active tab's directory). The + button and the context menu start it from that row's repository, so you can start a task for trailhead while you're looking at another workspace. The + and context-menu items only appear on rows that are in a git repository.

Tasks always come from the repository's main checkout. Started from a task's row, or with a task workspace active, the new task's folder still goes beside the repository (~/Code/trailhead.worktrees/…), and From defaults to what the main checkout's branch tracks, not the task's branch.

If there's no repository to start from, Impulse shows "Open a folder in a git repository to start a task." Open the repository as a workspace first (see Workspaces and tabs).

#The New Task sheet

The New Task sheet with "Add trail difficulty filter" typed as the task, main as the base branch, Claude Code chosen to start, and a preview showing branch add-trail-difficulty-filter, folder ~/Code/trailhead.worktrees/add-trail-difficulty-filter, and .env and config/dev.local.json to be copied

The sheet has three fields and a preview.

#Task

A short description of the work, for example "Fix elevation". Impulse turns it into the branch name (see How the branch name is made). The title is only used for the name; it isn't stored anywhere else. Create Task stays disabled until you type something and Impulse has finished looking up the repository's branches and the files to copy (a moment after the sheet opens). Return in this field creates the task.

#From

The base the new branch starts from. It's filled in with the remote branch that the main checkout's branch tracks, for example origin/main, so a task starts from what's on the remote rather than from a local main that may be behind. It's the main checkout's branch even when you start from a task. When that branch tracks nothing, its local name is used (main), and HEAD when the main checkout is on a detached HEAD.

If the local branch has commits you haven't pushed, a note under From says so, for example "main has 2 unpushed commits that aren't included; type main to include them."

In a trusted repository (see Getting started), Impulse fetches the remote when the sheet opens, showing "Fetching origin…" beside From. You don't have to wait: a task created before the fetch finishes starts from what was fetched last. In a folder you haven't trusted, Impulse doesn't fetch on its own; click Fetch beside From to fetch. If fetching fails, the reason shows under From, and you can still create the task.

You can type any other base git understands: a local branch (main), a remote branch (origin/main), a tag (v0.2.0) or a commit. If you clear the field, the branch starts from the repository's current HEAD. The new branch doesn't track its base, even a remote one, so the first Git ▸ Push publishes it under its own name rather than pushing to main.

#Start

What runs in the task's first terminal. Just a terminal (the default) opens a shell and nothing else. The rest of the list is every supported agent that Impulse finds on your login shell's PATH, by its display name: Claude Code (claude), Codex (codex), Gemini CLI (gemini), Aider (aider), opencode (opencode), Amp (amp), Copilot CLI (copilot), Cursor Agent (cursor-agent), Goose (goose), Qwen Code (qwen), Crush (crush) and Pi (pi). Agents that aren't installed don't appear. The agent starts with no arguments; type your first prompt into it once it's running.

#Move uncommitted files

When the main checkout has uncommitted files, the sheet offers to take them along: Move trailhead's 12 uncommitted files into this task. Tick it to start the task with that work in it; see Move work into a new task. It can only be ticked when From is the main checkout's current commit, since that's what the changes were made on; otherwise it says so, with Start from main to set From.

#The preview

The box below the fields shows what will happen before you commit to it:

Line Shows
Branch The branch name made from the title, already made unique. Shows — until you type a title.
Folder Where the task's folder will be, for example ~/Code/trailhead.worktrees/fix-elevation. Shows — until you type a title.
Copies The untracked files that will be copied into the task, for example .env. Shows … while Impulse looks them up, and "nothing (add patterns to .worktreeinclude)" when nothing matches.
Clones Folders cloned in from the main checkout, such as vendor/. Shown only when the project settings list some. See Cloning folders into tasks.
Values The task's own ports and values, such as APP_PORT 8100 · .env: DB_DATABASE. Shown only when the project settings name some; when no slot has its ports free, a note under the details says so. See Ports and values for each task.

When the project has nothing set up for tasks yet (no setup script, clones or values), the sheet says so, naming the lock files it found ("No setup script. This repository has composer.lock and package-lock.json."), with Set Up This Project for Tasks…, which closes the sheet and opens Project Setup.

Click Create Task (it reads Creating… while it works) or press Return. Cancel or Esc closes the sheet without creating anything. If creation fails, the sheet stays open and shows the reason in red, so you can fix the title or base and try again.

#How the branch name is made

Impulse makes a branch name from the task title with these rules:

  1. Accents are removed and letters are lowercased ("Élévation" becomes "elevation").
  2. ASCII letters, digits and / are kept. Every run of other characters (spaces, punctuation, symbols) becomes a single -.
  3. Dashes and slashes at the end are dropped, and the name is cut to at most 48 characters.
  4. If nothing is left (for example, the title was all punctuation), the name is task.
  5. If a local branch with that name already exists, Impulse adds -2, then -3, and so on until the name is free.

A / in the branch name is fine (feat/search-ui), but the task's folder replaces each / with -, so every task is a single folder: branch feat/search-ui lives in trailhead.worktrees/feat-search-ui.

Task title Branch Folder (under ~/Code/trailhead.worktrees/)
Fix elevation fix-elevation fix-elevation
Fix the login bug! fix-the-login-bug fix-the-login-bug
feat/Search UI feat/search-ui feat-search-ui
Fix elevation (taken once) fix-elevation-2 fix-elevation-2
!!! task task

Only local branch names are checked. If you want a specific name, type it as the title (fix/elevation-units); the preview shows exactly what you'll get.

#What happens when you click Create Task

  1. Check the folder. If the task's folder already exists, Impulse stops and shows "~/Code/trailhead.worktrees/fix-elevation already exists." in the sheet.
  2. Create the worktree. Impulse runs the equivalent of git worktree add --no-track -b fix-elevation ~/Code/trailhead.worktrees/fix-elevation origin/main from the repository, creating the trailhead.worktrees folder if needed. Any git error (for example, a base that doesn't exist) is shown in the sheet.
  3. Copy untracked files. The files listed under Copies are copied from the repository into the same relative paths in the task. A file that already exists in the task (because it's tracked and was checked out) is left alone. See Which files are copied.
  4. Carry over trust. If the repository is a trusted folder, the task folder is trusted too, so language servers, formatters on save and background fetch work in it straight away. If the repository isn't trusted, the task folder isn't either, and you're asked about it like any other folder you open (when Ask before trusting folders is on). Trusting the parent folder from the trust prompt (for example ~/Code) covers task folders too, because they live beside the repository, except tasks made from a remote branch (see Open a branch as a task). Archiving a task takes its folder off the trusted list again, so a later task at the same path (another branch, perhaps someone else's) starts out restricted. See Getting started for workspace trust.
  5. Ask about the project file. If the task has a .impulse/project.toml with commands or per-task values in it and you haven't trusted that exact file yet, Impulse asks before running or writing anything from it. See Project configuration.
  6. Write the task's own values. If the project settings name ports or values that have to differ per task, the task gets a slot and its values are written into its copy of .env, before setup runs. If no slot up to 999 has its ports free, the task gets none, and its .env keeps the main checkout's values. See Ports and values for each task.
  7. Open the workspace. The task opens as a new workspace with one terminal in the task folder. That terminal runs the project's setup script (if there is one and you trusted the file), then the agent you chose under Start. When both are set, they run as one command joined with &&, for example npm ci && claude, so the agent only starts if setup succeeds.
  8. Confirm. A toast says "Started task fix-elevation."

#Which files are copied

A new worktree only contains tracked files. Files you keep out of git, such as .env with local secrets, aren't there, and your app may not run without them. Impulse copies them for you, based on:

  • .worktreeinclude at the repository root, if the file exists: one pattern per line.
  • No .worktreeinclude: the defaults .env, .env.local and .claude/settings.local.json (Claude Code's project-only settings, where "This project only" agent hooks live, so a new task keeps the project's hooks).
  • [worktrees] copy in .impulse/project.toml: extra patterns, added to whichever of the two above applies.

In the trailhead project, .worktreeinclude contains:

# Local settings a fresh checkout doesn't have
.env

Patterns name files relative to the repository root and can use shell wildcards (*, ?, […]) in the last part of the path: .env* matches .env, .env.local and .env.test; config/*.local.json matches the matching files in config/. Only files are copied. A pattern that names a folder (node_modules, config) copies nothing, and folders aren't searched recursively. Patterns that point outside the repository are ignored. The full format is in Project configuration.

The list is worked out when the sheet opens, from the files in the repository at that moment; the Copies line shows the result.

For folders, such as vendor or build output, list them under [worktrees] clone and Impulse clones them in at once; see Cloning folders into tasks. For things that should be built fresh, use a setup script (setup = "npm ci" in .impulse/project.toml); see Setup script.

#Move work into a new task

Feature work that started in the main checkout can move into a task of its own, so the main checkout is free to pull, merge and run the dev server again. Choose Move Changes to New Task…:

  • from the main checkout's row in the sidebar (its context menu),
  • from the Changes panel: Move All Changes to New Task… in its ⋯ menu, or Move to New Task… on one file's context menu, to move just that file,
  • from the list of files two workspaces share, when one of them is the main checkout (Move to New Task…; see When workspaces change the same files),
  • or by ticking the box in the New Task sheet.

Each opens the New Task sheet with the box ticked and From set to the main checkout's branch. Name the task, choose what to start, and click Create Task:

  1. Impulse saves the main checkout's uncommitted work in a safety snapshot.
  2. It makes the task from the main checkout's current commit, the one the changes were made on.
  3. The files arrive in the task as they were, unstaged: edited files edited, new files new, deleted files deleted.
  4. In the main checkout, those files go back to the last commit, and the new files that moved are removed. Other untracked files, and ignored files such as .env, stay where they are; the task has its own copy of .env anyway.
  5. The toast says "Started task tidy-forecast with 12 files from trailhead." with Undo, which puts the files back in the main checkout and removes the task (anything new in it is kept in a snapshot). Undo saves the main checkout in a safety snapshot first. A moved file you've changed in the main checkout since the move is left as it is, and then the task is kept too, with its version of the file, and a toast names the files. If the files can't be put back at all (another git command is using the repository, say), the task is kept and Impulse says why.

Two kinds of changes stay in the main checkout, and a second toast names them:

  • Folders with a git repository of their own, such as a clone you made inside the checkout. A snapshot can only record such a folder by its commit, so moving it would leave an empty folder in the task and delete the repository, with any history it hasn't pushed.
  • Files edited while the move ran, by an agent or by the editor saving. The main checkout keeps the edits, and the task gets the file as it was when the move started.

An agent that's working in the main checkout can't follow its files: the move waits until it has finished its turn ("Claude Code is working in trailhead, so its files can't move until it finishes its turn."). Afterwards, choose the agent under Start to begin a fresh one in the task, and close the old one.

#Tasks in the sidebar

The Workspaces section of the sidebar: a "trailhead" group header over three rows: trailhead on feature/forecast-cache; the active fix-elevation task, whose agent has finished (a bot with 1, a +9 diff stat and an attention badge); and add-trail-photos, with an agent working (a spinner) and +7

A task appears in the Workspaces section at the top of the sidebar like any other workspace, named after its folder (fix-elevation). When two or more open workspaces belong to the same repository (the main checkout and its tasks, or several tasks), Impulse groups them under a header with the repository's name (trailhead) and indents their rows. With only one workspace open from a repository, there is no header. Click the header to collapse its workspaces under it, and again to bring them back; a collapsed header shows how many workspaces it holds, or the attention badge when any of their terminals needs you, and carries the selection mark while the workspace you're in is one of them. Switching to a workspace in a collapsed repository (from the palette, a shortcut or a notification) expands it again. Which repositories are collapsed is kept with the session.

The trailhead group collapsed: its header, with a right-pointing chevron, the repository's name in bold because the workspace you're in is one of its own, and an attention badge with 1, over the Scratch workspace's row

Each row shows, from left to right:

  • The workspace name, and the branch when it differs from the name. A task named after its branch (fix-elevation on branch fix-elevation) shows the name once.
  • "merged" when the task's branch is merged into its base, so the task can go (see Archive merged tasks).
  • A warning sign with a count when the workspace changes files that another workspace of the repository also changes (see When workspaces change the same files).
  • Listening ports from the task's terminals (:3000), for example its dev server.
  • ↓ and a count when the workspace's branch is behind its upstream (after a fetch). Click it to pull.
  • A spinner while an agent in the workspace is working, and a bot icon with a count when agents are waiting for you.
  • The workspace's uncommitted changes as added and removed lines.
  • A badge with the number of tabs that need attention, or the tab count.

Hover a row for its full path, branch, changed-file count and tab count, and for a task Impulse made, its slot, base and ports ("Task slot 1 · from origin/main · APP_PORT 8100"). Click the chevron (or choose Show Tabs from the context menu) to list the workspace's tabs under it.

#When workspaces change the same files

Tasks keep work apart on disk, but two of them (or a task and the main checkout) can still be changing the same files, and that only shows up as conflicts when the work is merged. Impulse keeps track of what each of a repository's workspaces changes: the main checkout's uncommitted files and unpushed commits, and each task's uncommitted files and commits since it left its base. Every task Impulse made counts, whether or not it's open in the sidebar.

  • The row. When a workspace shares files with another, its row shows a warning sign and how many files (⚠ 17). Hover it to see which workspaces it shares them with.
  • The list. Click the warning sign for each workspace it overlaps with and the files they share; click a file to open it. Check for Conflicts works out, without touching either folder, which of those files would conflict if the two were merged, uncommitted work included (it needs git 2.38 or later), and marks them. When one of the two is the main checkout, Move to New Task… moves its uncommitted work into a task of its own (see Move work into a new task).
  • A notification, once. When two workspaces that didn't overlap start to, Impulse says so once: "fix-elevation and trailhead now change the same 3 files" (a toast, or a desktop notification when Impulse is in the background). More files between the same two don't notify again. Turn it off with Notify when tasks change the same files (task_overlap_notify) in Settings ▸ Terminal ▸ Agents.
  • What counts. Every file, lock files included: a lock file changed on both sides is one of the worst conflicts to sort out. The task's own env file never counts. To leave out files that are only noise in a project, list them in Ignore when tasks overlap in Project Setup (overlap_ignore).

The row's context menu has New Task…, Move Changes to New Task… (on the main checkout, when it has uncommitted files), Project Setup…, Open Folder as Workspace…, Rename…, Reveal in Finder (Show in File Manager on Linux), Copy Path, Show Tabs / Hide Tabs, Move Up / Move Down, Finish Task… (on task rows, first in the menu), Archive Task… (on task rows only; first in the menu once the task is merged), Archive Merged Tasks… (when any of the repository's tasks is merged) and Close Workspace. The repository's group header has Archive Merged Tasks… too.

Impulse treats any workspace that is a linked git worktree as a task, including worktrees you created yourself with git worktree add. They get Archive Task… too.

#Work in a task

A task workspace behaves like any folder workspace. Everything you do in it applies to the task's folder and branch, never to your main checkout.

  • Terminals. New terminal tabs (⌘T) and splits start in the task folder. Switch between the task and your other workspaces by clicking rows in the sidebar or with Switch Workspace… (⌃⌘O).
  • Agents. If you started an agent, it's running in the first terminal. Its status shows on the tab, on the workspace row and in the titlebar's Agents button, and ⇧⌘U jumps to whichever agent needs you next. See Agents.
  • Project actions. Run Project Action… (⌃⌘R) runs the actions from the main checkout's .impulse/project.toml, in the task folder. See Project configuration.
  • Review the task's changes. Git ▸ Review Changes (⇧⌘G) opens Review on the task's uncommitted changes. To see everything the task changed since it branched (commits and uncommitted work together), open the scope menu at the top left of Review and choose Compare with origin/main (Impulse offers the remote's default branch, or a local main/master when there's no remote default). After an agent's turn, ⇧⌘I reviews just that turn. See Review.
  • Commit. Git ▸ Show Changes (⌃⇧G) opens the Changes panel for the task's repository, where you stage and commit. See Git.
  • Push. Git ▸ Push publishes the task's branch the first time (it sets the upstream on your default remote) and pushes after that.
  • Open a merge request. Impulse uses git only, so pull requests and merge requests are opened on your host's website. Many hosts send a link for that back when you push, and the push's toast shows it with Open Link (see Git).

Because all tasks share one repository, a commit in a task is immediately visible from your main checkout and from other tasks: in History, in the branch switcher and to git log.

#Example: two agents in parallel

  1. With the trailhead workspace active, press ⌥⌘N. Type "Fix elevation", set From to origin/main, choose Claude Code under Start, and click Create Task.
  2. In the new fix-elevation workspace, type the prompt for Claude Code in its terminal.
  3. Click the trailhead row in the sidebar and press ⌥⌘N again. Type "Add trail difficulty filter", choose Codex, and click Create Task.
  4. Give Codex its prompt. Both agents now work in separate folders on separate branches.
  5. Go back to trailhead and keep working on your own branch. When an agent finishes or needs input, its row and tab show it; press ⇧⌘U to jump to it.
  6. When an agent finishes a turn, press ⇧⌘I in its terminal to review exactly what it changed.

#Running agents in parallel

Tasks keep agents' files apart, but not everything else: two agents can still change the same files, and the work only meets when you merge. A few habits keep parallel work from colliding.

  • Keep the main checkout for integrating. Do feature work in tasks, and use the main checkout to pull, merge and run your dev server. Uncommitted work piling up there blocks pulls and merges later, and no task can see it. When it happens anyway, Move Changes to New Task… moves it into a task.
  • Split the work by area, not just by branch. Two tasks that rewrite the same files conflict when they meet, however separate their branches are. A change that touches nearly everything (a framework upgrade, a rename across the project) should run alone, or land first so other tasks start on top of it.
  • Commit small and often, in every workspace. git can merge commits; it can't merge a pile of uncommitted files, and nobody can review one.
  • Keep a long-running task current. Merge the base into its branch every day or two (in the task: git fetch then git merge origin/main), so conflicts show up while they're small, in the task that has the context to resolve them.
  • Give each agent its own browser. Browser tools for agents often share one browser profile, so a second agent finds it already in use. The Chrome DevTools MCP server, for example, takes --isolated to give each agent a temporary profile of its own.
  • Check after a big merge. A merge without conflicts can still break code that relied on something the other side changed. After merging a large change, reinstall dependencies and run the type checker or tests before anything else (in trailhead, npm ci && npm test).
  • Clean up worktrees you made yourself. Impulse archives its own tasks. For worktrees made with git worktree add, git worktree list shows them all, git worktree remove <path> removes one, and git worktree prune forgets folders you deleted by hand.

#Worktrees Claude Code makes

Claude Code makes worktrees of its own: for a session started with claude --worktree, and for a subagent started with isolation: "worktree". They're in the repository's .claude/worktrees/ folder, on branches named worktree-<name>. Impulse lists them as tasks, "started for Claude Code", so they show with the repository's other tasks (in Switch Workspace, impulse tasks and the hooks' summaries) and you can open, review, finish and archive them like any other. They have no slot or base. A subagent's worktree also appears in the sidebar as soon as the subagent starts (with hooks installed), under its repository and named for what it was asked to do, with the working ring while it runs; nothing runs there until you open it, when it gets its first terminal. Claude Code removes a subagent's worktree when the subagent changed nothing, and Impulse drops the task with it, and the sidebar's row too unless you've opened it. A row you close doesn't come back.

#Tasks agents start

An agent that has split its work into independent pieces can ask Impulse to start a task for each one, with an agent working on a brief it wrote. Agents don't do this unprompted: tell them to in their instructions file. It asks with Impulse's MCP server (create_task) or the command line:

shell
impulse tasks new Fix elevation units --agent claude --brief-file brief.md
  1. You're asked. Impulse opens New Task in the agent's window, filled in from the request, with a line naming who asked ("Claude Code in trailhead (main checkout) wants to start this task.") and the brief under Start. Change anything (title, From, agent, brief), then Create Task, or Cancel. The agent's terminal asks for attention while the sheet waits, and a second request gets "Another task request is waiting for the user." until you answer.
  2. The task is made as yours would be. The same folder, copies, slot and values, trust and setup script as Create Task, in the same order. A request never trusts anything.
  3. The agent starts on its brief. The brief is saved as .git/impulse/tasks/<task>/brief.md, outside the task's folder so it's never committed. Claude Code, Codex and opencode start with it as their first prompt, read from that file with command cat, which an alias for cat can't change (claude -- "$(command cat …/brief.md)"; opencode takes it as --prompt="$(command cat …/brief.md)", since its bare argument is the folder to open), so a long brief isn't typed into the shell or kept in its history. Other agents start as usual, and the brief is typed in once Impulse sees them.
  4. The agent hears what happened. The new task, as impulse tasks show describes it, with your changes; or "The user declined: no task was created."

The task's row, on hover, says who it was started for ("started for Claude Code in trailhead"), and impulse tasks (list_tasks) shows it and the brief's first line. impulse tasks show <task> (get_task) shows the whole brief.

#When Impulse doesn't ask

Settings ▸ Terminal ▸ Agents ▸ When an agent asks to start a task (agent_task_creation):

  • Ask me (ask, the default): always the sheet.
  • Start it in trusted projects (trusted_projects): in a trusted repository whose project settings you've trusted, the task is created without the sheet, and a toast says so with Undo, which closes it, archives its folder (keeping what it holds in a snapshot) and deletes its branch if nothing was committed on it. Anywhere else, the sheet.
  • Don't allow it (off): requests are refused, and the MCP server doesn't offer create_task.

Whatever the setting, the sheet always comes up when the request takes the main checkout's uncommitted files (--move-changes), and when it comes from inside a task an agent started, so agents can't start chains of tasks without you. Open tasks agents may start (agent_task_limit, 4 per repository by default; 0 for no limit) refuses requests past the limit, until you finish or archive one.

#Finishing and archiving from an agent

impulse tasks finish <task> (finish_task) opens the task's Finish tab and runs it: commit, sync and check, then it stops at Land, which says the agent asked and waits for you to click Continue. For a task that's already merged there's nothing to land, so it stops before updating the main checkout and archiving, until you click Clean Up. The agent hears each step's outcome, so a failing check comes back to it to fix. It can be the agent working in that task: Finish waits for any other agent working there, not for the one that asked. The first Finish in a repository asks how work lands there, so the agent's waits for you to choose.

impulse tasks archive <task> (archive_task) runs Archive Task…, with its questions and its Undo, and tells the agent whether it was archived.

#Finish a task

#Finish Task

Finish Task… takes a task from done to landed in one tab. Choose it from the task row's context menu, from File ▸ Finish Task…, or from the command palette with the task's workspace active. The Finish tab lists the steps and goes through them when you click Finish. Each step says what it did; one that stops says why and what to do, and Continue picks up from there.

  1. Commit. Everything in the task has to be committed, and no agent there may be working. Otherwise Finish stops ("3 uncommitted files. Commit (or stash) them, then Continue.") with Show Changes.
  2. Sync. Fetches, then merges the base's new commits (origin/main) into the task's branch, in the task's folder. Never a rebase, which would rewrite commits you may have pushed. If the merge conflicts, Finish stops: resolve the conflicts in the Changes panel and commit the merge (or ask the task's agent to, since it knows the branch), then Continue.
  3. Check. Runs the project's check script (npm run typecheck && npm test) in a new terminal tab in the task, and reads pass or fail from its exit status. The script is the one in the project file you trusted when the step starts, even if it changed since the Finish tab opened. A failure stops Finish: fix it, commit, and Continue, which checks again. While it runs, Skip Check skips it. Without a check script the step is skipped, and Set Up a Check… opens Project Setup.
  4. Land. Merge and push, or push for review; see below.
  5. Update the main checkout. When the main checkout is on the base branch with no changes to tracked files, Finish fast-forwards it to the new origin/main. Untracked files (an uncommitted .impulse/project.toml, say) don't hold it back; if the update would overwrite one, Finish names it and leaves the checkout alone. Otherwise it's left alone; its row shows how far behind it is (↓3), and clicking that pulls.
  6. Clean up. If the folder has ignored files, Finish names some of them and asks first, as Archive Task… does; if it holds a git repository of its own, Finish stops so you can move it out. The task's workspace closes (asking about unsaved files and running processes, as usual), its archive script runs and its folder is removed. With Delete fix-elevation once it's merged ticked (the default), its branch is deleted too, and on the remote with …and on origin, after checking again that it's merged and hasn't moved (on the remote: that nobody pushed to it since the last fetch). A branch that moved is kept, and the toast says so. A toast sums it up, "Finished fix-elevation: merged into origin/main as 4c1e9a2.", with Restore Task, which brings back the folder and the local branch (not the merge).

#Merge and push, or push for review

The first Finish in a repository asks how work lands there, and remembers the answer in the settings on this computer. Finishing tasks in Project Setup changes it, and saving there moves it into the project's settings:

  • Merge into origin/main and push. Impulse merges the branch with a merge commit ("Merge branch 'fix-elevation'"), so main's first-parent history has one entry per task, and pushes main. The merge is made in a throwaway folder on origin/main that's removed afterwards, so your main checkout isn't touched, whatever state it's in. If someone pushed to main since the sync, Finish merges their commits too and pushes once more; if the merge conflicts or the push still fails, nothing is pushed and Finish stops. Hooks run as for any merge and push. If the server turns the push down (a protected branch, say), Finish says so and offers Push for Review Instead. Without a remote, the merge goes into the main checkout, and only when it's on the base branch with no changes to tracked files (untracked ones are fine unless the merge would overwrite them).
  • Push for review. Impulse pushes the branch (setting its upstream) and shows what the server said back, with any link in it as a button: GitLab, for example, sends a link for creating a merge request. Open the merge request on your git host as usual; Finish stops there. When a fetch shows the branch merged (squash merges included), the task's row says "merged" and, while the task's workspace is open, a toast offers Clean Up…, which opens Finish to update the main checkout and archive the task.

Finish never looks at CI, which isn't part of git; the check step is its local stand-in.

#Merge by hand

Without Finish, two common ways:

  • Through a merge request. Push the task's branch and open a merge request (pull request) on your git host (see Work in a task). Merge it there as usual, then archive the task.
  • Locally. Switch to the trailhead workspace (the main checkout, on main), choose Git ▸ Manage Branches…, open the … menu on the fix-elevation row and choose Merge into main. You can also merge from History (⇧⌘H): right-click the fix-elevation branch label (or its latest commit) and choose Merge into main. See Git and History.

You can't check out the task's branch in your main checkout while the task exists: git only lets a branch be checked out in one worktree at a time. Merge it instead, or archive the task first.

If the task is still being worked on when you merge its branch (an agent there is working or waiting for input, or the task has uncommitted files), Impulse asks first, for example "fix-elevation is still being worked on: Claude Code is working in the fix-elevation task, and its last commit was 2 minutes ago. Merge 4c1e9a2 anyway?" Merge 4c1e9a2 merges the branch as it is at that commit, so what you merge is what the question named; anything committed after it isn't included. Wait for the agent to finish instead, and merge then.

#Archive the task

Archiving removes the task's folder and closes its workspace, and keeps its branch and commits. Use it when the work is merged, or when you want to put it aside.

  1. Choose Archive Task… from the task row's context menu, or, with the task workspace active, run Archive Task… from the command palette.
  2. Read the confirmation and click Archive. It says what will happen, for example: "The folder ~/Code/trailhead.worktrees/fix-elevation is removed; branch fix-elevation is kept." It also warns when the task has uncommitted files ("3 uncommitted files will be saved in a snapshot that Undo restores."), when the folder has ignored files, naming up to three of them ("Ignored files in it (.env, node_modules/, …) are deleted, and Undo can't bring them back."), and when "The branch has commits that aren't pushed." A task whose folder holds a git repository of its own isn't archived at all: a clone you made inside it, a checked-out submodule (in a task, a submodule's repository lives in the task's own git folder, which archiving deletes) or a repository committed into it. Removing the folder would delete that repository and any commits it hasn't pushed. Impulse says so; move a clone out of the task first, or push a submodule's commits and run git submodule deinit on it. If Impulse can't check (git fails), it doesn't archive either, and it asks before deleting ignored files it couldn't list.
  3. If the task's .impulse/project.toml has commands you haven't trusted yet, Impulse asks about the file (see Project configuration).
  4. The workspace closes. As when closing any workspace, Impulse first asks about unsaved files and running processes in its tabs; if you cancel there, nothing is removed.
  5. Impulse saves any uncommitted work (modified and untracked files that aren't ignored) in a safety snapshot. If the snapshot can't be made, the task is not archived and Impulse tells you why.
  6. If the project file has an archive script and you trusted it, Impulse runs it in the task folder, then removes the worktree folder. In a task folder that isn't trusted (a task made from someone else's branch), Impulse shows the script and asks before running it, every time, as it does for the setup script: the branch decides what the script's commands do. If the script fails or runs longer than two minutes, a toast says "The archive script failed; archiving anyway."
  7. A toast says "Archived fix-elevation. The branch is kept." with an Undo button.

Undo recreates the folder on the same branch, puts back the uncommitted files from the snapshot, trusts the folder again if it was trusted, and reopens the workspace. If the files can't be put back, the folder still comes back, and Impulse says so and names the snapshot that holds them. The toast stays for 15 seconds, so click it right away if you didn't mean to archive.

The Archive confirmation for fix-elevation, saying the folder is removed and the branch is kept, with Cancel and Archive buttons

Archiving… Removes Keeps
The task's folder and everything in it ✓
The task's workspace and tabs ✓
The branch and all its commits ✓
Uncommitted changes (tracked and untracked) ✓ (in a snapshot, for Undo)
Ignored files in the folder (.env, node_modules, build output) ✓

#Archive merged tasks

Once a task's work has landed, its folder is only in the way. Impulse marks a task "merged" in the sidebar when its branch has commits of its own and they're all in its base (the branch in the New Task sheet's From), however they got there:

  • Merged (a merge commit or a fast-forward): the branch's last commit is part of the base.
  • Squash-merged or rebased, as many git hosts do when a merge request is accepted: the base has different commits with the same changes. Impulse checks whether merging the branch into the base would change anything, without touching any folder (this needs git 2.38 or later).

For a remote base (origin/main), Impulse compares with what it last fetched, so after a merge request is merged on your host, Git ▸ Fetch (or the background fetch) brings the label. A task with no commits of its own isn't marked, even though its branch is part of the base: there's nothing of it to have landed. Tasks made before Impulse kept its list of tasks (and worktrees you made yourself) aren't marked either.

Hosts often delete a branch when its merge request is merged. Once a fetch notices (git calls the upstream "gone"), the task's row says so when you hover it: "Its branch was deleted on the remote; it may have been merged there." That alone doesn't mark the task merged, since a branch can be deleted without being merged.

To clean up, choose Archive Merged Tasks… from a task row's or the repository header's context menu. The sheet lists every merged task of the repository, open in the sidebar or not, each with a checkbox and a warning when it has uncommitted files ("2 uncommitted") or ignored files ("3 ignored"; hover it for their names). Ignored files go with the folders for good, and the sheet names some of them. A task whose folder holds a git repository of its own can't be ticked.

  • Delete their branches too deletes each archived task's local branch.
  • …and on origin (shown when the branches were pushed) deletes them on the remote as well.

Right before deleting a branch, Impulse checks again that it's merged and still at the commit it checked: one that got new commits since the sheet opened is kept. On the remote, a branch is deleted only while it's still where your last fetch saw it (git's --force-with-lease), so one that someone pushed to meanwhile is kept there. A toast names whatever was kept.

Click Archive N Tasks. Each task's workspace closes first; as with Archive Task…, Impulse asks about unsaved files and running processes, and a task whose closing you cancel is left alone. Then each task's uncommitted files are saved in a snapshot, its archive script runs (when the project file is already trusted; in a task folder that isn't trusted, Impulse asks first) and its folder is removed. One toast covers them all, with Undo for 15 seconds: it brings back every folder, its uncommitted files and, when they were deleted, the local branches. Branches deleted on the remote stay deleted; push them again to bring them back.

#Delete the branch

Archive Task… never deletes the branch (Archive Merged Tasks… can). Once the work is merged, delete it from Git ▸ Manage Branches…: open the … menu on its row and choose Delete…. Merged branches are marked "merged" there. A branch can't be deleted while a task still has it checked out, so archive the task first.

#Close instead of archive

Close Workspace closes the task's workspace and leaves its folder and branch on disk. Reopen it later from Switch Workspace… (⌃⌘O), where it's listed as a recent folder, or with File ▸ Open Folder as Workspace….

#Open a branch as a task

To work on, review or test a branch that already exists (a colleague's branch, say) without disturbing your own checkout, open it as a task:

  1. Choose File ▸ New Task from Branch…, or type task: in the command palette.
  2. Pick a branch. The list has the local branches that no checkout has open (git lets a branch be checked out in only one place), then the remote branches with no local branch, marked "remote". Type to filter.
  3. Impulse creates the task's folder beside the repository's main checkout, as New Task… does (for trail-search, ~/Code/trailhead.worktrees/trail-search), copies the same untracked files (see Which files are copied), and opens it as a workspace. A remote branch such as origin/trail-search gets a local branch trail-search that tracks it, so Push sends your commits back to it.

For one of your own local branches, the task is set up like New Task…: it's trusted when the repository is, and the setup script runs once you've trusted the project's settings. A remote branch can come from someone else, so its folder isn't trusted on its own (you're asked about it like any other folder you open), even when the folder it's in is trusted (a trusted ~/Code): it stays restricted until you trust the task's folder itself, and Restore Task keeps it that way. Its archive script, like its setup script, runs only when you say so; if there's a setup script, Impulse shows it and asks whether to run it in the first terminal. It asks every time, even when you've trusted the project's settings, because the branch can change what the script does (a package.json script that npm ci runs, for example) without touching them. Choose Don't Run to open the task without it.

Unlike New Task…, opening a branch as a task doesn't start an agent. If the branch is on someone's fork, add their remote first (git remote add sam https://…) and fetch, so its branches appear in the list.

#Gotchas

  • "… already exists." A folder with the task's name is already in trailhead.worktrees. Pick a different title, or move the folder away.
  • Deleting a task folder by hand. If you remove a task's folder in a file manager or with rm instead of archiving it, git still considers its branch checked out there, so you can't switch to or delete that branch. Run git worktree prune in the repository to clear it.
  • node_modules and build output aren't copied. Only files matching .worktreeinclude (or the defaults) are copied, and folders never are. List folders under [worktrees] clone to have them cloned in (see Cloning folders into tasks), or add a setup script such as npm ci.
  • A .worktreeinclude replaces the defaults. Once the file exists, .env, .env.local and .claude/settings.local.json are only copied if a pattern in it matches them. An empty .worktreeinclude copies nothing (except [worktrees] copy patterns).
  • Settings come from the main checkout. Tasks read .impulse/project.toml from the main checkout, committed or not, never from their own folder: a task branch that changes the file only changes what tasks get once it's merged and in the main checkout.
  • A failing setup script stops the agent from starting, because the two are joined with &&. The error is right there in the task's first terminal; fix it and start the agent yourself.
  • Archiving deletes ignored files. .env, node_modules and other ignored files in the task folder are removed with it, and Undo doesn't bring them back (the snapshot only holds files git would track). Archive Task…, Finish Task and Archive Merged Tasks… name some of them first. Copy anything you edited by hand before archiving.
  • Deleting a branch on the remote can't be undone by Impulse. Archive Merged Tasks… with …and on origin checked removes the branches there for everyone. Undo restores only the local branch; git push -u origin <branch> from the restored task publishes it again.
  • Undo is short-lived. If you miss the Undo button, the branch still exists and you can make a new worktree for it with git worktree add ~/Code/trailhead.worktrees/fix-elevation fix-elevation. The uncommitted files are in a commit under refs/impulse/oplog/ in the repository (list them with git for-each-ref refs/impulse/oplog); the newest one ending in archive-fix-elevation holds them, and git restore --overlay --source=<that ref> --worktree -- . in the recreated folder puts them back. Don't wait too long: Impulse keeps these snapshots for two weeks at most, and only the newest 200 in the repository, deleting older ones whenever it takes a new snapshot there (see Safety snapshots and Undo).
  • Branches checked out in a task can't be used elsewhere. git refuses to switch your main checkout (or another task) to a branch that a task has checked out, and refuses to delete it. Archive the task first.
  • Tasks need a git repository. In a folder that isn't in a repository, New Task… only shows "Open a folder in a git repository to start a task."
  • Agents: agent status, review last turn, the composer and hooks
  • Project configuration: .impulse/project.toml, setup and archive scripts, .worktreeinclude
  • Workspaces and tabs: the sidebar, switching and closing workspaces
  • Git: the Changes panel, pushing, Manage Branches, and merge requests on your host
  • Review: reviewing a task's changes against its base
  • Getting started: workspace trust