← Back to Skills Marketplace
feiskyer

Autonomous Skill

by Pengfei Ni · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
488
Downloads
1
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install autonomous-skill
Description
Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install autonomous-skill
  3. After installation, invoke the skill by name or use /autonomous-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug autonomous-skill
Version 1.0.3
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Autonomous Skill?

Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition... It is an AI Agent Skill for Claude Code / OpenClaw, with 488 downloads so far.

How do I install Autonomous Skill?

Run "/install autonomous-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Autonomous Skill free?

Yes, Autonomous Skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Autonomous Skill support?

Autonomous Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Autonomous Skill?

It is built and maintained by Pengfei Ni (@feiskyer); the current version is v1.0.3.

💬 Comments