← 返回 Skills 市场
feiskyer

Autonomous Skill

作者 Pengfei Ni · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
488
总下载
1
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install autonomous-skill
功能描述
Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition...
使用说明 (SKILL.md)

Autonomous Skill - Multi-Session Task Execution

Execute complex tasks across multiple Claude Code sessions with automatic continuation, progress tracking, and two completion mechanisms (promise tags + checkbox counting).

Two Execution Modes

Headless Mode (default)

Spawns claude -p child sessions in a bash loop. Best for background/unattended work.

bash \x3Cskill-dir>/scripts/run-session.sh "Build a REST API" --max-sessions 10

Hook Mode (in-session)

Uses a Stop hook to intercept session exit and feed the prompt back. Runs inside the current interactive session — no nesting issues.

bash \x3Cskill-dir>/scripts/setup-loop.sh "Build a REST API" --max-iterations 10

Two Task Strategies

Structured (default)

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 \x3Cskill-dir>/scripts/run-session.sh "Build a REST API for todo app"

Lightweight (--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 \x3Cskill-dir>/scripts/run-session.sh "Fix all failing tests in src/" --lightweight

Completion Detection

Two complementary mechanisms — whichever triggers first wins:

  1. Promise tags (both modes): The agent outputs \x3Cpromise>DONE\x3C/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.

  2. Checkbox counting (structured mode only): All [ ] items in task_list.md are marked [x].

Directory Layout

project-root/
├── .autonomous/
│   └── \x3Ctask-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)

Headless Mode — CLI Reference

bash \x3Cskill-dir>/scripts/run-session.sh "task description" [OPTIONS]
Flag Description Default
--lightweight Ralph-style iteration (no task decomposition) structured
--task-name \x3Cname> 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 DONE
--max-sessions N Stop after N sessions Unlimited
--max-budget N.NN Per-session dollar budget 5.00
--model \x3Cmodel> Model alias or full name sonnet
--fallback-model \x3Cm> Fallback if primary overloaded
--effort \x3Clevel> Thinking effort (low/medium/high) high
--no-auto-continue Run one session only
--permission-mode \x3Cm> Permission mode auto
--add-dir \x3Cdirs> Extra directories to allow

Hook Mode — Setup

For in-session loops (no child process spawning):

bash \x3Cskill-dir>/scripts/setup-loop.sh "task description" [OPTIONS]
Flag Description Default
--mode structured|lightweight Task strategy structured
--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

Workflow Detail

Structured Mode

  1. Initializer Agent — analyzes task, creates phased task_list.md, begins work
  2. Executor Agent — reads task list + progress, verifies previous work, completes next task
  3. Auto-Continue — checks promise tags + checkboxes; if not done, spawns next session

Lightweight Mode

  1. Same prompt fed each iteration
  2. Agent sees its previous work in files and git history
  3. Iterates until work is complete and promise tag is output
  4. No task_list.md — completion is purely promise-based

When to Use Which

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

Important Constraints

  1. task_list.md is append-only for completions: Only change [ ][x]
  2. One runner per task: Lock file prevents concurrent sessions on same task
  3. Project files stay in project root: .autonomous/ is only for tracking
  4. Promise integrity: The agent must not output \x3Cpromise>DONE\x3C/promise> until genuinely complete
  5. Cost awareness: Default per-session budget is $5. Adjust with --max-budget

Troubleshooting

Issue Solution
"Lock file exists" Previous run crashed. Remove .autonomous/\x3Ctask>/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 --model sonnet
安全使用建议
This package implements autonomous background loops for Claude Code and will create .autonomous/ and .claude/autonomous-loop.local.md in your project. Before using it: (1) inspect run-session.sh, setup-loop.sh and stop-hook.sh yourself (they will run locally and can execute arbitrary commands in your repo); (2) be aware the scripts expect a working 'claude' CLI and Unix utilities (jq, perl, awk, grep, sed) even though the registry metadata doesn't list them; (3) note the default permission-mode is set to 'bypassPermissions' and the scripts unset CLAUDECODE to allow nested sessions — these defaults can bypass protections, so change them if you want stricter behaviour; (4) run the skill only in non-sensitive repositories or isolated environments (or inside a disposable VM/container) until you're confident it behaves as you expect; (5) to cancel an in-session loop, delete .claude/autonomous-loop.local.md and to stop headless runs remove run.lock or stop the spawned processes. If you want to install, request the maintainer update the metadata to list required binaries and clarify permission defaults.
功能分析
Type: OpenClaw Skill Name: autonomous-skill Version: 1.0.3 The skill provides a framework for autonomous, multi-session task execution by Claude Code. It employs high-risk capabilities to achieve this, including defaulting to 'bypassPermissions' in 'scripts/run-session.sh' (allowing unattended command execution) and explicitly unsetting the 'CLAUDECODE' environment variable to bypass safety restrictions against nested sessions. It also implements a persistent loop mechanism using a 'Stop' hook ('hooks/stop-hook.sh') that intercepts session exits to feed prompts back to the agent. While the code appears well-structured and includes some security measures like path traversal validation in 'validate_task_name', the combination of bypassed safety controls and broad execution permissions fits the criteria for risky capabilities without clear malicious intent.
能力评估
Purpose & Capability
Name and description match the code: scripts and templates implement headless and hook-based multi-session loops for Claude Code. However the registry metadata claims no required binaries or env vars while the scripts clearly expect a working 'claude' CLI and use common unix tools (jq, perl, awk, grep, sed). That mismatch between claimed requirements and actual needs is inconsistent and should be corrected.
Instruction Scope
Runtime instructions and templates direct the agent to run builds/tests, read git history, modify project files, and create/modify .autonomous/ and .claude/ state files. The Stop hook inspects session transcripts and can block exit to re-feed prompts. That behaviour is consistent with the stated purpose but gives the skill broad filesystem and command-execution scope within the project directory and can create unbounded background activity if misconfigured.
Install Mechanism
No external install or downloads are performed; this is an instruction-and-script-only skill (no remote installers). That reduces supply-chain risk. Scripts will create files under the project root ( .autonomous/ and .claude/ ) which is expected by the SKILL.md.
Credentials
The skill declares no required credentials, which matches the absence of explicit API keys; however it relies on the local 'claude' CLI and uses options like default permission-mode 'bypassPermissions' and unsets CLAUDECODE to allow nested sessions. These defaults can weaken safety constraints enforced by the hosting environment and effectively ask the runtime to run Claude with elevated/relaxed permissions. The scripts also read CLAUDE_PLUGIN_ROOT when present. Overall, the credential exposure risk is indirect (it uses whatever local claude session/auth is available) rather than via explicit env var requests.
Persistence & Privilege
The skill does not set always:true and is user-invocable (normal). It persists state in .autonomous/ and .claude/autonomous-loop.local.md in the project directory; it does not modify other skills' configs. The Stop hook will actively intercept session exits when the state file exists, which gives the skill runtime persistence and control of session flow while active — this is intended but increases its operational blast radius.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install autonomous-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /autonomous-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
**Major update: Adds dual execution modes (headless bash and in-session hook), lightweight task support, explicit CLI, and more robust progress/completion tracking.** - Introduces both Headless (background bash loop) and Hook (in-session) execution modes - Supports two strategies: Structured decomposition with explicit task lists, and lightweight "Ralph-style" iteration - Adds new scripts and hooks for loop setup and stop handling - Enhances completion detection: supports both promise tags (e.g., `<promise>DONE</promise>`) and checkbox counting - Improves task isolation, progress logging, and concurrent run prevention (lock files) - Expands CLI options for task management, session control, and budget/model selection
v0.1.0
Initial release of autonomous-skill for multi-session long-running task management. - Enables execution of complex, multi-stage tasks across sessions with autonomous progress tracking. - Uses a dual-agent model (Initializer and Executor) to decompose tasks and drive progress. - Stores per-task data in `.autonomous/<task-name>/` for isolation and easy management. - Supports automatic continuation, reporting, and clear directory/task structure. - Triggered by phrases including "autonomous", "long-running task", and equivalents in Chinese.
元数据
Slug autonomous-skill
版本 1.0.3
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Autonomous Skill 是什么?

Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 488 次。

如何安装 Autonomous Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install autonomous-skill」即可一键安装,无需额外配置。

Autonomous Skill 是免费的吗?

是的,Autonomous Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Autonomous Skill 支持哪些平台?

Autonomous Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Autonomous Skill?

由 Pengfei Ni(@feiskyer)开发并维护,当前版本 v1.0.3。

💬 留言讨论