github / github/copilot-cli

Feature request: /every and /after slash commands — schedule recurring and one-shot prompts in the current session (Claude Code /loop parity)

未關閉
#3,356 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area:sessions
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the feature or problem you'd like to solve

Copilot CLI has no built-in way to schedule a prompt to fire later (one-shot) or repeatedly (recurring) within an active session. Today the workarounds are:

- A separate terminal running `while($true){ copilot -p "..." --yolo; Start-Sleep 300 }`, which spins up a fresh session each iteration and loses context
- An OS-level scheduled task (cron / Task Scheduler) firing `copilot -p "..."`, same context-loss problem
- `/autopilot` mode, which is "keep going until done" semantics, not "re-fire this same prompt on a cadence"

None of these preserves the live session, so they're a poor fit for use cases like "ping me to commit every 30 min", "re-run the failing test suite every 5 min until it passes", or "summarize my work so far every hour."

### Prior art: Claude Code's `/loop` skill

Claude Code ships a bundled skill called `/loop` that takes a prompt and re-issues it on a schedule within the current session, keeping conversation context intact. It's one of the more useful productivity primitives Claude Code has, especially paired with autopilot-style modes for unattended work.

### Proposed solution

Add two slash commands:

- **`/every `** — schedule the prompt to fire repeatedly every N (s/m/h). Example: `/every 5m run the test suite and tell me which tests are failing`.
- **`/after `** — schedule the prompt to fire once after N (s/m/h). Example: `/after 30s remind me to commit`.

Both commands should:

- Inject the prompt into the *current* session (preserving context, files allowed, MCP servers, instructions, etc.) rather than spawning a new one
- Be cancellable (e.g. a `/schedule list` and `/schedule cancel ` pair, or `/every` with no args showing active schedules)
- Survive `--resume` if practical, or at minimum be cleared cleanly on session end
- Respect autopilot / permission settings so the fired prompt doesn't block on confirmation unless the user wants it to

### Example workflows

1. **Test-until-green:** `/every 3m run the failing tests and report the first failure stack trace` while iterating on a fix in another editor pane.
2. **Periodic git hygiene:** `/every 30m show me my uncommitted changes and suggest a commit message if there's a clean unit of work`.
3. **One-shot reminders:** `/after 45m summarize what we've done this session so I can write a stand-up note`.
4. **Unattended polling:** `/every 10m check if PR #1234 has new review comments and respond to any obvious nits`.

### Additional context

- OS: Windows 11, PowerShell 7
- Copilot CLI: 1.0.48
- A previous version of `/help` (cached in the `fetch_copilot_cli_documentation` tool output that ships with the CLI agent harness) lists `/every` and `/after` under "Other commands" with examples — they are not actually present in v1.0.48, suggesting these may have been planned/prototyped previously. Resurrecting that design would close the gap with Claude Code's `/loop` cleanly.
- This pairs naturally with `/autopilot`: scheduled prompts in an autopilot session enable long-running unattended workflows that today require external glue.

貢獻指南

開啟貢獻指南

研究方向

No implementation files or tests are named. Start by locating the existing slash-command handling and the session/autopilot entry points, then review the prior /help command listing mentioned in the issue. Done means /every and /after schedule prompts in the current session, support cancellation, and cleanly handle permissions and session shutdown or resume.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
powershell, shell
領域
cli
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。