> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Get agent session

> Get the current state of one Linear agent session.

`getLinearAgentSession` reads one coding session created through Linear delegation.

```ts automations/get-linear-agent-session.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { getLinearAgentSession } from "automate.ax/linear"

export default automation("Get Linear agent session", () => {
  onHttpRequest({ scope: "automation" })
  getLinearAgentSession({ agentSessionId: "agent-session-uuid" })
})
```

`agentSessionId` is required. Optional second argument `{ account }` defaults to the project binding. Returns a `LinearAgentSession` with its app user, issue, lifecycle dates, provider summary and plan, external links, and status. `plan` is `null` until the agent reports one.

Status is `pending`, `active`, `awaitingInput`, `complete`, `error`, or `stale`.
