[BUG] Routines does not trigger on github PR open
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I created a Claude code routine to automatically to github PR reviews on new PRs in the https://github.com/openwrt/openwrt repository. The Claude code routine never gets triggered.
What Should Happen?
The Claude code routine should get triggered when a new PR is created here https://github.com/openwrt/openwrt/pulls
Error Messages/Logs
No error messages.
Steps to Reproduce
- Link Claude code with github account A.
- Create a Claude code routine with a trigger on PR open in a organization
- Disconnect Claude code again from this github account.
- Connect it to a different account and configure the same.
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.101
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
I created a Claude code routine with a trigger on Github PR open at https://claude.ai/code/routines successfully.
It says:
Repositories
openwrt/openwrt
Triggers on
openwrt/openwrt
Pull request opened
There are no filters configured.
I am did not connect this github account to Claude, but @openwrt-ai.
The routine is never triggered.
There are new PRs showing up: https://github.com/openwrt/openwrt/pulls
In the beginning I had the Claude code account connected to the @hauke github account. There one routine run was successfully triggered.
The Claude code app is installed in the @openwrt-ai account and the @openwrt organization.
The user @openwrt-ai has triage permissions on the https://github.com/openwrt/openwrt repository.
I removed the routine and created it again, did not help.
I disconnected the github account and connected it again, did not help.
8 Comments
If this is the wrong support channel, please tell me the correct one.
The Routine not triggering on GitHub PR open — especially combined with the fact that you disconnected your GitHub account after creating the routine — points to an identity continuity failure: the routine was created with an OAuth identity that no longer exists in the current Claude Code session.
From an agent identity perspective, Routines that depend on external service connections (GitHub OAuth) inherit the identity at creation time. When that identity is disconnected, the routine loses its ability to authenticate the webhook or poll for PR events — but rather than surfacing an error ("this routine requires GitHub authorization that is no longer valid"), it silently does not trigger.
Two diagnostic steps:
1. Reconnect the same GitHub account that was used when the routine was created and verify if triggers start working. If yes, the issue is that disconnecting invalidates the routine's stored credentials without notifying you.
**2. Check whether the routine is monitoring the public openwrt/openwrt repo** or a private fork. GitHub webhooks for public repos that belong to organizations (not your account) have additional permission requirements — the routine may need an OAuth scope that grants read access to that specific org's PRs.
Two fixes:
I removed all routines and disconnected the github account.
Then I connected the github account again and stet up the Claude code routine again.
Setting up the routine worked. After this it still does not work.
It says this about the configuration:
Are there any logs I can look at?
Is githuib logging anything I can see?
Are there debug logs at Antropic side I can look at?
I used the web Claude Code version and told it to do a PR review. It posted this review: https://github.com/openwrt/openwrt/pull/22950
I used this input:
@hauke are you able to share the ID of your routine? It's in the URL when you're on the routine page (looks like
trig_...)@hauke just to clarify, this is for PRs from forks, yes? At the moment we don't support those in routines.
Hi @ashwin-ant
This is the URL: https://claude.ai/code/routines/trig_01BmgqfT4gCFbg4Txg1EfRXK
Yes this is for PRs from forks. This is a pretty standard work flow for open source projects.
In the https://github.com/anthropics/claude-code-action I was able to make this work with some changes to the code.
I assumed that routines work on PRs from forked repositories. The documentation mentions this example use case:
https://code.claude.com/docs/en/routines
We worked around this problem by using a github action to send a manual web trigger to the Claude routine. See here: https://github.com/openwrt/actions-shared-workflows/commit/2d30538852ffcf4843587efa33b750717dd9eb15