# Harness Loop

Long-running task loop using /loop (Claude Code dynamic mode) and ScheduleWakeup to...

- Repository: https://github.com/Chachamaru127/claude-code-harness (3190 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Chachamaru127/claude-code-harness --skill harness-loop -g -a claude-code -y`
Codex: `npx skills add Chachamaru127/claude-code-harness --skill harness-loop -g -a codex -y`
Cursor: `npx skills add Chachamaru127/claude-code-harness --skill harness-loop -g -a cursor -y`
Gemini CLI: `npx skills add Chachamaru127/claude-code-harness --skill harness-loop -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Chachamaru127/claude-code-harness`

## Description

Long-running task loop using /loop (Claude Code dynamic mode) and ScheduleWakeup to re-enter with fresh context on each wake-up. Internally invokes harness-work through Agent. Trigger: long-running, loop, wake-up, autonomous. Do NOT load for: one-shot task execution, review, release, planning.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# harness-loop

`/loop`（CC dynamic mode）と `ScheduleWakeup` を組み合わせ、
長時間タスクを **wake-up 毎に fresh context で再入実行** するメタスキル。

各 wake-up で `harness-work --breezing` を Agent 経由で呼び出し、
1 サイクル = 1 タスク完結の再入可能ループを構成する。

> **Long-session helpers (CC 2.1.108+)**:
> 人が戻ってきたら `/recap` で要約を取り直してから `/harness-loop status` を見る。
> 長めの離席や再入が多い運用では `ENABLE_PROMPT_CACHING_1H=1` を優先する。

> **長時間セッション推奨 (CC 2.1.108+)**:
> セッション長が 30 分を超える見込みの場合、plugin bundle root 解決後に `bash "${HARNESS_PLUGIN_ROOT}/scripts/enable-1h-cache.sh"` を実行して 1 時間 prompt cache を opt-in すること。

> **Codex 0.123.0 automatic bug fix inheritance**:
> manual shell follow-up queue と `/copy` after rollback は Codex 本体の TUI 修正として自動継承する。
> loop runner は追加入力 queue、copy wrapper、rollback workaround を追加しない。
> 長時間作業中に manual shell へ follow-up を投げた時の queueing は Codex runtime に任せる。

## Quick Reference

| 入力 | 動作 |
|------|------|
| `/harness-loop all` | 全未完了タスクをループ実行（default: max 8 サイクル） |
| `/harness-loop all --max-cycles 3` | 3 サイクルで停止 |
| `/harness-loop 41.1-41.3 --pacing ci` | タスク範囲を CI pacing で実行 |
| `/harness-loop all --plan roadmap` | named Plans の `roadmap` を対象にループ実行 |
| `/harness-loop all --pacing night` | 深夜バッチ（3600s 間隔） |
| `/harness-loop status` | 進行中ランナーの状態確認 |
| `/harness-loop stop` | 進行中ランナーの停止要求 |

## オプション

| オプション | 説明 | デフォルト |
|----------|------|----------|
| `all` | 全未完了タスクを対象 | - |
| `N-M` | タスク番号範囲指定 | - |
| `--plan NAME` | `plans/manifest.json` の named plan を使う | active/default |
| `--max-cycles N` | 最大サイクル数 | `8` |
| `--pacing <mode>` | wake-up 間隔モード | `worker`（270s） |

### pacing 値マッピング

| pacing | delaySeconds | 用途 |
|--------|-------------|------|
| `worker` | 270 | Worker 完了直後（5 min 以内で cache warm） |
| `ci` | 270 | CI 短時間ジョブ待ち |
| `plateau` | 1200 | 20 min（plateau 検知後の再試行間隔） |
| `night` | 3600 | 深夜の長時間放置 |

> **制約**: `ScheduleWakeup` の `delaySeconds` はランタイムで **[60, 3600]** に clamp される。
> `worker` / `ci` の 270s および `night` の 3600s はこの範囲内。
> `plateau` の 1200s も範囲内。値を直接指定する場合は必ず 60 以上 3600 以下にすること。

The rest: https://github.com/Chachamaru127/claude-code-harness/blob/HEAD/opencode/skills/harness-loop/SKILL.md
