New session
Start an agent from a ticket or from a few lines of text, and choose where it works.
New session is where you start an agent on a piece of work. You write what the agent should do, or link a ticket, choose where it works, and press Enter. Tegment sets up the branch or worktree, opens a terminal and starts the agent with your prompt.
Opening New session#
- Press Ctrl+Shift+A in a project tab.
- Click the sparkles button in the header of the sidebar's Terminals section. The + next to it opens a plain terminal instead.
- Open an empty group: when a group has no terminals, New session fills the space where the panes would be.
New session opens over the panes and belongs to the project tab it was opened in. Close it with Esc or the close button, and your draft is still there when you come back. Each project keeps its own draft until you start the session or close the project tab.
What the agent should do#
Write the task in the text box, link a ticket, or both.
- Free text: describe the task, and the text is the agent's prompt.
- A ticket: pick one from the Issues list under the text box, which shows the issues from the project's sidebar sections, Jira's first. Search when the list is long, or choose Show all to open the issue browser and Link the issue you want. With a ticket, the quick action for its source sends the ticket to the agent, and anything you write is added after the quick action's prompt.
Paste images into the text box, or drop images and files on it, to send them along with the prompt. Files reach the agent as paths after your text.
Enter starts the session, and Shift+Enter adds a new line.
Where the agent works#
The Where the agent works chip picks one of four places:
| Place | What happens |
|---|---|
| New branch | Tegment creates a branch and a worktree for it, based on the branch you pick. |
| Existing branch | Tegment creates a worktree for a local or remote branch that doesn't have one yet. |
| Worktree | The agent starts in a worktree you already have. Tegment says whether another agent already works there, since two agents in one folder can overwrite each other's changes. |
| Main folder | The agent starts in the repository's own folder, on the branch it has checked out. |
A new branch from a ticket is named from the branch pattern in the project's GitHub or Jira settings. Without a ticket, the name comes from the first words of your text. You can edit it before you start.
A session with a ticket starts on a new branch unless you pick something else. Where a session without a ticket starts is a setting, Where a session without a ticket starts, under Settings → General: New branch (the default) or Main folder. A repository can choose differently on its New worktrees settings page.
The agent#
The Agent chip picks which agent runs, and for an agent that offers them, its model, effort and Auto-approve. Only agents Tegment finds on your machine are offered. See Supported agents for what each one supports.
Above the Start button, a line spells out what Start will do, for example which agent starts, in which worktree and from which base branch, and whether the post-creation commands run first.
After you start#
New session closes and the new terminal takes its place. The work is set up in the background, as when you start work from an issue, so you can carry on while the worktree is created and the post-creation commands run.
A session started from a ticket is named after the ticket. A session without one is named from the first line of your text, and the agent's own title can rename it later unless you have renamed it yourself.
For a Jira ticket, starting also moves the issue when the repository has auto-transition set up.