Skip to main content

Autonomous development automation with Claude Code and Linear

Project description

Claudear

Autonomous development automation with Claude Code and Linear.

Move a Linear issue from Backlog to "Todo" and Claudear takes over — it creates an isolated git worktree, runs Claude Code to implement the work, posts progress updates, and opens a PR when done. Move to "Done" and the PR auto-merges.

Quick Start

git clone https://github.com/ianborders/claudear.git
cd claudear
pip install -e .
cp .env.example .env   # Then edit with your API keys
claudear               # Start watching for tasks

How It Works

  1. Move issue from Backlog → Todo — Claudear picks it up
  2. Automatic implementation — Creates isolated git worktree, runs Claude Code
  3. Progress updates — Comments on Linear as it works
  4. Blocked? — Posts a comment asking for help, waits for your reply
  5. Complete — Pushes code, creates PR, moves to "In Review"
  6. Move to "Done" — PR auto-merges, worktree cleaned up

Prerequisites

  • Python 3.9+
  • Claude Code CLI installed and authenticated
  • ngrok account (free tier works)
  • GitHub CLI (gh) installed and authenticated
  • Linear workspace with API access
  • Linear workflow with these states: Backlog → Todo → In Progress → In Review → Done

Configuration

Create a .env file:

# Linear
LINEAR_API_KEY=lin_api_xxx           # Settings → API → Personal API keys
LINEAR_WEBHOOK_SECRET=whsec_xxx      # Created when you register the webhook
LINEAR_TEAM_ID=KYB                   # Your team key from URL (linear.app/KYB/...)

# Required Linear workflow states (must match exactly)
LINEAR_STATE_TODO=Todo
LINEAR_STATE_IN_PROGRESS=In Progress
LINEAR_STATE_IN_REVIEW=In Review
LINEAR_STATE_DONE=Done
# Note: Your Linear board must have: Backlog → Todo → In Progress → In Review → Done

# GitHub
GITHUB_TOKEN=ghp_xxx                 # Settings → Developer settings → Tokens

# Repository
REPO_PATH=/path/to/your/repo         # The repo Claudear will work on

# Server
WEBHOOK_PORT=8000

# ngrok
NGROK_AUTHTOKEN=xxx                  # dashboard.ngrok.com → Your Authtoken

Setup

1. Create a static ngrok domain

You need a persistent URL so the Linear webhook survives restarts.

  1. Go to ngrok Domains
  2. Create a free static domain (e.g., your-name.ngrok-free.app)
  3. Create ~/Library/Application Support/ngrok/ngrok.yml:
authtoken: your_auth_token
tunnels:
  claudear:
    addr: 8000
    proto: http
    domain: your-name.ngrok-free.app

2. Disable Linear's GitHub automations

Linear has built-in automations that conflict with Claudear. You must disable them:

  1. Linear → Settings → Team Settings → Workflow → GitHub
  2. Set all "Automate state changes" options to No action
    • "When a branch is created" → No action
    • "When a PR is opened" → No action
    • "When a PR is merged" → No action
    • etc.

If you skip this, Linear will fight Claudear for control of issue states.

3. Register Linear webhook

  1. Linear → Settings → API → Webhooks → Create webhook
  2. Configure:
    • URL: https://your-name.ngrok-free.app/webhooks/linear
    • Events: Issues, Comments
  3. Copy the signing secret to .env as LINEAR_WEBHOOK_SECRET

4. Run

claudear

Claudear starts the webhook server and connects ngrok automatically.

Usage

Action Result
Move issue Backlog → Todo Claudear starts working
Claude gets stuck Posts comment, waits for your reply
Reply to comment Claudear resumes
Task complete PR created, issue → "In Review"
Move issue → Done PR merges, worktree cleaned up

Troubleshooting

Webhook not receiving events

  • Verify webhook URL matches your ngrok domain
  • Check signing secret matches LINEAR_WEBHOOK_SECRET
  • Test: curl https://your-domain.ngrok-free.app/health

Claude not starting

  • Run claude manually to verify CLI is installed and authenticated
  • Check REPO_PATH exists and is a git repository

Tasks stuck in "Blocked"

  • Check Linear for Claude's comment asking for help
  • Reply to unblock (polls every 30 seconds)

Port 8000 in use

  • Kill existing processes: lsof -ti:8000 | xargs kill -9
  • Kill ngrok: pkill ngrok

How It Uses Claude Code

Claudear runs Claude Code CLI in headless mode using your Claude Code subscription (not API credits). It's the same Claude you use interactively, just automated.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claudear-0.1.0.tar.gz (134.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claudear-0.1.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file claudear-0.1.0.tar.gz.

File metadata

  • Download URL: claudear-0.1.0.tar.gz
  • Upload date:
  • Size: 134.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for claudear-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a47b92c2c3f1c5715b68549a1cb416e5960dc5bfba25b0242e8b4a25dee37d7
MD5 a144c8c33fc81df4567bb25d505c901a
BLAKE2b-256 a981f5f1bc4a482eecd6f9085a7b1770c37fc7e993d53d4a49fe1870b5e8fce6

See more details on using hashes here.

File details

Details for the file claudear-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claudear-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for claudear-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f8e298f536cdef04dd9ca42863ff8be70d6fdd7cf74644ccf991937d254a6b8
MD5 a73000401c2eae591d5e9f48a3a075e0
BLAKE2b-256 28dab7ab3ed2a1cba0d15bd5dabc92827603fb50a41a04640b070049447ee2e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page