AI Agent That Turns Linear Tickets Into Tested Pull Requests

An AI agent that turns each new Linear ticket into a pull request: it builds the change on a branch, checks the Vercel preview and reports back on the issue.

· 5 min read

READY-MADE AGENT

A small Linear ticket can take ten minutes to fix and an hour to get around to: pull the repo, make a branch, write the change and a test, push, open the PR, wait for the preview, click through it, then go back to the ticket and update it. Lark's Ticket to pull request agent does that whole loop for you. When a new Linear issue is created, it reads it, builds the change on a branch with tests, opens a pull request, checks the Vercel preview in a real browser, and comments on the issue with what it did. You review the PR. It never merges. Small tickets become one more loop of the company that runs without you; your part is the review.

What the Linear-to-pull-request agent does

For every new issue, the agent works through the same steps from its instructions:

  1. Reads the issue and its comments with the Linear tools, and moves it to In Progress.
  2. Finds the repository. It's named in the issue or its project. If it isn't, the agent asks you rather than guessing.
  3. Clones it and creates a branch named after the issue, for example eng-123-short-title.
  4. Implements the change with tests, then runs the test suite and the build.
  5. Pushes the branch and opens a pull request with the GitHub API, linking the issue.
  6. Checks the Vercel preview. It uses the Vercel tools to find the preview deployment for its branch, waits for it to be ready, opens it in the browser and checks that the change works.
  7. Reports back on Linear. It comments on the issue with what it did, the PR link and the preview link, and moves it to In Review.

The browser step matters. Tests passing tells you the code does what the tests say. Opening the preview and using the changed page tells you whether the feature actually works where your team will look at it.

How it runs: a Linear webhook and its own machine

The trigger is a webhook from Linear on new issues (Issue.create). The issue's identifier, title, link and description are folded into the task, so the agent starts with the full ticket in front of it. The trigger allows up to 20 runs a day.

Each run happens on the agent's own Linux machine in the cloud, with a terminal, files and a browser. The machine is kept between runs, so repositories it has cloned and tools it has installed are still there for the next ticket.

When something is unclear or blocked, the agent asks you instead of guessing. Questions reach you by Slack, email or text, and you answer in a tap. You can also add to the task while it works: it reads your message before its next step.

If you'd rather hand it one ticket at a time, you can start a run on demand instead of waiting for the webhook. You can also send work to Lark from your editor; see handing off tasks from Claude Code to cloud agents.

What you get back

On the Linear issue, a comment with what it did, the PR link and the preview link, and the issue in In Review.

In its final message:

  • the PR link;
  • the preview link, and whether the change works there, with what it checked;
  • the test and build results;
  • anything the reviewer should look at closely.

If it stopped, the final message says what blocked it and what it needs from you. That's a better outcome than a half-finished PR that looks done.

Setting up the Linear ticket agent in Lark

  1. Open the Agents page and pick Ticket to pull request under Ready-made agents. The form opens with its instructions and trigger filled in.
  2. Its instructions don't need a repository filled in: the agent finds it from the issue or its project. Add your team's conventions (test commands, branch rules) to the instructions if you want.
  3. Connect the services it uses: GitHub (it uses a GITHUB_TOKEN to push and open pull requests), and the Linear and Vercel tools, which it reaches as MCP servers.
  4. Turn the trigger on. It starts paused until you do, so nothing runs on your issues before you're ready.

It runs on Claude Code by default, and you can pick a different model or agent per agent. The docs cover the API if you want to start or stream runs from your own code.

Guardrails

The instructions draw clear lines:

  • It never merges. A person reviews and merges every pull request.
  • It never pushes to the main branch. All work happens on a branch named after the issue.
  • It asks instead of guessing when the repository isn't named or the ticket is unclear.
  • It reports when it stopped, with what blocked it, rather than leaving the issue silently half-done.

Costs

Lark runs on credit. Free includes $1 of agent credit a month; Pro is $29 a month and Team $99, and all of it comes back as credit. Credit pays for the AI model and machine time each run uses, at the providers' prices plus 20%. Plan details are on the pricing section.

Every run shows its cost live as it works, so you can see what a ticket cost. A monthly budget stops your agents exactly where you set it, and the trigger's cap of 20 runs a day limits how much a busy day of new issues can start. More on this in how much AI agents cost to run.

FAQ

Can an AI agent turn a Linear issue into a pull request on its own?

Yes, for issues it can understand and build. It reads the issue, writes the change with tests, runs the suite and the build, opens a PR that links the issue, checks the Vercel preview and comments back on Linear. When the issue is unclear, it asks you first.

Will it merge the pull request?

No. It never merges and never pushes to the main branch. It moves the Linear issue to In Review and leaves the decision to a person.

Does it test the change, or just write code?

Both. It writes tests with the change and runs the full test suite and the build. Then it opens the branch's Vercel preview in a real browser and checks that the change works there, and tells you what it checked.

What if my project doesn't deploy previews on Vercel?

The preview check uses the Vercel tools, so it applies to projects with Vercel previews. Without one, you still get the branch, tests, build results and the pull request; if a step is blocked, its final message says what blocked it.

Want your next Linear ticket to arrive as a reviewed pull request? Start free.

KEEP READING

Hand this job to Lark tonighttoday

One less loop for you to run: each Lark agent owns its job on its own cloud computer, starts on a schedule or when something happens, and brings you in only to approve.

Start free