autonomous-skill by feiskyer/claude-code-settings
npx skills add https://github.com/feiskyer/claude-code-settings --skill autonomous-skill通过自动延续、进度跟踪和两种完成机制(承诺标签 + 复选框计数),跨多个 Claude Code 会话执行复杂任务。
在 bash 循环中生成 claude -p 子会话。最适合后台/无人值守工作。
bash <skill-dir>/scripts/run-session.sh "Build a REST API" --max-sessions 10
使用 Stop 钩子拦截会话退出并重新输入提示。在当前交互式会话内运行——无嵌套问题。
bash <skill-dir>/scripts/setup-loop.sh "Build a REST API" --max-iterations 10
完整的任务分解:初始化器创建包含分阶段子任务的 task_list.md,执行器逐个拾取并完成它们。最适合复杂、多阶段的项目。
bash <skill-dir>/scripts/run-session.sh "Build a REST API for todo app"
--lightweight)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Ralph 风格迭代:每个会话重复相同的提示,无任务分解。最适合具有明确成功标准的迭代任务(TDD、错误修复、重构)。
bash <skill-dir>/scripts/run-session.sh "Fix all failing tests in src/" --lightweight
两种互补机制——先触发者胜出:
承诺标签(两种模式):当工作真正完成时,代理输出 <promise>DONE</promise>。默认承诺是 DONE;使用 --completion-promise 自定义。代理被指示仅在任务真正完成时输出承诺——而不是为了退出循环。
复选框计数(仅限结构化模式):task_list.md 中的所有 [ ] 项都被标记为 [x]。
project-root/
├── .autonomous/
│ └── <task-name>/
│ ├── task_list.md # 主检查清单(结构化模式)
│ ├── progress.md # 每个会话的进度日志
│ ├── .mode # "structured" 或 "lightweight"
│ ├── sessions/ # 每个会话的转录日志
│ │ ├── session-001.log
│ │ └── session-002.log
│ └── run.lock # 防止并发运行
└── .claude/
└── autonomous-loop.local.md # 钩子模式状态(激活时)
bash <skill-dir>/scripts/run-session.sh "task description" [OPTIONS]
| 标志 | 描述 | 默认值 |
|---|---|---|
--lightweight | Ralph 风格迭代(无任务分解) | structured |
--task-name <name> | 显式任务名称 | 自动生成 |
--continue, -c | 继续最近或命名的任务 | — |
--list, -l | 列出所有任务及其进度 | — |
--completion-promise TEXT | 完成承诺短语 | DONE |
--max-sessions N | 在 N 个会话后停止 | 无限制 |
--max-budget N.NN | 每个会话的美元预算 | 5.00 |
--model <model> | 模型别名或全名 | sonnet |
--fallback-model <m> | 主模型过载时的备用模型 | — |
--effort <level> | 思考投入程度(low/medium/high) | high |
--no-auto-continue | 仅运行一个会话 | — |
--permission-mode <m> | 权限模式 | auto |
--add-dir <dirs> | 额外允许的目录 | — |
用于会话内循环(不生成子进程):
bash <skill-dir>/scripts/setup-loop.sh "task description" [OPTIONS]
| 标志 | 描述 | 默认值 |
|---|---|---|
| `--mode structured | lightweight` | 任务策略 |
--max-iterations N | 最大循环迭代次数 | 无限制 |
--completion-promise TEXT | 承诺短语 | DONE |
--task-name NAME | 显式任务名称 | 自动生成 |
钩子注册在 hooks/hooks.json 中。激活时,Stop 钩子读取 .claude/autonomous-loop.local.md 并阻止退出,直到检测到承诺或达到最大迭代次数。
要取消活动的钩子模式循环:rm .claude/autonomous-loop.local.md
task_list.md,开始工作| 场景 | 策略 | 模式 |
|---|---|---|
| 构建完整应用程序 | Structured | Headless |
| 修复所有失败的测试 | Lightweight | Either |
| 重构模块 | Lightweight | Either |
| 多阶段项目 | Structured | Headless |
| 快速迭代修复 | Lightweight | Hook |
| 夜间批处理工作 | Structured | Headless |
[ ] 改为 [x].autonomous/ 仅用于跟踪<promise>DONE</promise>--max-budget 调整| 问题 | 解决方案 |
|---|---|
| "锁文件已存在" | 之前的运行崩溃了。删除 .autonomous/<task>/run.lock |
| 会话持续失败 | 检查 sessions/session-NNN.log 中的错误 |
| 嵌套会话错误 | 脚本自动取消设置 CLAUDECODE;使用钩子模式作为替代方案 |
| 钩子循环不停止 | 删除 .claude/autonomous-loop.local.md |
| 找不到任务 | 运行 --list 查看可用任务 |
| 想要重新开始 | 删除任务目录并重新开始 |
| 成本过高 | 降低 --max-budget 或使用 --model sonnet |
每周安装
109
仓库
GitHub 星标
1.4K
首次出现
Jan 23, 2026
安全审计
安装于
opencode93
gemini-cli92
codex91
cursor89
github-copilot87
amp79
Execute complex tasks across multiple Claude Code sessions with automatic continuation, progress tracking, and two completion mechanisms (promise tags + checkbox counting).
Spawns claude -p child sessions in a bash loop. Best for background/unattended work.
bash <skill-dir>/scripts/run-session.sh "Build a REST API" --max-sessions 10
Uses a Stop hook to intercept session exit and feed the prompt back. Runs inside the current interactive session — no nesting issues.
bash <skill-dir>/scripts/setup-loop.sh "Build a REST API" --max-iterations 10
Full task decomposition: Initializer creates task_list.md with phased sub-tasks, Executor picks up and completes them one by one. Best for complex, multi-phase projects.
bash <skill-dir>/scripts/run-session.sh "Build a REST API for todo app"
--lightweight)Ralph-style iteration: same prompt repeated each session, no task decomposition. Best for iterative tasks with clear success criteria (TDD, bug fixing, refactoring).
bash <skill-dir>/scripts/run-session.sh "Fix all failing tests in src/" --lightweight
Two complementary mechanisms — whichever triggers first wins:
Promise tags (both modes): The agent outputs <promise>DONE</promise> when work is genuinely complete. Default promise is DONE; customize with --completion-promise. The agent is instructed to only output the promise when the work is truly finished — not to escape the loop.
Checkbox counting (structured mode only): All [ ] items in task_list.md are marked [x].
project-root/
├── .autonomous/
│ └── <task-name>/
│ ├── task_list.md # Master checklist (structured mode)
│ ├── progress.md # Per-session progress log
│ ├── .mode # "structured" or "lightweight"
│ ├── sessions/ # Transcript logs per session
│ │ ├── session-001.log
│ │ └── session-002.log
│ └── run.lock # Prevents concurrent runs
└── .claude/
└── autonomous-loop.local.md # Hook mode state (when active)
bash <skill-dir>/scripts/run-session.sh "task description" [OPTIONS]
| Flag | Description | Default |
|---|---|---|
--lightweight | Ralph-style iteration (no task decomposition) | structured |
--task-name <name> | Explicit task name | Auto-generated |
--continue, -c | Continue most recent or named task | — |
--list, -l | List all tasks with progress | — |
--completion-promise TEXT | Promise phrase for completion |
For in-session loops (no child process spawning):
bash <skill-dir>/scripts/setup-loop.sh "task description" [OPTIONS]
| Flag | Description | Default |
|---|---|---|
| `--mode structured | lightweight` | Task strategy |
--max-iterations N | Max loop iterations | Unlimited |
--completion-promise TEXT | Promise phrase | DONE |
--task-name NAME | Explicit task name | Auto-generated |
The hook is registered in hooks/hooks.json. When active, the Stop hook reads .claude/autonomous-loop.local.md and blocks exit until the promise is detected or max iterations reached.
To cancel an active hook-mode loop: rm .claude/autonomous-loop.local.md
task_list.md, begins work| Scenario | Strategy | Mode |
|---|---|---|
| Build a full application | Structured | Headless |
| Fix all failing tests | Lightweight | Either |
| Refactor a module | Lightweight | Either |
| Multi-phase project | Structured | Headless |
| Quick iterative fix | Lightweight | Hook |
| Overnight batch work | Structured | Headless |
[ ] → [x].autonomous/ is only for tracking<promise>DONE</promise> until genuinely complete--max-budget| Issue | Solution |
|---|---|
| "Lock file exists" | Previous run crashed. Remove .autonomous/<task>/run.lock |
| Session keeps failing | Check sessions/session-NNN.log for errors |
| Nested session error | Script auto-unsets CLAUDECODE; use hook mode as alternative |
| Hook loop won't stop | Delete .claude/autonomous-loop.local.md |
| Task not found | Run --list to see available tasks |
| Want to restart | Delete the task directory and start fresh |
| Cost too high | Lower --max-budget or use |
Weekly Installs
109
Repository
GitHub Stars
1.4K
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode93
gemini-cli92
codex91
cursor89
github-copilot87
amp79
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
67,500 周安装
| DONE |
--max-sessions N | Stop after N sessions | Unlimited |
--max-budget N.NN | Per-session dollar budget | 5.00 |
--model <model> | Model alias or full name | sonnet |
--fallback-model <m> | Fallback if primary overloaded | — |
--effort <level> | Thinking effort (low/medium/high) | high |
--no-auto-continue | Run one session only | — |
--permission-mode <m> | Permission mode | auto |
--add-dir <dirs> | Extra directories to allow | — |
--model sonnet