Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计提醒

autonomous-opus-loop自主作业循环

Agent Skill

autonomous-opus-loop 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

461

周安装

19

GitHub Stars

9

下载量

150
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:autonomous-opus-loop(自主作业循环)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/autonomous-opus-loop
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill autonomous-opus-loop
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill autonomous-opus-loop

简介

利用外部 Opus 4.5 实例实现 Claude Code 完全自主运行的协作框架。

  • 适合需要突破单次交互限制完成复杂项目的场景。
  • 通过双 Claude 实例协作实现持续进度分析和决策制定。
  • Stop hook 的 reason 字段成为下一轮指令的核心创新机制。
  • 使用前应确保外部 Opus 实例可用且网络连接稳定可靠。

SKILL.md

Autonomous Opus Loop

Transform Claude Code from interactive to fully autonomous using an external Opus 4.5 instance to analyze progress and decide continuation.

Overview

This skill enables Claude Code to run autonomously by using another Claude instance (Opus 4.5) to:

  • Analyze work progress after each response
  • Decide whether to continue or stop
  • Provide specific next-step instructions
  • Maintain momentum until objectives are achieved

Key Innovation: The Stop hook's reason field becomes Claude's next instruction, creating a fully autonomous loop where two Claude instances collaborate.

Architecture

┌─────────────────────────────────────┐
│  Claude Code (Executor)             │
│  - Executes tasks                   │
│  - Writes code, runs tests          │
│  - Triggers Stop hook when done     │
└─────────────────┬───────────────────┘
                  │
                  ▼ (Stop hook fires)
        ┌─────────────────────────────┐
        │  autonomous-loop.sh         │
        │  - Reads transcript         │
        │  - Checks safety limits     │
        │  - Calls Opus analyzer      │
        └──────────┬──────────────────┘
                   │
                   ▼
   ┌───────────────────────────────────┐
   │  Claude Opus 4.5 (Analyzer)       │
   │  - Reviews all work done          │
   │  - Checks against objectives      │
   │  - Decides: CONTINUE or COMPLETE  │
   │  - If CONTINUE: specific next task│
   └──────────┬────────────────────────┘
              │
              ▼
        ┌─────────────────────────────┐
        │  Loop Controller            │
        │  - Tracks iterations        │
        │  - Monitors cost            │
        │  - Prevents doom loops      │
        │  - Returns decision to CC   │
        └──────────┬──────────────────┘
                   │
                   ▼
    Claude Code receives "reason" as next instruction
            (loop repeats until COMPLETE)

Quick Start

1. Install the Hook

# Run the installation script
.claude/skills/autonomous-opus-loop/scripts/install.sh

Or manually add to .claude/settings.json:

{
  "hooks": {
    "Stop": [{
      "matcher": {},
      "hooks": [{
        "type": "command",
        "command": ".claude/skills/autonomous-opus-loop/scripts/autonomous-loop.sh"
      }],
      "timeout": 120
    }]
  }
}

2. Configure Your Objective

Create .claude/autonomous-config.json:

{
  "enabled": true,
  "objective": "Implement user authentication with JWT tokens",
  "success_criteria": [
    "All tests pass",
    "Code coverage > 80%",
    "No security vulnerabilities"
  ],
  "max_iterations": 30,
  "max_cost_usd": 15.00,
  "analyzer_model": "claude-sonnet-4-20250514",
  "verbose": true
}

3. Start Claude Code

# Start with initial task
claude -p "Begin implementing user authentication per the objective in .claude/autonomous-config.json"

Claude Code will now run autonomously until:

  • All success criteria are met
  • Max iterations reached
  • Cost limit exceeded
  • You manually interrupt (Ctrl+C)

Configuration Reference

Required Settings

SettingTypeDescription
enabledbooleanEnable/disable autonomous mode
objectivestringHigh-level goal to achieve
success_criteriastring[]Conditions that define "done"

Safety Limits

SettingTypeDefaultDescription
max_iterationsnumber50Maximum loop iterations
max_cost_usdnumber20.00Maximum estimated cost
max_consecutive_failuresnumber3Failures before escalation
max_runtime_minutesnumber4808-hour maximum runtime

Analyzer Settings

SettingTypeDefaultDescription
analyzer_modelstringclaude-sonnet-4-20250514Model for analysis
analyzer_max_tokensnumber1024Max tokens for analysis
include_full_transcriptbooleanfalseSend full vs. recent context
recent_messages_countnumber10Messages to include if not full

Behavior Settings

SettingTypeDefaultDescription
verbosebooleanfalseLog detailed progress
notify_on_completebooleantrueSystem notification on completion
save_session_logbooleantrueSave iteration history
escalation_modestring"pause"Action on escalation: pause/notify/abort

Operations

1. Enable Autonomous Mode

# Enable with default config
.claude/skills/autonomous-opus-loop/scripts/enable.sh

# Enable with specific objective
.claude/skills/autonomous-opus-loop/scripts/enable.sh \
  --objective "Refactor the payment module" \
  --max-iterations 20

2. Disable Autonomous Mode

.claude/skills/autonomous-opus-loop/scripts/disable.sh

3. Check Status

.claude/skills/autonomous-opus-loop/scripts/status.sh

Output:

Autonomous Loop Status
======================
Enabled: true
Objective: Implement user authentication with JWT tokens
Iterations: 12/30
Estimated Cost: $4.23/$15.00
Runtime: 45m/480m
Last Action: Implemented login endpoint
Next Action: Add password reset functionality
Status: RUNNING

4. View Session Log

.claude/skills/autonomous-opus-loop/scripts/view-log.sh

5. Emergency Stop

.claude/skills/autonomous-opus-loop/scripts/emergency-stop.sh

Safety Features

1. Doom Loop Prevention

The hook checks stop_hook_active flag to prevent infinite recursion:

if [ "$STOP_ACTIVE" == "true" ]; then
  # Already in a stop hook - allow termination
  exit 0
fi

2. Iteration Limits

Hard cap on iterations prevents runaway execution:

if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
  log "Max iterations ($MAX_ITERATIONS) reached"
  exit 0  # Allow stop
fi

3. Cost Tracking

Estimated cost monitoring based on token usage:

if (( $(echo "$TOTAL_COST > $MAX_COST" | bc -l) )); then
  log "Cost limit ($MAX_COST USD) exceeded"
  exit 0  # Allow stop
fi

4. Failure Detection

Consecutive failure tracking triggers escalation:

if [ "$CONSECUTIVE_FAILURES" -ge "$MAX_FAILURES" ]; then
  escalate "Doom loop detected: $CONSECUTIVE_FAILURES consecutive failures"
fi

5. Circular Work Detection

Semantic analysis detects repeated work patterns:

# Analyzer prompt includes:
"Detect if the same work is being repeated. If circular pattern detected, respond with ESCALATE."

Analyzer Prompts

Default Analyzer System Prompt

You are an autonomous development coordinator analyzing Claude Code progress.

OBJECTIVE: {objective}

SUCCESS CRITERIA:
{success_criteria}

Your task:
1. Analyze the recent work done
2. Check progress against success criteria
3. Decide: CONTINUE, COMPLETE, or ESCALATE

Response format:
- If more work needed: "CONTINUE: [specific next task with clear instructions]"
- If all criteria met: "COMPLETE: [summary of what was achieved]"
- If stuck/looping: "ESCALATE: [description of the problem]"

Be specific in CONTINUE responses. Give actionable next steps.
Do not repeat tasks that have already been completed.
Track what's done vs. what remains.

Custom Analyzer Prompts

Create custom prompts in .claude/autonomous-prompts/:

.claude/autonomous-prompts/
├── refactoring.txt      # For refactoring tasks
├── feature-build.txt    # For new features
├── bug-fix.txt          # For bug fixing
└── testing.txt          # For test writing

Reference in config:

{
  "analyzer_prompt_file": ".claude/autonomous-prompts/feature-build.txt"
}

Integration with Other Skills

With hooks-manager

The autonomous loop works alongside other hooks:

{
  "hooks": {
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": ".claude/skills/autonomous-opus-loop/scripts/autonomous-loop.sh"
      }]
    }],
    "PostToolUse": [{
      "tools": ["Write", "Edit"],
      "hooks": [{
        "type": "command",
        "command": "npx prettier --write \"$FILE\""
      }]
    }]
  }
}

With agent-memory-system

Enable persistent learning across autonomous sessions:

{
  "integrations": {
    "agent_memory": true,
    "save_episodes": true,
    "learn_patterns": true
  }
}

With momentum-keeper

Combine for enhanced progress tracking:

{
  "integrations": {
    "momentum_keeper": true,
    "stall_detection": true,
    "energy_management": false
  }
}

With observability stack

Send metrics to your observability stack:

{
  "observability": {
    "enabled": true,
    "endpoint": "http://localhost:4317",
    "metrics": ["iterations", "cost", "duration", "success_rate"]
  }
}

Example Configurations

Overnight Feature Development

{
  "enabled": true,
  "objective": "Build complete user dashboard with charts, filters, and export",
  "success_criteria": [
    "Dashboard component renders without errors",
    "All 5 chart types implemented",
    "Filter functionality works",
    "Export to CSV and PDF works",
    "Unit tests pass with >80% coverage",
    "E2E tests pass"
  ],
  "max_iterations": 100,
  "max_cost_usd": 50.00,
  "max_runtime_minutes": 480,
  "analyzer_model": "claude-sonnet-4-20250514",
  "notify_on_complete": true,
  "escalation_mode": "notify"
}

Quick Refactoring Task

{
  "enabled": true,
  "objective": "Refactor utils/ to use TypeScript strict mode",
  "success_criteria": [
    "All files converted to .ts",
    "No 'any' types remain",
    "TypeScript compiles without errors",
    "All existing tests pass"
  ],
  "max_iterations": 20,
  "max_cost_usd": 10.00,
  "analyzer_model": "claude-sonnet-4-20250514"
}

Bug Hunting Session

{
  "enabled": true,
  "objective": "Find and fix the memory leak in the WebSocket handler",
  "success_criteria": [
    "Memory leak identified",
    "Root cause documented",
    "Fix implemented",
    "Memory usage stable over 1000 connections",
    "No regression in existing tests"
  ],
  "max_iterations": 30,
  "max_cost_usd": 15.00,
  "analyzer_prompt_file": ".claude/autonomous-prompts/bug-fix.txt"
}

Troubleshooting

Hook Not Firing

  1. Check hook is installed: cat.claude/settings.json | jq '.hooks.Stop'
  2. Verify script is executable: chmod +x.claude/skills/autonomous-opus-loop/scripts/*.sh
  3. Check for syntax errors: bash -n.claude/skills/autonomous-opus-loop/scripts/autonomous-loop.sh

Immediate Stop (Not Continuing)

  1. Check enabled is true in config
  2. Verify API key is set: echo $ANTHROPIC_API_KEY
  3. Check iteration/cost limits aren't exceeded
  4. Review logs: .claude/autonomous-log.jsonl

Infinite Loop / Runaway

  1. Emergency stop: Ctrl+C or run emergency-stop.sh
  2. Check stop_hook_active handling in script
  3. Verify max_iterations is reasonable
  4. Check for doom loop detection in logs

API Errors

  1. Verify API key: echo $ANTHROPIC_API_KEY | head -c 10
  2. Check model availability
  3. Review error in .claude/autonomous-log.jsonl
  4. Try with verbose: true for detailed output

Session Logs

All autonomous sessions are logged to .claude/autonomous-log.jsonl:

{"timestamp": "2024-01-15T10:30:00Z", "iteration": 1, "action": "START", "objective": "..."}
{"timestamp": "2024-01-15T10:31:00Z", "iteration": 1, "action": "CONTINUE", "task": "..."}
{"timestamp": "2024-01-15T10:35:00Z", "iteration": 2, "action": "CONTINUE", "task": "..."}
{"timestamp": "2024-01-15T11:00:00Z", "iteration": 15, "action": "COMPLETE", "summary": "..."}

View formatted:

.claude/skills/autonomous-opus-loop/scripts/view-log.sh --format pretty

Best Practices

1. Clear Objectives

Bad: "Make the code better" Good: "Refactor auth module to use dependency injection, add unit tests for all public methods"

2. Measurable Success Criteria

Bad: "Code should be clean" Good: "ESLint passes with no warnings, all functions have JSDoc comments"

3. Reasonable Limits

  • Start with lower iteration limits (20-30)
  • Increase based on task complexity
  • Set cost limits slightly above expected

4. Monitor First Runs

  • Use verbose: true initially
  • Watch the first few iterations
  • Adjust prompts based on behavior

5. Use Appropriate Models

  • claude-sonnet-4-20250514: Good balance of speed/quality (recommended)
  • claude-opus-4-5-20250929: Better analysis, higher cost
  • claude-3-5-haiku-20241022: Fast/cheap for simple tasks

Cost Estimation

Approximate costs per iteration (analyzer call):

ModelInput (10k tokens)Output (1k tokens)Total
Sonnet 4$0.03$0.015~$0.045
Opus 4.5$0.15$0.075~$0.225
Haiku 3.5$0.008$0.004~$0.012

Example: 30 iterations with Sonnet = ~$1.35 for analyzer alone (Plus Claude Code usage costs)

References

  • references/hook-mechanics.md - Deep dive into Stop hook behavior
  • references/analyzer-prompts.md - Prompt engineering for analyzers
  • references/safety-patterns.md - Comprehensive safety documentation
  • references/integration-guide.md - Integrating with other skills

Scripts

  • scripts/autonomous-loop.sh - Main Stop hook handler
  • scripts/opus-analyzer.py - Python analyzer (alternative)
  • scripts/install.sh - Install hooks to settings
  • scripts/enable.sh - Enable autonomous mode
  • scripts/disable.sh - Disable autonomous mode
  • scripts/status.sh - Check current status
  • scripts/view-log.sh - View session logs
  • scripts/emergency-stop.sh - Emergency termination

Version History

  • v1.0.0 (2024-01): Initial release with Stop hook support
  • Supports bash and Python analyzers
  • Integration with observability stack
  • Comprehensive safety features

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

github-copilot

26.41%
按下载量换算40

Claude Code

25.1%
按下载量换算38

mcpjam

16.33%
按下载量换算24

moltbot

13.75%
按下载量换算21

windsurf

7.01%
按下载量换算11

zencoder

3.18%
按下载量换算5

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills