anthropics / anthropics/claude-code
[FEATURE] Add API/webhook (event) trigger for Claude Cowork tasks — not just schedule cadence
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
### Problem Statement
Cowork's scheduled tasks currently only support fixed cadences (hourly / daily / weekly / weekdays / manual). There's no way to start a Cowork task from an external HTTP call or a message-queue event (a CI pipeline finishing, an alert firing, a message landing in SQS/Pub-Sub, a third-party SaaS webhook, etc.).
Claude Code Routines already solve almost exactly this problem for coding automation: each routine can have a Scheduled trigger, an API trigger (POST to a per-routine endpoint with a bearer token), and a GitHub-event trigger. Notably, several Cowork-scheduled-task issues in this repo are tagged with the `area:routines` label, whose own description reads "Claude Code routines on web, used for scheduled tasks, webhook-triggered tasks, etc." — suggesting Cowork's scheduled tasks and Routines already share the same underlying infrastructure, so much of the groundwork may already exist.
### Proposed Solution
Extend the trigger model Claude Code Routines already has (Scheduled / API / GitHub event) to Cowork tasks (now part of the unified Claude app):
- Let a Cowork task optionally get an "API trigger" (its own endpoint + bearer token), the same way Routines do.
- Optionally support parsing an inbound webhook payload (generic JSON / common third-party formats) so a task can read the event that triggered it.
### Alternative Solutions
_No response_
### Priority
Critical - Blocking my work
### Feature Category
CLI commands and flags
### Use Case Example
- Trigger a Cowork report-compilation task the moment a CI pipeline finishes, instead of waiting for the next scheduled run.
- Fire a Cowork task when a message lands in an internal queue/topic (e.g. a new support ticket), instead of polling on a timer.
### Additional Context
- Related: #25791 (Claude Code ↔ Cowork bridge — proposes a local IPC bridge, not an external HTTP/event trigger)
- Claude Code Routines docs: https://code.claude.com/docs/en/routines (existing precedent for API triggers)
- Cowork scheduled-task docs: https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork (currently schedule-only)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the Claude Code Routines documentation and the Cowork scheduled-task documentation linked in the issue, then review related issue #25791. The repository files, tests, and entry points for Cowork triggers are not identified, so the scope and implementation path remain to be established. Done means agreeing on the trigger model, endpoint authentication, payload handling, and integration boundaries.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100