This is an example project not meant for production use.
A bridge server that connects Claude Managed Agents to Linear's Agent Platform. When users @mention or assign the agent in Linear, the server forwards the request to a Claude Managed Agent session and streams the response back as Linear agent activities.
- A user @mentions your agent in a Linear issue or comment
- Linear sends an
AgentSessionEventwebhook to your server - The server acknowledges with a "thinking" activity (required within 10s)
- A Claude Managed Agent session is created with the issue context
- Claude's streamed response is relayed back to Linear as agent activities
- Bun runtime
- An Anthropic API key
- A Claude Managed Agent (agent ID and environment ID)
- A Linear workspace with admin access
bun installGo to Linear API Settings and create a new application:
- Redirect URL:
<your BASE_URL>/oauth/callback - Webhook URL:
<your BASE_URL>/webhook - Webhook events: Subscribe to Agent session events
Copy the Client ID, Client Secret, and Webhook Signing Secret.
cp .env.example .env.localFill in your credentials in .env.local:
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key |
CLAUDE_AGENT_ID |
Claude Managed Agent ID |
CLAUDE_ENVIRONMENT_ID |
Claude environment ID |
LINEAR_CLIENT_ID |
From Linear OAuth app settings |
LINEAR_CLIENT_SECRET |
From Linear OAuth app settings |
LINEAR_WEBHOOK_SIGNING_SECRET |
From Linear OAuth app settings |
PORT |
Server port (default: 3000) |
BASE_URL |
Public URL of your server |
LINEAR_URL |
Linear app URL (default: https://linear.app) |
LINEAR_API_URL |
Linear API URL (default: https://api.linear.app) |
bun run devVisit <your BASE_URL>/oauth/authorize in your browser. This initiates the OAuth flow with actor=app, which installs the agent as an app user in your Linear workspace (requires workspace admin).
@mention the agent in any Linear issue — it will forward the context to your Claude Managed Agent and post the response back.
src/
main.ts Server with webhook, OAuth, and health check routes
oauth.ts Linear OAuth flow (actor=app) with token refresh
agent.ts Claude Managed Agent session bridge
| Method | Path | Description |
|---|---|---|
GET |
/ |
Health check |
GET |
/oauth/authorize |
Starts Linear OAuth installation flow |
GET |
/oauth/callback |
OAuth callback, exchanges code for token |
POST |
/webhook |
Receives Linear agent session webhooks |