Factories
Automatically spawn and terminate claws based on Linear or Shortcut issue status changes.
How factories work
A factory watches an external system for events. When a trigger condition is met (e.g. an issue enters a status), it spawns a new claw pre-loaded with context from that event. When the claw sends [DONE] <pr-url>, the factory moves the issue to the done status and keeps the claw alive to watch for CI failures and review comments. The claw terminates automatically when the PR is merged or closed.
If terminate_on_leave: true is set, dragging the issue back out of the trigger status will immediately kill the claw and its VM.
Linear factory setup
1. Get the webhook URL
Find it in Settings → Factories in the hub web UI, or construct it:
https://your-hub.example.com/api/integrations/linear/webhook2. Create a Linear webhook
- Go to Linear → Settings → API → Webhooks
- Click New webhook, paste the URL above
- Check Issues under Data change events
- Copy the Signing secret
3. Get a Linear API key
Go to Linear → Settings → API → Personal API Keys and create a key.
4. Configure hub.yaml
integrations:
linear:
- workspace: my-company
api_key: lin_api_...
# webhook_secret is per-factory (set in Settings → Factories)
factories:
- name: feature-factory
integration: linear
workspace: my-company
team: ELA # optional — filter by team key
trigger_status: "Ready for Agent"
done_status: "In Review"
terminate_on_leave: true
template: base
webhook_secret: whsec_... # signing secret from step 2
tags: # optional — applied to created claws
- linear
color: tealShortcut factory setup
See the Shortcut Integration guide for full setup instructions.
integrations:
shortcut:
- workspace: my-company
token: YOUR_SHORTCUT_TOKEN
factories:
- name: sc-factory
integration: shortcut
workspace: my-company
trigger_status: "In Development"
done_status: "In Review"
terminate_on_leave: true
template: baseThe [DONE] signal
When an agent finishes its task, it sends [DONE] followed by the PR URL as a chat message:
[DONE] https://github.com/org/repo/pull/42The hub then:
- Validates the PR is open
- Moves the issue/story to
done_status - Keeps the claw alive to watch for CI failures and bugbot comments
- Terminates the claw when the PR is merged or closed
Add this to your agent's AGENTS.md:
When your task is complete, open a PR and send:
[DONE] https://github.com/org/repo/pull/N
This moves the issue and keeps you alive to watch CI and review comments.
You'll terminate automatically when the PR merges.Auto-watching CI and bugbot
While a claw is in the watching state (after [DONE]), the hub polls the PR every 2 minutes for:
- CI failures — failed check runs inject a message telling the agent to fix them
- Bugbot comments — new Cursor bugbot comments are injected as user messages
- PR merged/closed — terminates the claw and destroys the VM
You can disable per-template with:
# in elasticclaw-config.yaml
auto_watch_ci: false
auto_watch_bugbot: falseOr toggle per-claw from the dashboard card back.
Activity log
Every webhook event is logged for 4 hours. Click Activity next to any factory in Settings to see:
claw_created— issue entered trigger status, claw spawnedclaw_terminated— issue left trigger status, claw killederror— provisioning failednot_actionable— webhook received but status didn't match
1:1 enforcement
Each issue/story can only have one active claw at a time. If the same issue is moved into the trigger status again while a claw already exists, a new one will not be created.