Automate software development with Claude Code, Linear, and GitHub Actions
Project description
Claude-Linear Automation
Automate software development with Claude Code, Linear, and GitHub Actions. Add a label to a Linear issue, and Claude will design, implement, test, and create a pull request.
Quick Start
1. Install the CLI
pip install claude-linear
2. Run the Setup Wizard
claude-linear setup
The wizard will:
- Connect to your Linear workspace
- Create all required labels (16 labels in the "Claude" group)
- Generate secure secrets
- Show you exactly what to configure in Vercel and GitHub
3. Deploy the Orchestrator
cd orchestrator
vercel deploy
Add the environment variables shown by the setup wizard.
4. Create the Linear Webhook
- Go to Linear Settings > API > Webhooks
- Create webhook:
https://your-app.vercel.app/webhooks/linear - Enable "Issues" and "Projects" resources
- Copy the webhook secret to Vercel
5. Install Templates in Your Repos
claude-linear init /path/to/your/repo
Add the GitHub secrets shown by the setup wizard.
6. Start Automating
Add the "Ready for Claude Code" label to any Linear issue. Claude will take it from there!
How It Works
┌──────────┐ ┌─────────────────┐ ┌──────────────┐
│ Linear │ webhook │ Orchestrator │ dispatch│ GitHub │
│ │────────>│ (Vercel) │────────>│ Actions │
│ Issues │ │ │ │ │
└──────────┘ └─────────────────┘ └──────────────┘
^ ^ │
│ │ API calls │
│ label updates │ v
│ comments │ ┌──────────────┐
└───────────────────────┼───────────────────│ Runner │
│ │ (Claude Code)│
└───────────────────┴──────────────┘
- You add a label to a Linear issue
- Linear sends a webhook to the orchestrator
- Orchestrator dispatches a GitHub Actions workflow
- Runner executes Claude Code to analyze, design, implement, and test
- Claude creates a PR and updates Linear with progress
Features
Issue Flow (13 Stages)
When you add "Ready for Claude Code" to an issue:
- Design Doc — Claude analyzes the codebase and writes a design document
- Design Review — Claude reviews and improves the design
- Implementation Plan — Claude creates a step-by-step implementation plan
- Implementation — Claude writes the code
- Browser Tests — Runs E2E tests (if configured)
- Unit Tests — Runs test suite with auto-fix on failure
- Pre-commit — Runs linters and formatters
- Code Review — Claude reviews its own changes
- Create PR — Creates a pull request
- PR Review Loop — Claude reviews the PR diff and applies fixes
- Ready for Human Review — Final stage for you to review
Project Flows
- Enhance with Claude — Analyzes repo and enriches project description
- Create issues with Claude — Generates actionable issues from codebase analysis
Configuration
Per-Repository Config (.claude/automation.yml)
# Test commands
tests: "pytest -q"
browser_test: "npx playwright test"
precommit: "pre-commit run --all-files"
# Dev server (for browser tests)
run_dev: "./run-dev"
dev_url: "http://127.0.0.1:3000"
dev_ready_regex: "Listening|ready|started"
# Limits
max_fix_attempts: 4
max_review_iterations: 3
max_code_review_iterations: 2
All fields are optional. Skip any test stage by omitting its command.
Environment Variables
Vercel (Orchestrator):
| Variable | Description |
|---|---|
LINEAR_API_KEY |
Linear API key (starts with lin_api_) |
LINEAR_WEBHOOK_SECRET |
From Linear webhook settings |
GITHUB_DISPATCH_TOKEN |
GitHub PAT with repo scope |
AGENT_SHARED_SECRET |
Shared secret for runner auth |
DEFAULT_LINEAR_TEAM_ID |
Default team for issue creation |
GitHub (Per Repository):
| Secret | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic API key |
CLAUDE_AGENT_API_BASE |
Orchestrator URL |
CLAUDE_AGENT_TOKEN |
Same as AGENT_SHARED_SECRET |
CLI Commands
claude-linear setup # Interactive setup wizard
claude-linear validate # Validate configuration
claude-linear init # Install templates to a repo
claude-linear labels # Manage Linear labels
claude-linear --version # Show version
Validate Your Setup
claude-linear validate --api-base https://your-app.vercel.app
Validating configuration...
✓ Orchestrator health check passed
✓ Linear API key valid
✓ Linear labels exist (16/16)
✓ GitHub token has required scopes
Deployment
Vercel (Recommended)
- Fork or clone this repository
- Connect to Vercel with root directory
orchestrator - Add environment variables from setup wizard
- Deploy
Manual / Docker
cd orchestrator
pip install -e ".[server]"
uvicorn api.index:app --host 0.0.0.0 --port 8000
Development
# Clone the repo
git clone https://github.com/anthropics/claude-linear-automation.git
cd claude-linear-automation
# Install with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest tests/ -v
# Run linting
ruff check .
# Run type checking
mypy orchestrator/ cli/
See CONTRIBUTING.md for more details.
Documentation
- Architecture — System design and data flow
- Troubleshooting — Common issues and solutions
- Contributing — Development setup and guidelines
Safety Notes
This automation runs Claude Code with full repository access. Consider:
- Use in trusted repositories only
- Don't expose production secrets to the workflow
- Review PRs before merging (Claude creates them, you approve them)
- Enable GitHub branch protection rules
Secret Rotation
Rotate secrets immediately if you suspect a compromise. Here's the procedure for each secret:
AGENT_SHARED_SECRET
This is the shared token between the orchestrator and GitHub Actions runners.
- Generate a new secret:
python -c "import secrets; print(secrets.token_hex(32))"
- Update in Vercel: Environment Variables >
AGENT_SHARED_SECRET - Update in all GitHub repositories: Settings > Secrets >
CLAUDE_AGENT_TOKEN - Redeploy the orchestrator on Vercel
- Any in-flight workflows will fail and need to be re-triggered
LINEAR_API_KEY
- Go to Linear Settings > API > Personal API Keys
- Create a new key and copy it
- Update in Vercel: Environment Variables >
LINEAR_API_KEY - Revoke the old key in Linear
- Redeploy the orchestrator
LINEAR_WEBHOOK_SECRET
- Go to Linear Settings > API > Webhooks
- Delete the existing webhook
- Create a new webhook with the same URL
- Copy the new signing secret
- Update in Vercel: Environment Variables >
LINEAR_WEBHOOK_SECRET - Redeploy the orchestrator
GITHUB_DISPATCH_TOKEN
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with
reposcope - Update in Vercel: Environment Variables >
GITHUB_DISPATCH_TOKEN - Revoke the old token in GitHub
- Redeploy the orchestrator
ANTHROPIC_API_KEY
- Go to console.anthropic.com > API Keys
- Create a new key
- Update in all GitHub repositories: Settings > Secrets >
ANTHROPIC_API_KEY - Disable or delete the old key in Anthropic Console
- Any in-flight workflows will fail and need to be re-triggered
Emergency Rotation (All Secrets)
If you need to rotate all secrets immediately:
# 1. Generate new secrets locally
export NEW_AGENT_SECRET=$(python -c "import secrets; print(secrets.token_hex(32))")
echo "New AGENT_SHARED_SECRET: $NEW_AGENT_SECRET"
# 2. Update Vercel (via CLI or dashboard)
# 3. Update GitHub repository secrets
# 4. Regenerate Linear API key and webhook
# 5. Regenerate GitHub PAT
# 6. Regenerate Anthropic API key
# 7. Redeploy orchestrator
# 8. Verify with: claude-linear validate
Recommended Rotation Schedule
- AGENT_SHARED_SECRET: Every 90 days
- LINEAR_API_KEY: Every 90 days
- GITHUB_DISPATCH_TOKEN: Every 90 days
- ANTHROPIC_API_KEY: Every 90 days
- LINEAR_WEBHOOK_SECRET: Only when compromised (rotating requires webhook recreation)
License
MIT License. See LICENSE for details.
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_linear-0.1.2.tar.gz.
File metadata
- Download URL: claude_linear-0.1.2.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a53aeb72fd1526d0bc0baa6c03ca89f67eaf6727e333855cec01fe74868e87
|
|
| MD5 |
930189cbeedbe300078af2abc34d0068
|
|
| BLAKE2b-256 |
462c34c62f6a77fec27ce35d18625d5460bf9bbfb7b0c466dd97c854b893adb0
|
File details
Details for the file claude_linear-0.1.2-py3-none-any.whl.
File metadata
- Download URL: claude_linear-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8427ae84fbed2cdb71514ca4f46b7e115f1dc9d2dccc0653118bf8722d645bd3
|
|
| MD5 |
9045d093aada76cc8a8b4e53e1ba452c
|
|
| BLAKE2b-256 |
d887a53c72759a4a849cbf09638bc18e33d493ebb84660a88c6f3ef500c47be8
|