Skip to content
Back to blog list
Claude Code Otomasyonu: Rutinler ve /loop Rehberi
AI Tools

Claude Code Automation: Routines and /loop Guide

Automatically translated
Oray Yılmaz
Oray YılmazCreator
8 min read
Claude Code routines run in the cloud on a schedule, via API, or on a GitHub event; /loop repeats a task in an open session. Learn the differences and limits.

There are three ways to automate recurring work in Claude Code: routines, which run in Anthropic's cloud and keep going even when your computer is off (triggered by a schedule, an API call, or a GitHub event); desktop scheduled tasks, which run on your own computer; and the /loop command, which repeats a prompt at set intervals within an open session. Routines are currently in research preview and available on Pro, Max, Team, and Enterprise plans.

Last updated: 14.10.2026

In software development, efficiency is one of the top priorities for modern engineering teams. Constantly growing codebases, endless status updates, and routine quality checks can pull developers away from the creative system design work that deserves their focus. This is where Claude Code automation comes in. These structures, which can carry out many processes from code reviews to debugging, deployment verification to keeping documentation up to date, even while your computer is off, take repetitive work off the developer's plate.

claude-code-automation

Go Beyond Limits with Cloud-Based Routines

Routines running on cloud infrastructure managed by Anthropic let your workflows continue even while you sleep or when your laptop is completely closed. A routine is essentially a configuration that is packaged once and runs automatically, consisting of a specific working prompt, one or more code repositories to operate on, and connection points that communicate with external services. Thanks to this configuration, operations are carried out autonomously in the background without any additional human intervention or a real-time approval window.

You can create routines at claude.ai/code/routines, from the Claude desktop app, or with the /schedule command in the Claude Code CLI; all three save to the same account. Each run opens as a full Claude Code cloud session that clones the repository from scratch, and Claude pushes changes to a branch prefixed with claude/ by default. Routines belong to your personal account, are not shared with teammates, and count against your usage allowance. If you are curious why developers prefer Claude Code, you can take a look at this article.

There are three main trigger mechanisms for starting routines:

Scheduled Triggers:

They can be set with ready-made options such as hourly, daily, weekdays, or weekly, or to run once at a specific future time. For custom intervals such as every two hours or on the first of each month, you can enter a standard cron expression with the /schedule update command in the CLI; the shortest interval is one hour. Times are entered in your own time zone. Runs set for exactly on the hour (e.g., 09:00) may start a few minutes late, so choosing a minute like 09:07 gives better results.

API Triggers:

You can start routines instantly, and optionally with a payload, by sending an HTTP POST request to an endpoint dedicated to that routine with a secure bearer token. This is ideal in deployment pipelines or external monitoring tools, where the system needs to react to an external alert signal. For security reasons, these tokens are shown only once by the system and should be stored safely in an external vault.

GitHub Triggers:

They make a routine run automatically when a pull request is opened, closed, labeled, or updated, or when a release is created and published. The currently supported event types are these two: pull request and release. Using filters such as author, title, target branch, source branch, label, draft status, or merged status, you can have the routine run only on the PRs you want. For this, the Claude GitHub app must be installed on the repository.

These triggers can be combined in a single routine. For example, a PR review routine can run every night, be triggered via API from a deployment script, and also kick in whenever a new PR is opened.

claude-agent-sdk

Practical Use Cases for Autonomous Workflows

Advanced Claude Code automation features greatly reduce the mechanical operational load on teams. When you review the resources in the comprehensive "Anthropic Claude Guide," you can see that these systems are designed especially for work that is critical yet continuously repeated.

Backlog Maintenance:

A scheduled routine can connect to your issue tracker through a connector every weeknight, analyze issues opened since its last run, assign owners based on the relevant area of the code, label them, and post a daily summary on Slack right before the team wakes up.

Custom Code Reviews

Triggered by GitHub events, this routine applies your team's own standard review checklist to every opened PR and leaves inline comments for performance, security, and style issues. This way, senior developers can focus directly on software design instead of mechanical checks.

Deployment Verification:

Your continuous delivery (CD) pipeline can trigger the routine autonomously via API after every production deployment. The system runs smoke tests on the new build, scans error logs for regressions, and sends a final approval or rejection message to the release channel before the deployment window closes. Each run is saved as a separate session, and you can review what Claude did there. A green status in the list only shows that the session started and finished without errors, not that the task succeeded, so you should check the results regularly.

claude-code-loop

Quick In-Session Tasks: The /loop Command and How to Manage It

Alongside cloud-based, long-running routines, setting up quick automations during an active Claude Code session that you are coding in is also very practical. The /loop command, which you can use directly during a session, repeats a prompt or a chain of functions you specify at the intervals you choose. For example, to monitor the overall status of a PR or wait for long-running build tests to finish, you can simply type /loop 5m check the deploy in your terminal to start a polling loop that runs every 5 minutes in the background.

If you do not give the command a fixed time interval, Claude chooses the interval itself after each turn depending on the situation: when a build is about to finish or a PR is active, it waits a short time (at least 1 minute); when nothing is expected, it waits longer (at most 1 hour), and it writes down the chosen duration along with its reasoning. If you type just /loop without any prompt, Claude runs a built-in maintenance prompt: it continues unfinished work and checks comments on the open PR, failing CI runs, and conflicts. To change this default prompt, you can create a .claude/loop.md file in the project or a ~/.claude/loop.md file for all projects; if both exist, the project file takes precedence.

To prevent many sessions from sending requests to the API at the same time, a small offset (jitter) is added to scheduled tasks. A recurring task starts late by up to half of the time remaining until its next run, and at most 30 minutes: an hourly or daily task may be delayed by 0-30 minutes, and a task that runs every 30 minutes by 0-15 minutes. Tasks running every five minutes, such as /loop 5m, are not delayed. One-time tasks set for exactly the top of the hour or the half hour may run up to 90 seconds early. So that forgotten loops do not run forever, recurring tasks run one last time 7 days after they are created and then delete themselves. A session can have up to 50 scheduled tasks at the same time, and tasks only run while Claude Code is open and idle.

claude-automation

Choosing the Automation Tool That Fits Your Needs

Building a successful and uninterrupted automation architecture comes down to placing the right tool in the right scenario.

Feature

Cloud routine

Desktop scheduled task

/loop

Where does it run?

Anthropic cloud

Your computer

Your computer

Must the computer be on?

No

Yes

Yes

Is an open session required?

No

No

Yes

Access to local files

No (repository is cloned fresh each time)

Yes

Yes

Permission prompts

None, runs autonomously

Configurable per task

Inherited from the session

Shortest interval

1 hour

1 minute

1 minute

Best for

Nightly reports, PR review, post-deployment checks

Recurring work that needs local tools and files

Build or PR tracking during a session

  • If you need an infrastructure that reliably runs every night even when your machine is unplugged, and is triggered by API or GitHub events, cloud routines are the right choice.

  • For operations that require direct access to your local file system and the development tools installed on your computer, "Desktop Scheduled Tasks" are the best fit.

  • If you only want quick pipeline tracking, build polling, or one-time reminders that remain valid for the duration of your current active session, /loop is the most practical option.

Access and Security:

Keep access narrow when setting these systems up. Claude's access to services such as Slack, Linear, and Google Drive is provided through Model Context Protocol (MCP) connectors. When you create a routine, all connectors in your account are added by default, and the routine can use all tools of these connectors, including write operations, without asking for confirmation; so you should remove any connectors you do not need. In the routine's environment, you can restrict internet access level, add a setup script, and define environment variables. Environment variables are visible to anyone who uses that environment; on Pro and Max plans, it is recommended to store API keys as network secrets instead of environment variables. Every action the routine takes (commits, PRs, Slack messages) appears under your account.

Frequently asked questions

Are Claude Code routines free?

No. Routines are available on Pro, Max, Team, and Enterprise plans and count against your subscription usage allowance, like interactive sessions. There are also hourly limits; for example, up to 100 scheduled runs per hour per account.

Can Claude Code work while my computer is off?

Yes, with cloud routines. Because routines run on Anthropic's managed cloud infrastructure, your computer does not need to be on. Desktop scheduled tasks and /loop only run while your computer is on.

How do I create a routine in Claude Code?

You can create one at claude.ai/code/routines with "New routine," from the Code tab of the desktop app, or in the CLI with the /schedule command. For example, when you write /schedule daily PR review at 9am, Claude asks questions about the schedule, repository, and prompt, then saves the routine. API triggers, however, can only be added from the web interface.

How long does /loop run?

Recurring tasks run one last time 7 days after they are created and then delete themselves. If you close the session, the tasks stop too; for longer-running work, use a cloud routine or a desktop scheduled task.

What is the difference between a routine and /loop?

A routine runs in the cloud, independently of any session, at intervals of one hour or more. /loop runs inside an open session and is used for quick tracking at minute-level intervals.

There are three ways to automate recurring work in Claude Code: routines , which run in Anthropic's cloud and keep going even when your computer is off (triggered by a schedule, an API call, or a GitHub event); desktop scheduled tasks , which run on your own computer; and the /loop command, which repeats a prompt at set intervals within an open session. Routines are currently in research preview and available on Pro, Max, Team, and Enterprise plans. Last updated: 14.10.2026 In software development, efficiency is one of the top priorities for modern engineering teams. Constantly growing codebases, endless status updates, and routine quality checks can pull developers away from the creative system design work that deserves their focus. This is where Claude Code automation comes in. These structures, which can carry out many processes from code reviews to debugging, deployment verification to keeping documentation up to date, even while your computer is off, take repetitive work off the developer's plate. Go Beyond Limits with Cloud-Based Routines Routines running on cloud infrastructure managed by Anthropic let your workflows continue even while you sleep or when your laptop is completely closed. A routine is essentially a configuration that is packaged once and runs automatically, consisting of a specific working prompt, one or more code repositories to operate on, and connection points that communicate with external services. Thanks to this configuration, operations are carried out autonomously in the background without any additional human intervention or a real-time approval window. You can create routines at claude.ai/code/routines, from the Claude desktop app, or with the /schedule command in the Claude Code CLI; all three save to the same account. Each run opens as a full Claude Code cloud session that clones the repository from scratch, and Claude pushes changes to a branch prefixed with claude/ by default. Routines belong to your personal account, are not shared with teammates, and count against your usage allowance. If you are curious why developers prefer Claude Code, you can take a look at this article . There are three main trigger mechanisms for starting routines: Scheduled Triggers: They can be set with ready-made options such as hourly, daily, weekdays, or weekly, or to run once at a specific future time. For custom intervals such as every two hours or on the first of each month, you can enter a standard cron expression with the /schedule update command in the CLI; the shortest interval is one hour. Times are entered in your own time zone. Runs set for exactly on the hour (e.g., 09:00) may start a few minutes late, so choosing a minute like 09:07 gives better results. API Triggers: You can start routines instantly, and optionally with a payload, by sending an HTTP POST request to an endpoint dedicated to that routine with a secure bearer token. This is ideal in deployment pipelines or external monitoring tools, where the system needs to react to an external alert signal. For security reasons, these tokens are shown only once by the system and should be stored safely in an external vault. GitHub Triggers: They make a routine run automatically when a pull request is opened, closed, labeled, or updated, or when a release is created and published. The currently supported event types are these two: pull request and release. Using filters such as author, title, target branch, source branch, label, draft status, or merged status, you can have the routine run only on the PRs you want. For this, the Claude GitHub app must be installed on the repository. These triggers can be combined in a single routine. For example, a PR review routine can run every night, be triggered via API from a deployment script, and also kick in whenever a new PR is opened. Practical Use Cases for Autonomous Workflows Advanced Claude Code automation features greatly reduce the mechanical operational load on teams. When you review the resources in the comprehensive " Anthropic Claude Guide ," you can see that these systems are designed especially for work that is critical yet continuously repeated. Backlog Maintenance: A scheduled routine can connect to your issue tracker through a connector every weeknight, analyze issues opened since its last run, assign owners based on the relevant area of the code, label them, and post a daily summary on Slack right before the team wakes up. Custom Code Reviews Triggered by GitHub events , this routine applies your team's own standard review checklist to every opened PR and leaves inline comments for performance, security, and style issues. This way, senior developers can focus directly on software design instead of mechanical checks. Deployment Verification: Your continuous delivery (CD) pipeline can trigger the routine autonomously via API after every production deployment. The system runs smoke tests on the new build, scans error logs for regressions, and sends a final approval or rejecti

Etiketler:Claude Code OtomasyonuYapay Zeka Zamanlanmış GörevlerOtonom İş Akışları
Oray Yılmaz
Oray YılmazCreator
@orayyilmaz16

Comments (0)

Log in to comment.

Log in
No comments yet. Be the first to comment!