Skip to content
한국어

Delegating Recurring Work to Agents: Skills, Routines, and Subagents

In short
  • The order for delegating recurring work is ① do it by hand once → ② lock in the format with a skill → ③ split research and review with a subagent → ④ run it automatically with a routine.
  • A skill is an instruction sheet (SKILL.md) that says “do it this way, in this format”. A subagent is a helper agent with its own context and tool permissions. A routine is a feature that saves a prompt, repositories, and connectors and runs them automatically in the cloud.
  • Routines run autonomously while no one is watching. Keep the prompt self-contained, and include only the connectors and repositories you need.
  • Routines are currently a research preview (as of 2026-11-02). Behavior and limits may change.
  • The official docs now call this feature scheduled tasks (formerly routines). This tutorial keeps saying “routines”, but you may see either name on screen and in the docs. The address (claude.ai/code/routines) and /schedule (alias /routines) are unchanged.
  • The scenarios in this tutorial (weekly report, docs check) are examples made by this site. They aren’t cases of the same name in the official docs.

What you’ll be able to do after this tutorial

Section titled “What you’ll be able to do after this tutorial”
  • Tell which recurring tasks are good to hand to an agent and which aren’t.
  • Create a skill (SKILL.md) to lock in recurring instructions like a report format.
  • Create a subagent to separate drafting from review.
  • Create a scheduled routine, and go as far as a test run (Run now) and checking the run history.
Tool One-line description Analogy
Skill A folder holding instructions and examples. You write it in SKILL.md and call it with /skill-name, or Claude loads it automatically when it matches the description. See C8 for details A work manual
Subagent A helper agent with its own context, system prompt, and tool permissions. It keeps long output to itself and returns only a summary. See C14 for details A dedicated specialist
Routine Saves a prompt + repositories + connectors and runs them automatically in the cloud. It has schedule, API, and GitHub event triggers. See C13 for details A recurring-task alarm

The three tools complement each other. A skill handles how, a subagent handles who, and a routine handles when.

Good to hand off Be careful handing off
The input and result format are fixed The criteria for judgment change every time
A person can do the final review of the result The result goes outside right away with no review
You can undo mistakes (a branch, a draft) You can’t undo it (sending, payment, deletion)
The material is in a repository or connector The material is only in your head or on paper

This scenario is “Every Friday afternoon, gather the week’s notes and make a weekly report draft”. Assume you create a notes/ folder in a practice repository and write what you did that week as notes by date (don’t put in real work secrets).

0/8 done
  1. Define the task

    Write down the following four things in sentences. This writing becomes the routine’s prompt later.

    • Input: This week’s notes in the notes/ folder (file names are dates, like 2026-10-05.md)
    • Output: One file, drafts/weekly-YYYY-MM-DD.md (using Friday’s date)
    • Format: What I did this week / Plans for next week / Blockers
    • Success criteria: Don’t make up anything that isn’t in the notes, and mark unknown items as “needs confirmation”
  2. Do it by hand once

    Before turning it into a routine, run it directly once in Claude Code (Tutorial 6) and see whether the result is usable. What you don’t like here becomes the instructions to put in the skill.

    Copy and paste this prompt

    Read this week’s notes (Mon-Fri) in the notes folder and create a weekly report draft as drafts/weekly-2026-10-09.md. Use three parts: “What I did this week, Plans for next week, Blockers”. Don’t make up anything that isn’t in the notes, and if you don’t know, write “needs confirmation”. Before writing, first show me a list of which notes you’ll read.

  3. Lock in the format with a skill

    Move the rules that came out of doing it by hand into a skill file. To use it with your team inside a project, put it in the repository at .claude/skills/<name>/SKILL.md. To use it yourself in all projects, put it at ~/.claude/skills/<name>/SKILL.md.

    Copy and paste this prompt

    Create the file .claude/skills/weekly-report/SKILL.md. In the frontmatter, set name to weekly-report and description to “Gathers this week’s notes from the notes folder and creates a weekly report draft in the drafts folder. Use when the user asks for a weekly report or weekly summary.” In the body, write up the input (dated notes in the notes folder), output (drafts/weekly-date.md), format (what I did this week, plans for next week, blockers), and rules (don’t make up anything that isn’t in the notes, mark unknowns as “needs confirmation”, keep sentences short).

    The resulting file looks like this.

    .claude/skills/weekly-report/SKILL.md
    ---
    name: weekly-report
    description: Gathers this week's notes from the notes folder and creates a weekly report draft in the drafts folder. Use when the user asks for a weekly report or weekly summary.
    ---
    # Create a weekly report draft
    1. Read all notes dated this week (Mon-Fri) in the notes folder.
    2. Write to drafts/weekly-YYYY-MM-DD.md (using Friday's date) in the format below.
    - What I did this week
    - Plans for next week
    - Blockers
    3. Rules
    - Don't make up anything that isn't in the notes.
    - Mark unknown items as "needs confirmation".
    - Keep sentences short.

    You can call it directly in a session with /weekly-report, or when you ask for a report, Claude loads it automatically based on the description. The file name is written as skill.md in some docs and SKILL.md in others. The Claude Code docs use SKILL.md.

  4. (Optional) Separate review with a subagent

    If you split the agent that writes the draft from the agent that reviews it, the review isn’t contaminated by the long context of drafting. You define a subagent as a Markdown file in .claude/agents/, and the required fields are name and description.

    .claude/agents/report-reviewer.md
    ---
    name: report-reviewer
    description: Compares a weekly report draft against the original notes in the notes folder and finds unsupported content. Use for review after a draft is finished.
    tools: Read, Glob, Grep
    model: sonnet
    ---
    You are a report reviewer. Read the draft in the drafts folder and check whether each sentence is supported by the notes in the notes folder.
    List any sentences without support, and do not modify any files.

    If you give it only read tools via tools, this agent can’t change files. For model you can use sonnet, opus, haiku, fable, inherit, and so on. You can also ask Claude to create the agent for you. For reference, the /agents command in the current version only shows a guidance message, while v2.1.197 and below showed an interactive wizard.

    Copy and paste this prompt

    Use the report-reviewer subagent to review the drafts/weekly-2026-10-09.md we just made. If any sentences aren’t supported by the notes, tell me which ones.

  5. Push it to the repository

    A routine clones the repository in the cloud and runs there. For the skill and subagent files to be visible to the cloud session, they must be committed and pushed to the repository. Ask Claude Code, “Commit the new .claude folder and notes/ and push them,” or use the approach from Tutorial 8. The official docs explain that routines use skills committed to the repository, and that skills in your computer’s personal skills folder (~/.claude/skills) show up as “not found” in cloud scheduled tasks (desktop scheduled tasks do read them). For subagents, the cloud sessions docs say they “automatically recognize subagents defined in the repository’s .claude/agents/”, and routines run as cloud sessions. Even so, check that it works locally first, then look at the routine’s run history to see whether they were actually used.

  6. Create a scheduled routine

    At claude.ai/code/routines, click New task to open the New scheduled task window (depending on your account, the button may be New routine and open a full-page form). In the terminal, you can create one interactively with /schedule (for example, /schedule daily PR review at 9am). The fields on the web form are as follows.

    • Name: Weekly report draft
    • Prompt: A routine runs autonomously, so the prompt must be self-contained with clear success criteria.
    Routine prompt example

    Use the weekly-report skill to create a weekly report draft in drafts/weekly-date.md from this week’s notes (Mon-Fri) in the notes folder. The date is this week’s Friday. Don’t make up anything that isn’t in the notes; mark it as “needs confirmation”. After creating it, check once more whether each sentence in the draft is supported by the notes, and fix any unsupported sentences. At the end, summarize the changes so a PR can be created. Don’t push directly to the main branch.

    • Repository: One practice repository. The selected repository is cloned from the default branch on every run. Claude pushes to branches with the claude/ prefix.
    • Environment: Default (Limited network access, shown as Trusted in older settings; as of 2026-11-16) is enough.
    • Trigger: Under Schedule, pick a preset like daily or weekly and enter the time in your own time zone. For a cadence that isn’t a preset, after creating it choose Custom in the edit window and set it with a cron expression (times in cron expressions are UTC). Runs at the top of the hour can start a few minutes late, so we recommend offsetting the minute, such as 16:07 instead of 16:00. The minimum interval is 1 hour.
    • Connectors: All connected connectors are included by default. Claude can use all the tools of an included connector, including writing, so remove everything this routine doesn’t need.

    Finally, click Create.

    Creating a routine and test-running it
    1. claude.ai/code/routinesClick New task (New routine, depending on your account)→ The window or form for creating a scheduled task (routine) opens
    2. FormEnter the name, prompt, repository, environment, trigger, and connectors, then click Create→ The routine is created
    3. Routine detail screenClick Run now→ A new session is created and you can view the run history

    This is a simplified flow. See the official help page for the actual screens.

    Screen guide: The routine creation form with the prompt, repository, and trigger filled inSee this screen in the official help ↗

  7. Test with Run now and check the run history

    On the routine detail screen, click Run now to run it once right away. Each run creates a new session, and if you open it you can see what Claude did, the changes, and whether a PR was created.

    If you like the result, reading and merging the PR for the branch it made is something a person does. If you don’t like it, fix the prompt or skill under the routine’s Edit. You can also pause it with the on/off switch on the routine screen.

Comparing the three tools (as of 2026-11-02)

Section titled “Comparing the three tools (as of 2026-11-02)”
Skill Subagent Routine
File / location .claude/skills/<name>/SKILL.md or ~/.claude/skills/... .claude/agents/<name>.md claude.ai/code/routines (saved to your account)
Role Method and format Division of labor, review When it runs automatically
Invocation /name or automatic Claude delegates, or you specify Schedule, API, GitHub event
Approval Follows the session’s permission mode Follows the session’s permission mode Runs autonomously. Cloud sessions start in auto mode
Status Generally available Generally available Research preview
Item Details
Triggers Schedule (presets like hourly, daily, weekly; Custom cron; one-time), API (HTTP POST + bearer token), GitHub event (pull request, release)
Minimum schedule interval 1 hour
Scheduled run limit 100 per hour per account
Run now / API runs There are limits such as a shared 30 per hour per routine (see the official Usage and limits table)
Overage charges for the hourly limit None
When you hit your subscription usage limit Continues pay-as-you-go if extra usage (usage credits) is on; otherwise rejected until reset
Ownership Owned by your account. Not shared with teammates
Method Where it runs Characteristics
Routine Cloud Runs even when your computer is off
Desktop scheduled tasks Your computer Accesses local files and tools
/loop Inside a CLI session Simple repetition within an open session

Scenario ideas (suggestions from this site)

Section titled “Scenario ideas (suggestions from this site)”
Task Skill Subagent Trigger
Weekly report draft Report format Evidence-checking review Every Friday
Docs freshness check Doc writing rules Change impact research Every Monday, or when a PR is merged
Meeting notes cleanup Meeting notes template Action item verification Manual run or API
Pre-review of PRs Team checklist Separate security and style review GitHub event (PR opened)

The official docs include routine examples such as a docs drift check (a routine that scans PRs weekly and opens a docs update PR) and custom code review (reviewing PRs against a team checklist when they’re opened).

The routine is green but no report was created

Section titled “The routine is green but no report was created”
  • Cause: Green means it finished without an infrastructure error. The prompt may be vague, the files may not be in the repository, or the network may be blocked.
  • Fix: Open the run and read the session history. Write the input location, output location, and success criteria more specifically in the prompt.
  • Cause: The skill file may not have been committed and pushed to the repository, or it may be in a different repository. A routine clones the selected repository from the default branch.
  • Fix: Check that the skill is merged into the default branch. Name the skill explicitly in the prompt, and if that doesn’t work, include the skill’s contents directly in the prompt.

I typed /schedule and it says it’s an unknown command

Section titled “I typed /schedule and it says it’s an unknown command”
  • Cause: According to the official docs, it’s hidden if you logged in with a Console API key or a cloud provider rather than a claude.ai subscription login. It can’t be used inside a cloud session, and routines or cloud sessions may be turned off by organization policy (Team and Enterprise Owners turn them off with the “Scheduled tasks (Was Routines)” toggle in organization settings).
  • Fix: Log in to your claude.ai subscription account with /login. If that still doesn’t work, create it on the web (claude.ai/code/routines), and if it’s organization policy, contact your Owner.
  • Cause: If you schedule at the top of the hour, it can start a few minutes late.
  • Fix: Offset the minute when scheduling, such as 9:07 instead of 9:00.

It didn’t run for a while and then turned off

Section titled “It didn’t run for a while and then turned off”
  • Cause: If your GitHub connection breaks or expires, the routine skips runs. According to the official docs, it skips for up to 72 hours, after which the routine turns off.
  • Fix: Reconnect GitHub, and if it turned off, turn the routine back on.
  • Cause: Routines use the same subscription usage as interactive sessions.
  • Fix: Reduce how often it runs (such as once a week), narrow the prompt’s scope, and check your usage (Settings > Usage). See C2 for how limits are structured.
  • First by hand, then a skill, and a routine last. If you reverse the order, it’s hard to tell what went wrong.
  • Always make the output a “draft” and a “branch”. Leave a place for a person to read and merge.
  • Make the skill description specific. Claude reads this description to decide when to use it. Keep each skill focused on one workflow.
  • Give subagents only the tools they need. For review, read tools are enough.
  • Remember it’s owned by your personal account. Routines aren’t shared with teammates, and commits and PRs are recorded under your name. For team work, check your team’s policy first.
  • Don’t put secret values in prompts or skills. Environment variables can be read by anyone who uses that environment.

Sources

Last verified: Nov 16, 2026

Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.