Work with agents
Send to your agent
Your agent needs the branch, a folder and the context before it can look at a pull request, an issue or a failed CI run. Send to my agent does all of that in one click: it starts your agent on your computer, in a new workspace at the right commit.
9 min read
1. Set up this computer once
Do these steps on the computer where you use the browser. The link opens src on that computer.
Install
srcand log in. See Set up your coding agent.Run the setup:
src agent setupIt registers the
tanstack-source://link handler, so that your browser can opensrc. See The link handler.Install the agent that you want to use: T3 Code, Claude Code, Codex, Grok or OpenCode.
Do this once on each computer. The dialog reminds you: First time on this computer? Run src agent setup once.
Note
If you click Send and nothing opens, your browser found no program for the link. This happens when your src is older than this feature. Run the installer again to update src (see Set up your coding agent), then run src agent setup. The dialog says this too after you click Send.
2. Click Send to my agent
The button is in these places:
- The header of a pull request.
- The header of an issue.
- The header of the Architecture tab, when the tab has a view.
- The buttons of a failed CI run, for people who can run CI.
- Send to agent in the dock at the left edge of the page, on a pull request page or an issue page. It opens the same dialog.
If you are not signed in, Send to my agent opens the sign-in page. After you sign in, you are back on the same page.
- Click Send to my agent, or Send to agent in the dock.
- Under Where should it start?, pick an environment. For T3 Code, also pick the Agent: Claude Code, Codex, Grok or OpenCode.
- Click Send. If your browser asks, let it open the link.
Before you click Send, you can also fill in these fields:
| Field | What it does |
|---|---|
| Terminal | For an environment in a terminal. Leave it on Default to use your src setting. See Pick the terminal. |
| What should the agent do? | A task, at most 500 characters. When it is empty, the agent reads and summarizes first. |
| Include the agent transcripts of this pull request | On a pull request only. See Include the transcripts. |
Tip
The dialog keeps your environment, your agent, your terminal and the transcripts choice in this browser for the next time.
Include the transcripts
A pull request can have the transcripts of the agent sessions that made it, and an intent summary of them. They tell your agent why the author made the change. When you select the box, the brief tells your agent to read them first:
src transcripts intent <number>: the intent summary.src transcripts list <number>: the transcripts.src transcripts view <id>: one transcript.
Your agent runs these commands with your src login, so it reads only the transcripts that you can read. When you have no access, the commands fail, and the agent goes on without them. See Choose who reads agent transcripts.
3. Watch src start the agent
A console window opens with src. It does these steps and prints each one:
- It reads the link with your
srclogin. - It finds your checkout of the repository, or asks to clone it. See When no checkout is found.
- It fetches the commit, if your checkout does not have it yet.
- It makes a new workspace at that commit, named
pr-12,issue-7,architectureorrun-<id>. When the name is in use, it adds-2,-3and more. For T3 Code, T3 Code makes its own worktree at the commit in place of the workspace. - It starts your agent in the workspace with the brief.
The brief is short. It names the repository, the pull request, issue or run, its URL and the commit. It lists the src commands that read the rest, for example src pr diff, and the agent runs them itself. At the end is your task, or the default task of the source.
If the head of a pull request moved after you clicked, src prints The head moved since the link was made. and uses the new head.
Note
When src stops with an error, the console window stays open until you press Enter, so you can read the error.
Done
You click Send to my agent, and your agent starts in its own workspace at the right commit. It already knows which pull request, issue or run it is on, and how to read the rest with src.
What each source opens
| Source | The commit of the workspace | What the agent is asked by default |
|---|---|---|
| Pull request | The head commit, also from a fork | Read the pull request and its diff, summarize what it changes and what needs a close look, then wait |
| Issue | The tip of the default branch | Read the issue, find the code it is about, explain the cause or the plan, then wait. No code changes yet |
| Architecture tab | The commit that the view describes | Read the architecture and give a short tour, then wait for questions |
| Failed CI run | The commit of the run | Read the failed job and its log, find the cause, then wait. No code changes yet |
For a CI run, the brief also names the failed job, and it gives the agent src run view <run> --log-failed.
The environments
| Environment | What src does | How the agent gets the brief |
|---|---|---|
| T3 Code | Starts a thread in a new T3 Code worktree at the commit, and opens the thread in the T3 Code app. | The thread starts with the brief. |
| Claude Code in a terminal | Opens a new terminal window in the workspace and runs claude. | The brief goes into the system prompt, and the task is the first message. |
| Codex in a terminal | Opens a new terminal window in the workspace and runs codex. | The brief and the task are the first prompt. |
| Grok in a terminal | Opens a new terminal window in the workspace and runs grok. | The brief and the task are the first prompt. |
| OpenCode in a terminal | Opens a new terminal window in the workspace and runs opencode. | The brief and the task are the first prompt, given with --prompt. |
| Codex app | Opens a new chat in the Codex app, in the workspace. | The brief and the task are filled in. Press Enter in the Codex app to start. |
Note
Claude Code can first ask if you trust the new folder. Answer yes, and it starts on the task.
T3 Code
- The thread is in the T3 Code project of your main checkout, so it shows under the project that you already have. When T3 Code does not have the project yet,
srcadds it. - T3 Code manages the worktree of the thread. The thread uses the agent that you picked, with the default model of T3 Code for that agent.
srcfindst3on your PATH, or in~/.t3/bin. Without it,srcstops withT3 Code is not installed.- Open T3 Code once before your first launch, so that it saves its environment id. Without the id,
srcstops and tells you to open T3 Code.
On Windows
- Claude Code, Codex, Grok and OpenCode must be on your PATH.
- In a terminal on Windows,
srcwrites the brief to.git/src-agent-brief.mdin the workspace. The first prompt of the agent is thenRead the file .git/src-agent-brief.md and follow it. - Windows Terminal and cmd change quotes and special characters on a command line, so the brief does not go there.
Pick the terminal
The four environments in a terminal open a new terminal window. To pick the terminal for one launch, use Terminal in the dialog. It lists the terminals of your OS:
| OS | Terminals |
|---|---|
| Windows | Windows Terminal, cmd |
| macOS | Terminal, iTerm, kitty, Alacritty |
| Linux and other systems | kitty, Alacritty, GNOME Terminal, Konsole |
A terminal that you pick in the dialog wins over your src setting. With Default, src uses your agent-terminal setting. To set a terminal for every launch, run:
src config set agent-terminal iterm
The values are auto, wt, cmd, terminal, iterm, kitty, alacritty, gnome-terminal, konsole, or the name of any program that takes -e.
Without the setting, src uses one of these:
- On Windows: Windows Terminal, or a cmd window when Windows Terminal is not installed.
- On macOS: Terminal.
- On Linux:
$TERMINALorx-terminal-emulator.
When no checkout is found
src looks for your checkout in the checkouts that src ws knows. It finds it by its git remote, over HTTPS or SSH. When none matches, src asks:
Clone it into <folder>?Press Enter, andsrcclones the repository there.- If you say no, type the path of a checkout that you have.
srcmakes sure that its remote is this repository.
If that folder is already a checkout of the repository, src uses it and asks nothing. If the folder holds something else, src does not offer the clone, and asks for the path.
The clone goes to the clone-root folder. Without that setting, it goes next to your first known checkout. To pick the folder, give its full path:
src config set clone-root <folder>
When there is no terminal to ask in, src stops. Run src ws init in your checkout, then click Send again.
What it cannot do
- The browser and the code must be on the same computer. The link opens
srcon the computer where you click. - The link works for 10 minutes, and only for the account that made it. After that,
srcprintsThis link has expired. Click Send to my agent again. srcmust be logged in to the forge as you. Without a login, it prints thesrc auth logincommand to run.- Your agent runs with your own
srclogin. To give an agent its own short-lived token, see Start an agent session.