# Scheduling prompts in GitHub Copilot CLI

> Use the /every and /after slash commands to submit a prompt to Copilot on a recurring schedule, or after a specified delay.

- 网址：https://funcoding.ai/agents/github-copilot/how-tos/copilot-cli/automate-copilot-cli/schedule-prompts/
- 来源：GitHub Copilot 官方文档原文（英文），CC-BY-4.0 许可，同步于 2026-10-11
- 官方原文：https://docs.github.com/en/copilot/how-tos/copilot-cli/automate-copilot-cli/schedule-prompts

---
<div class="callout callout-note">

The `/every` and `/after` commands are currently experimental features and are only available if you have used the `/experimental on` slash command, or the `‑‑experimental` command line option.

</div>

In an interactive Copilot CLI session you can schedule a prompt to be submitted automatically. This is useful when you want Copilot to repeat a task at a regular cadence or to perform a one-off task after a delay, without you having to remember to submit the prompt manually.

There are two slash commands for this:

* `/every` — schedule a prompt to be sent **repeatedly**, either at a fixed interval or at a cadence determined by Copilot.
* `/after` — schedule a prompt to be sent **once**, after a specified period of time.

Both commands are only available inside an interactive Copilot CLI session: the schedules fire only while the session in which they were created is running. For ways to run Copilot CLI on a schedule when no session is open, see [Running a prompt from an external scheduler](#running-a-prompt-from-an-external-scheduler) at the end of this article.

## Scheduling a recurring prompt with `/every`

In an interactive Copilot CLI session, type `/every` followed by the prompt you want to be submitted. To use a fixed interval, include the interval before the prompt.

```copilot
/every [INTERVAL] PROMPT
```

If you specify an interval, the prompt will be submitted after the interval has elapsed and then again on the same cadence until you delete the schedule entry or you end the interactive CLI session.

### Examples

```copilot
/every 1h run the test suite and summarize any new failures
```

```copilot
/every 30m check for new comments on my open pull requests
```

<div class="callout callout-note">

`/loop` is an alias of `/every`. So you can enter `/loop` instead of `/every`, if you prefer, and the effect is the same.

</div>

### Self-paced scheduling

If you use `/every` with a prompt but no interval or time—for example, `/every keep checking the deployment and let me know once it's healthy`—Copilot creates a self-paced schedule instead of an error. After each run, Copilot decides when to run the prompt again based on the task, rather than following a fixed interval, and stops on its own once it decides there's nothing left to watch. Because the model chooses the cadence, a self-paced schedule can run more or less often than a fixed interval would, so keep an eye on it and delete it (as described in [Managing scheduled prompts](#managing-scheduled-prompts)) if it runs more than you expect.

## Scheduling a once-only prompt with `/after`

Type `/after` followed by a delay and the prompt you want to submit:

```copilot
/after DELAY PROMPT
```

The prompt fires once, after the delay has elapsed, and is then removed from the schedule list.

<div class="callout callout-note">

`/after` does not support self-paced scheduling. If you pass a prompt to `/after`, you must supply a delay or time.

</div>

### Examples

```copilot
/after 30m Give me details of changes to README.md made in the last 30 minutes
```

```copilot
/after 10m Check that the address finder is visible on example.com/register
```

## Scheduling a skill

You can use `/every` and `/after` to schedule a skill. To do this, you can reference the skill explicitly by using its slash command, or you can use natural language to tell Copilot to run the skill.

<div class="callout callout-note">

Only user-invocable skills and a subset of built-in slash commands can be scheduled. Commands that start a self-contained piece of work—such as `/plan`, `/review`, `/research`, or `/security-review`—are schedulable. Commands that change your session or configuration (for example, `/model`, `/clear`, `/compact`, `/permissions`, or `/sandbox`), that only display information (such as `/usage` or `/context`), or that manage scheduling itself (`/every` and `/after`) can't be scheduled, and Copilot rejects them when you try.

</div>

### Examples

```copilot
/after 2h Use the docx skill to create a new file summarizing recent changes to this repo
```

```copilot
/every 1d /refactor-plan Adjust the architecture of this project to improve the responsiveness of the client UI
```

## Interval and delay syntax

| Suffix | Unit    | Example |
| ------ | ------- | ------- |
| `s`    | seconds | `30s`   |
| `m`    | minutes | `5m`    |
| `h`    | hours   | `2h`    |
| `d`    | days    | `1d`    |

When you specify a numeric duration, always include the suffix. A bare number—for example, `/every 30 remind me to check for Slack messages`—is not recognized as an interval.

For a fixed interval, the minimum is **10 seconds** and the maximum is **1 day** (24 hours).

You can also describe the timing in plain language instead of using a duration—for example, `/after at 3pm push the release`, or `/every day at 9am post the standup`. Copilot uses a model to interpret the phrase, then creates the schedule from it.

## Identifying scheduled prompts in the session

When a scheduled prompt is triggered, Copilot precedes the prompt with text such as `[Scheduled prompt #4]` to distinguish it from a prompt you typed yourself.

You can use the ID to cancel the schedule. For example, by entering `stop prompt 4`.

## Managing scheduled prompts

To list the active schedules for the current session, type `/every` or `/after` with no arguments.

To delete a schedule, use the arrow keys on your keyboard to move through the list and select the schedule you want to delete, then press <kbd>x</kbd>.

Press <kbd>Esc</kbd> to exit the schedule list.

## What happens when you close and reopen a session

Scheduled prompts are scoped to the session they were created in, and they are only triggered while that session is running.

When you reopen the session (using the `--continue` or `--resume` command line options) the schedules are restored. For a recurring schedule created with a fixed interval, the wait before the next run is measured from the moment you reopen the session.

An `/after` schedule that had not been triggered before you closed the session keeps its original target time, rather than restarting the delay. If that time passed while the session was closed, the prompt is submitted as soon as you reopen the session.

## Running a prompt from an external scheduler

The `/every` and `/after` commands only run while an interactive Copilot CLI session is open. If you want a prompt to run on a schedule even when no session is active, you can run Copilot CLI from an external scheduler such as **cron** on macOS or Linux, or **Task Scheduler** on Windows.

To run Copilot CLI programmatically, use the syntax `copilot -p "YOUR PROMPT"`. The CLI processes your prompt without displaying the interactive interface and then exits.

This is useful for tasks such as:

* **Nightly maintenance** — for example, running your test suite against the latest changes on a branch every night and posting a summary to a tracking issue.
* **Periodic dependency checks** — for example, opening a weekly pull request that updates dependencies and runs the test suite against the result.
* **Scheduled reports** — for example, generating a daily summary of new issues or pull requests assigned to you and emailing or posting it to a chat channel.

For more information, see [AUTOTITLE](https://funcoding.ai/agents/github-copilot/how-tos/copilot-cli/automate-copilot-cli/run-cli-programmatically/).

## Further reading

* [AUTOTITLE](https://funcoding.ai/agents/github-copilot/reference/copilot-cli-reference/cli-command-reference/#slash-commands-in-the-interactive-interface)
