Feature request: /every and /after slash commands — schedule recurring and one-shot prompts in the current session (Claude Code /loop parity)
- 主要语言
- 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