{"slug": "using-claude-routines-with-github", "title": "Using claude routines with github", "summary": "A developer tested Claude Code routines, Anthropic's cloud-hosted automation feature, to see whether GitHub Actions could be replaced entirely for repository maintenance. The routine was configured with a prompt, a linked repository, and a GitHub pull-request trigger, then verified by opening a PR through GitHub's web interface while the developer's laptop was offline. The setup requires installing the GitHub app and supports schedule, GitHub event, and API triggers, with notifications via push, email, or Slack.", "body_md": "I've been using claude for some time now. I haven't touched on routines in claude yet, and thought that this would be a good opportunity to play around with them and explore them.\n\nThe official claude docs say this:\n\nPut Claude Code on autopilot. Define routines that run on a schedule, trigger on API calls, or react to GitHub events from cloud infrastructure.\n\nI thought to myself \"could I get rid of actions entirely?\" and set about to find out!\n\nRoutines are saved configurations (prompts) inside claude code. They run on Anthropics infrastructure, and can be connected to one or more repositories. Routines run on Anthropics infrastructure and can respond to API requests or to Github events (like pull requests). The third option is more like cron, where routines are scheduled for particular times and just run, again this is on Anthropic's infrastructure and they will run when your personal instance of claude is not running.\n\nThis means that routines can run when I am no longer around. This is interesting.\n\nIn order to get started you simply log into the web interface of claude code and hit the routines page.\n\n[https://claude.ai/code/routines](https://claude.ai/code/routines)\n\nFrom here I create a new routine.\n\nAs part of my new routine, I give it a name. In my case, I am going to ensure that all of my pull requests update the README.md in my repo. There are three actions that I need to take at this point:\n\nIn my case, the prompt gives instructions on what to do with the README. I select one of my repositories, which in my case, is my space invaders game. Lastly, I select a trigger. In my case, I am selecting a github pull request.\n\nThere are three types of triggers. Each one has different use cases.\n\n**Schedule:** This trigger type is a more simple type, where you want to run an agentic workflow on a schedule. For example \"Search my google calendar and send me an email summarising my day\". You could schedule this for 7am each morning.\n\n**Github event:** This is where you can choose a github event type and automatically have the workflow kick off. In my case I chose a pull request as the trigger. Other out of the box event types are PR merged, Release published and Issue opened.\n\n**API:** This is probably the most flexible. It gives you a URL and a token that means the routine can be called via a POST request. This is incredibly flexible because it can be embedded in other code, or an external orchestrator. \n\nThere is also an option to include notifications as part of the routine. The default options for notifications are:\n\n**Push Notifications:** Send notifications to the claude app. This works for both the mobile and desktop apps.\n\n**Email:** Send an email notification to the email in your account.\n\n**Slack:** Send a slcak message (requires slack to be connected)\n\nOnce the workflow has been successfully created, you can see both the workflow details on the right hand side panel, but also any runs that have occurred.\n\nThe very first time that you run you may see a note that the github app is not installed. Click on the link to install the github app and grant the appropriate permissions.\n\nOnce the app is authorised and you have selected a repository, then click install.\n\nAfter everything is installed, you should be redirected back to the installed connectors page in your claude web browser. This should now show that the github integration is installed.\n\nNow that my routine is created inside claude, and will run inside Anthropic, not on my laptop, it's time to create a pull request on my repo. I'm going to use the web based interface from github just to prove that nothing is running on my laptop.\n\nThe first thing to note is that there is no README present in the repository at all.\n\nI add a single comment to the shell script that I use to kick off the web server and serve the html space invaders game. This is kicked off using python's inbuilt **http.server**. This is not really very efficient or robust, but does work for local testing. I simply add a comment to this effect to the file.\n\nI commit this to a new branch and start a new pull request. This should kick off my workflow and my routine. Remember that the trigger i defined earlier was a new PR being created.\n\nI them create the pull request.\n\nAfter a short amount of time, the pull request is updated with the information from my routine. I can see that there is a new section within the PR that says \"Add comprehensive Readme\". This is exactly what my routine has done.\n\nWhen I look at the actual content of the pull request, I can see that a new file called README.md has been added and the content shows that a comprehensive readme describing the code has been added.\n\nWhat does the routine look like after it's been fired by the pull request? The image below shows that the routine has fired, a commit has been added to the PR and all of the normal claude reasoning and tool use is available.\n\nWhat if I want something to run via an API trigger instead? Adding an API trigger is very easy. I can simply edit the existing routine. When I edit the routine, I have the option to add an additional trigger.\n\nAdding the new trigger gives me a URL that's specific to that trigger. I also get a token that I can use to call the trigger. Helpfully, I can also expand the option for an example curl request. This is really helpful when I want to test, and has all of the appropriate headers set for me.\n\nI call the routine and pipe the output through jq so that it is formatted nicely. This gives me a session id, a url and a type field, which in this case is \"routine_fire\". I can use this method to fire the routine from anywhere, be it an external orchestrator, or a a terminal session using curl. The idea here is obvious, I not have the ability to fire agentic routines from anywhere.\n\nOnce I have called the trigger, I get output in the claude code routines panel that shows the routine has run an in this case, it has done nothing. As my routine is tied to an existing pull request, nothing will occur if there is no pull request outstanding.\n\nIf you noticed, the example curl request presented had a rather interesting part to it. The request has a data section that says **\"optional extra turn turn appended to the session\"**. \n\nI thought to myself \"I wonder if I could just add another turn to this\", so I tried it.\n\n```\n-H \"Content-Type: application/json\"   -d '{\"text\": \"if no pull request exists, then \nvalidate the code against the readme anyway. If no readme exists, create it. \nMake a new PR if needed.\"}'\n```\n\nThis is a new turn to stop the previous behaviour where no PR exists so the routine simply burns tokens and doesn't do anything. What should happen this time when I fire the routine with the API is a new PR should be created even if there is no existing PR.\n\nThe routine run correctly identifies that there is no existing PR in place. It also correctly opens a new one and assesses the code against the README (which doesn't exist).\n\nWhen I go and check the repository, I can see that a new PR has been raised and it has much the same content as the routine output. The cool part is that it is nicely formatted and is readable within the github interface. No further formatting is required on my part.\n\nThere is probably a complete other blog post here about defensive AI programming / prompting where a routine like this cannot simply burn tokens with no meaningful output.\n\nClaude code routines are a neat way of interacting with your github repo. I am still not sure whether or not this kills off actions or not. I think ultimately, actions will become a lot more simple. The ability to fire a routine from a PR, or even a generic API request adds a level of flexibility that allows for integration into the modern developer lifecycle.\n\nI can fire a routine associated with my codebase on a schedule, from a github event or via an API call. I can do this from github, an external orchestrator or anything else. Imagine a use case where I perform a regular security scan across my codebase and send the results to slack or use the results to fire off a code review and further actions on my codebase.\n\nRoutines let me get creative with the actions and activities that can occur on my codebase.", "url": "https://wpnews.pro/news/using-claude-routines-with-github", "canonical_source": "https://dev.to/codecowboydotio/using-claude-routines-with-github-501f", "published_at": "2026-09-20 09:59:11+00:00", "updated_at": "2026-09-20 10:24:51.159392+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Anthropic", "Claude Code", "GitHub", "Slack"], "alternates": {"html": "https://wpnews.pro/news/using-claude-routines-with-github", "markdown": "https://wpnews.pro/news/using-claude-routines-with-github.md", "text": "https://wpnews.pro/news/using-claude-routines-with-github.txt", "jsonld": "https://wpnews.pro/news/using-claude-routines-with-github.jsonld"}}