[BUG] Routines does not trigger on github PR open

Status Open
Reported on v2.1.101
Maintainer reply ✓ Yes — ashwin-ant
Activity 8 comments · opened Apr 16, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Link Claude code with github account A.
  2. Create a Claude code routine with a trigger on PR open in a organization
  3. Disconnect Claude code again from this github account.
  4. 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.

View original on GitHub ↗

8 Comments

hauke · 4 months ago

If this is the wrong support channel, please tell me the correct one.

0xbrainkid · 4 months ago

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:

  • Routine health check at creation time: before saving the routine, verify the required OAuth scopes are present and surface a warning if they are not.
  • Identity loss notification: when a connected account used by a routine is disconnected, immediately surface a warning for each affected routine: "GitHub routine for openwrt/openwrt requires reconnection."
hauke · 4 months ago

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:

Repositories
openwrt/openwrt
Triggers on
openwrt/openwrt
Pull request opened

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?

hauke · 4 months ago

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:

Hi pleas run a code review on https://github.com/openwrt/openwrt/pull/22950 and post the results in the PR,

Review this OpenWrt pull request for problems and policy violations.
...
ashwin-ant collaborator · 4 months ago

@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_...)

ashwin-ant collaborator · 4 months ago

@hauke just to clarify, this is for PRs from forks, yes? At the moment we don't support those in routines.

hauke · 4 months ago

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:

External contributor triage: from fork is true. Routes every fork-based PR through an extra security and style review before a human looks at it.

https://code.claude.com/docs/en/routines

hauke · 3 months ago

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