aq.dev / guides / linear-coding-agent-workflow

From Linear Issue to Agent-Built PR: A Working Workflow

The cleanest Linear coding agent workflow is label-driven: add an "ai-task" label to an issue, and a ready-to-work agent workspace appears for your team, with the issue moved to In Progress. A human then opens that workspace, starts the agent with the issue as context, and steers it to a PR that is tracked back against the issue.

This guide walks the full loop as it works in AQ, and explains one deliberate design choice up front: the label does not launch an agent. A person does.

Why route agent work through Linear at all?

Because the issue tracker is already where work is defined, prioritized, and assigned. Bolting an agent workflow onto a separate tool creates a second backlog nobody grooms. When the trigger is a Linear label, agent work inherits everything the tracker already does: the written spec in the issue description, the priority discussion in the comments, the assignee, and the status that the rest of the company watches. The agent becomes a way to execute issues, not a new place where work hides.

The workflow, step by step

AQ is the multiplayer workspace where engineering teams run AI coding agents like Claude Code and Codex together: shared live terminals, a code editor, and app previews, in your own cloud. Here is what happens when you connect it to Linear.

1. Label an issue "ai-task"

Any issue you judge agent-suitable gets the label. Good candidates read like a spec: a bug with reproduction steps, a well-scoped feature, a mechanical refactor. The labeling decision is itself the first act of triage: you are asserting the issue is defined well enough that an agent plus a reviewer can carry it.

2. A workspace appears in the sidebar, and the issue moves to In Progress

AQ receives the label event by webhook (with a sync poll as a fallback) and creates a workspace for the issue: an isolated git worktree with its own branch, visible in the team's sidebar. The Linear issue is moved to In Progress automatically, so the tracker reflects reality without anyone touching it. If the issue already has a workspace, the label is deduplicated instead of spawning a second one. Ownership follows the Linear assignee, so the issue's owner owns the workspace.

3. A teammate opens the workspace and starts the agent

This is the human-in-the-loop step. Someone opens the workspace and launches the CLI they want (Claude Code, Codex, Cursor Agent, Kimi, Grok, or a plain shell) with the issue context to hand. The environment is already prepared: worktree checked out on its own branch, dependencies installed. The person starting the run frames the task, sets constraints, and stays in the loop while the agent works; teammates can open the same workspace and watch or steer the same live terminal.

4. The agent works, commits, and opens a PR

The agent runs as a real CLI in tmux on your infrastructure, streamed to the browser. It commits and pushes on the workspace branch and opens the PR with the operating user's own GitHub credentials, so authorship and permissions are the user's, not a bot account's.

5. AQ tracks the PR on the workspace

PRs opened from the workspace branch are discovered and tracked automatically: opened, merged, and closed each become events on the workspace. Anyone looking at the workspace (or the sidebar) can see where the work stands without cross-referencing GitHub.

6. Closing the loop

When the Linear issue is marked Done or Canceled, AQ closes the workspace. The tracker stays the source of truth for whether the work is finished, and the platform follows it, cleaning up the worktree rather than accumulating zombie environments.

Why doesn't the label auto-launch the agent?

Deliberately. AQ creates the workspace from the label but never starts an agent on its own, and this is the part of the design most worth defending:

The result is a queue model rather than a fire-and-forget model: Linear labels fill the queue, humans drain it at the pace they can actually review.

What makes a Linear issue agent-ready?

Teams that adopt this loop tend to start writing better issues within a couple of weeks, because vague issues visibly stall at step 3 while precise ones flow through.

The full loop at a glance

StepActorWhat happens
Label "ai-task"Human (in Linear)Issue is nominated for agent work
Workspace createdAQ (automatic)Isolated worktree + branch appear in the sidebar; issue moves to In Progress; owner = assignee
Agent startedHuman (in AQ)Teammate opens the workspace, launches the CLI with issue context, steers
Code + PRAgentCommits and opens a PR with the user's GitHub auth
PR trackedAQ (automatic)Opened, merged, and closed recorded as workspace events
Issue Done or CanceledHuman (in Linear)AQ closes the workspace and cleans up

Two automations bookend the loop (workspace creation at the start, PR tracking and closure at the end), and the judgment calls in the middle stay human. That split is what keeps an agent workflow fast without letting it outrun the team's ability to review what it produces.

Frequently asked questions

Does labeling a Linear issue automatically launch a coding agent?

No, and in AQ that is deliberate. The ai-task label creates a prepared workspace and moves the issue to In Progress, but a human opens the workspace and starts the agent CLI. This keeps launch intent, steering, and accountability with a person, and keeps the volume of agent output matched to the team's review bandwidth.

What happens if I label the same Linear issue twice?

Nothing new. AQ deduplicates on the issue's existing workspace, so re-labeling or webhook retries do not create a second workspace. One issue maps to one workspace, one branch, and one reviewable stream of work.

How does the PR get linked back to the Linear issue?

Through the workspace. The workspace was created from the issue, the agent's PR is opened from the workspace's branch, and AQ tracks that PR (opened, merged, closed) as events on the workspace. Anyone looking at the workspace sees both the originating issue and the PR status in one place.

Whose GitHub account do agent commits and PRs use?

The user's own. AQ uses per-user GitHub auth, so the agent commits, pushes, and opens PRs with the credentials of the person running the session, not a shared bot account. Authorship, permissions, and audit trails match how the team already works.

What happens to the workspace when the Linear issue is canceled?

AQ closes it. Moving an issue to Done or Canceled in Linear closes the corresponding workspace (via webhook, with a sync poll as fallback), so abandoned issues do not leave orphaned worktrees or running environments behind.