Documentation Index
Fetch the complete documentation index at: https://docs.cline.bot/llms.txt
Use this file to discover all available pages before exploring further.
The SDK supports running agents on cron schedules. Scheduled agents persist across process restarts and run independently of any client application.
How Scheduling Works
- You define a schedule (cron expression + prompt + config)
- The SDK stores the schedule and manages execution
- At each trigger time a new session is created and the agent is run
- Results are stored and can be routed to connectors (Slack, email, etc.)
Scheduled agents rely on the hub-spoke architecture that is part of ClineCore. The hub runs as a background process on your machine. It starts automatically when needed and persists schedules across restarts.
Creating Schedules Programmatically with Cline SDK
import { ClineCore } from "@cline/sdk"
const cline = await ClineCore.create({
clientName: "scheduler",
automation: true,
})
await cline.automation.start()
// Use cline.automation to reconcile specs, ingest events, and list runs.
Schedule Wizard with Cline CLI
An easy way to schedule task is to use Cline CLI for scheduling task, if you’ve already installed via npm i -g cline
Run cline schedule to open an interactive menu for creating and managing schedules, browsing execution history, and viewing performance statistics.
Creating Schedules with Flags
# Daily at 9 AM on weekdays
cline schedule create "PR summary" \
--cron "0 9 * * MON-FRI" \
--prompt "List all open PRs, their review status, and any that have been open more than 3 days" \
--workspace /path/to/repo \
--model anthropic/claude-sonnet-4-6
# Every 6 hours
cline schedule create "Health check" \
--cron "0 */6 * * *" \
--prompt "Run the test suite and report any failures" \
--workspace /path/to/project
# Monday mornings
cline schedule create "Weekly digest" \
--cron "0 8 * * MON" \
--prompt "Summarize last week's commits, PRs merged, and issues closed"
Managing Schedules
# List all schedules
cline schedule list
# Trigger a schedule immediately (without waiting for cron)
cline schedule trigger <schedule-id>
# Pause a schedule
cline schedule pause <schedule-id>
# Resume a paused schedule
cline schedule resume <schedule-id>
# Delete a schedule
cline schedule delete <schedule-id>
# View execution history
cline schedule executions <schedule-id>
Cron Expression Reference
| Expression | Schedule |
|---|
0 9 * * MON-FRI | 9 AM, Monday through Friday |
0 */6 * * * | Every 6 hours |
0 8 * * MON | 8 AM every Monday |
30 17 * * * | 5:30 PM every day |
0 0 1 * * | Midnight on the 1st of each month |
*/30 * * * * | Every 30 minutes |
Use Cases
Daily Standup Summary
cline schedule create "Standup prep" \
--cron "0 8 * * MON-FRI" \
--prompt "Summarize: (1) PRs merged yesterday, (2) PRs currently in review, (3) open issues assigned to team members. Format as a brief standup update." \
--workspace /path/to/repo
Automated Dependency Updates
cline schedule create "Dependency check" \
--cron "0 10 * * MON" \
--prompt "Check for outdated npm dependencies. For any with security vulnerabilities, create a branch with the update and open a PR." \
--workspace /path/to/project
Codebase Health Report
cline schedule create "Code health" \
--cron "0 6 * * MON" \
--prompt "Analyze the codebase for: (1) files with no test coverage, (2) TODO/FIXME comments older than 30 days, (3) functions longer than 100 lines. Produce a health report." \
--workspace /path/to/project
Concurrency and Resource Limits
The scheduler enforces limits to prevent resource exhaustion:
- Schedules have configurable concurrency limits
- If a previous execution is still running when the next trigger fires, the new execution is queued or skipped (configurable)
- The hub monitors resource usage and can pause schedules if the system is under load
Routing Results
Combine scheduled agents with connectors in CLI to route results to messaging platforms:
# Start a Telegram connector
cline connect telegram -m my_bot -k $BOT_TOKEN
# Schedule an agent whose output gets sent to Telegram
cline schedule create "Morning briefing" \
--cron "0 8 * * *" \
--prompt "Summarize overnight activity in the repo"