tencent cloud

Scheduled Tasks

Download
Focus Mode
Font Size
Last updated: 2026-09-30 18:41:46
AI-Translated

Overview

CodeBuddy Code supports creating and managing scheduled tasks within a session. You can repeatedly execute commands on a set schedule or trigger one-time operations at a future point in time. Common use cases include periodically checking build status, polling task completion, and reminding yourself at specific times.
Note:
Scheduled tasks are session-scoped. Tasks are valid only while CodeBuddy Code is running and are automatically cleared upon exit.

Creating a Loop Task with /loop

/loop is the most convenient way to create recurring tasks. You only need to specify the time interval and the command to execute, and the system automatically converts them into a cron expression and creates the task.

Syntax

/loop [interval] <command>
Parameter
Description
Time Interval
Optional. Supports s (seconds), m (minutes), h (hours), and d (days). Defaults to 10 minutes when omitted.
Command
Required. Content to execute each time the task is triggered, which can be natural language or a slash command.

Common Examples

Check CI/CD pipeline status:
/loop 3m Check whether the pipeline has finished running and report the result to me.
Run unit tests on a schedule:
/loop 30m Run unit tests once for me and let me know if there are any failed cases.
Summarize code review todos every hour:
/loop 1h Check if there are any new PRs that need my review.
Use with custom commands:
/loop 10m /check-build
Describe the frequency in natural language (append every at the end):
Monitor API response time for me every 8m.
Check the deployment status every 25m.

Default Behavior When No Interval Is Specified

If you specify only the command without an interval, it is triggered every 10 minutes by default:
/loop Check whether the backend service is responding normally.

Autonomously Adjusting the Next Interval per Round

After each /loop task execution is completed, the AI autonomously determines what the next round should do based on the current results: trigger earlier, delay triggering, maintain the original interval, or end the loop directly. For example, for a task like "check whether the pipeline has finished running", if the pipeline is still running, the AI may decide to shorten the next interval to get results faster. If the pipeline has already finished, the AI may decide to end the loop.
This adjustment is automatic and requires no manual intervention. The loop still lasts no more than 3 days, and you can end it manually at any time as described in the "Canceling a Task" section.

Creating a One-Time Reminder

If you only need a one-time reminder at a future point in time, you can describe it directly in natural language:
Remind me at 4:30 PM to sync up on today's progress.
Check in an hour whether that build task has produced any output.
Generate a work report for yesterday for me at 9:00 AM tomorrow.
Tasks of this type are triggered once at the specified time and are automatically deleted after execution.

Managing Existing Tasks

Viewing All Current Tasks

What scheduled tasks do I currently have?
The list contains the task ID, execution frequency, task type (recurring / one-time), and the corresponding command.

Canceling Task

Cancel the scheduled task for deployment checks.
Or cancel by task ID:
Delete the scheduled task with ID xxx for me.
The underlying layer corresponds to the CronList and CronDelete tools respectively, which can be operated directly through conversation without memorizing specific commands.

Task Execution Mechanism

Execution Timing

Tasks are triggered only when the session is idle, meaning the system is not processing other requests. If an operation is in progress, the trigger time is postponed until the operation completes.

Jitter

The system adds a small random offset to task trigger times to avoid congestion caused by a large number of tasks executing simultaneously.
Recurring tasks: delayed by up to 10% of the cycle duration (with a maximum of 15 minutes).
One-time tasks: for tasks scheduled on the hour or half hour, execution can start up to 90 seconds early.
For example, for a task set to run every hour, the actual trigger time may be randomly distributed within 0 to 6 minutes after the hour.

Automatic Expiration

Recurring tasks automatically expire and are deleted 3 days after creation, and are triggered one last time before expiration.
If you need a task to last longer, you can recreate it after it expires or switch to an external scheduling solution such as GitHub Actions.

Cron Expression Reference

If you need precise schedules such as "every Monday at 10:00 AM" or "the 1st of each month", simply tell the AI your requirements and it will automatically convert them into cron expressions and create the task:
Generate this week's work plan for me every Monday at 10:00 AM.
On the morning of the 1st of each month, compile the previous month's code commit counts and summarize them by person.
Remind me every Friday at 5:30 PM to sync progress and update task statuses.
Check every day at 12:00 PM if there are any PRs pending my review.
List the PRs that were not merged yesterday at 9:15 AM on weekdays.
When the AI replies, it will tell you the actual cron expression and execution frequency used, so you can confirm whether they meet your expectations.
Format:
Minute Hour Day Month Day of week
Common expressions:
Expression
Description
*/5 * * * *
Every 5 minutes
*/15 * * * *
Every 15 minutes
0 * * * *
At the top of every hour
0 9 * * *
At 9:00 AM every day
0 9 * * 1-5
At 9:00 AM on weekdays
0 0 1 * *
At midnight on the first day of each month
30 18 * * 5
At 6:30 PM every Friday
Field description:
Field
Value Range
Special Character
Minute
0–59
* (any), */N (every N minutes), N,M (list), N-M (range)
Hour
0–23
Date
1–31
Month
1–12
Day of week
0–6
0 or 7 = Sunday, 1 = Monday, and so on.

Must-Knows

Item
Description
Session binding
Tasks exist only within the session. After CodeBuddy Code exits, tasks disappear and are not written to disk.
Recurring Task Limit
A maximum of 50 scheduled tasks can exist concurrently in each session.
Minimum Interval
1 minute (second-level settings are automatically rounded up)
Task Expiration
Recurring tasks are automatically cleared after 3 days.
No Catch-up Execution
Tasks missed during session interruption are not reissued or executed.

Disabling Scheduled Tasks

To completely disable the scheduled task feature, set the environment variable:
CODEBUDDY_DISABLE_CRON=1 codebuddy
When this feature is enabled, the /loop skill is no longer available, and the CronCreate, CronList, and CronDelete tools are also disabled.

References



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback