[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81069":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},81069,"opencode-loop","ByBrawe\u002Fopencode-loop","ByBrawe","Claude Code style auto-continue for OpenCode.","",null,"JavaScript",52,4,45,0,5,7,15,56.3,"MIT License",false,"main",true,[],"2026-06-12 04:01:31","# OpenCode Loop\n\n**Claude Code style auto-continue for OpenCode.**\n\nOpenCode Loop adds a practical `\u002Floop` command and `opencode-loopd` daemon to OpenCode so an agent can keep working after each idle turn instead of waiting for you to type “continue” again.\n\nIt is useful for long coding sessions, `progress.md` workflows, TODO automation, test-fix loops, periodic `\u002Fcompact`, checkpoints, safe autonomous development, and background OpenCode continuation jobs.\n\nRepository: **ByBrawe\u002Fopencode-loop**  \nNPM package name: **@bybrawe\u002Fopencode-loop**\n\n## Why this exists\n\nClaude Code users often rely on a loop-like workflow where the agent finishes one step, then immediately continues with the next step.\n\nOpenCode is powerful, but long-running autonomous workflows usually need extra control around:\n\n- auto-continue after idle\n- compact \u002F summarize scheduling\n- `progress.md` and TODO-driven development\n- test verification after each turn\n- patch checkpoints\n- maximum runtime limits\n- failure limits\n- background daemon execution\n- Windows Task Scheduler support\n- safety prompts and destructive command guards\n\nOpenCode Loop is designed for developers searching for:\n\n- OpenCode loop\n- OpenCode Claude Code loop\n- OpenCode auto continue\n- OpenCode continue automatically\n- OpenCode `\u002Floop` command\n- OpenCode compact scheduler\n- OpenCode Ralph loop alternative\n- Claude Code style loop for OpenCode\n- autonomous coding loop for OpenCode\n- progress.md TODO automation for OpenCode\n- OpenCode background daemon\n- OpenCode loop daemon\n- OpenCode Windows Task Scheduler loop\n\n## Features\n\n> The TUI `\u002Floop` command is session-bound. It runs while OpenCode is open and the session receives idle\u002Fstatus events. If the terminal closes, the machine sleeps, the process is killed, or the provider connection is lost for a long time, the TUI loop cannot continue in the background. For long-running loops, use `opencode-loopd` daemon mode.\n\n- **Claude Code style auto-continue** with `\u002Floop 0s ...`.\n- **TUI loop mode** with `\u002Floop`, active while OpenCode is open.\n- **Background daemon mode** with `opencode-loopd` for long-running loops outside the OpenCode TUI.\n- **Windows Task Scheduler helper** with `opencode-loopd install-task`.\n- **One-shot scheduled runs** for periodic continuation jobs.\n- **Interval loops** for prompts, slash commands, and shell commands.\n- **Prompt-file support** with `--prompt-file loop-prompt.md` for long reusable instructions.\n- **Prompt-file daemon support** with `opencode-loopd --prompt-file loop-prompt.md`.\n- **Include extra context files** with `--include-file`.\n- **progress.md workflow** with `--progress-file progress.md`.\n- **Large TODO support** with `--batch`.\n- **Compact scheduling** with `\u002Floop 200m \u002Fcompact` or `--compact-every`.\n- **Verification loops** with `--verify \"npm test\"`.\n- **Preflight checks** with `--preflight \"npm install\"`.\n- **Post-run commands** with `--postrun`.\n- **Failure control** with `--max-failures` and `--pause-on-verify-fail`.\n- **Runtime control** with `--max-runtime 6h`.\n- **Run limit support** with `--max-runs`.\n- **Sleep-before-first-run support** with `--sleep-first`.\n- **Checkpoints** with `--checkpoint-only` or `--git-checkpoint`.\n- **Safe mode** with `--safe` and prompt-level destructive command warnings.\n- **Branch setup** with `--branch ai-loop`.\n- **Stop controls** with `--stop-file STOP_LOOP`, `--until`, `\u002Floop-stop`, `\u002Floop-pause`, `\u002Floop-resume`, and `\u002Floop-remove`.\n- **Watch mode** with `--watch progress.md`.\n- **Diagnostics** with `\u002Floop-doctor`.\n- **Starter progress file** with `\u002Floop-init`.\n- **State export** with `\u002Floop-export`.\n\n## Installation\n\n### Recommended: install from npm\n\nInstall from npm with `npx`:\n\n```bash\nnpx -y @bybrawe\u002Fopencode-loop\n```\n\nOn Windows CMD:\n\n```bat\nnpx -y @bybrawe\u002Fopencode-loop\n```\n\nOn Windows PowerShell:\n\n```powershell\nnpx -y @bybrawe\u002Fopencode-loop\n```\n\nThe installer copies the plugin and slash command files into your OpenCode config directory.\n\nWindows target paths:\n\n```text\n%USERPROFILE%\\.config\\opencode\\plugins\\opencode-loop.js\n%USERPROFILE%\\.config\\opencode\\commands\\loop*.md\n```\n\nmacOS \u002F Linux target paths:\n\n```text\n~\u002F.config\u002Fopencode\u002Fplugins\u002Fopencode-loop.js\n~\u002F.config\u002Fopencode\u002Fcommands\u002Floop*.md\n```\n\nThen fully restart OpenCode and run:\n\n```text\n\u002Floop-help\n\u002Floop-doctor\n```\n\nThe npm package also installs the `opencode-loopd` CLI for background loops:\n\n```bash\nopencode-loopd --help\n```\n\n### Why `npx` is the recommended npm install\n\nOpenCode can load npm plugins from the `plugin` array in `opencode.json`, but OpenCode slash commands are discovered from command definitions such as markdown files in a `commands\u002F` directory or command entries in config.\n\nThe `npx` installer installs both parts:\n\n- the OpenCode plugin file\n- the `\u002Floop-*` command markdown files\n\nUse the OpenCode config-only method only if you already installed the command files separately or you are only testing plugin loading.\n\n### Optional: OpenCode config package entry\n\nIf you want OpenCode to load the npm plugin package directly, add the scoped package name to your OpenCode config:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fopencode.ai\u002Fconfig.json\",\n  \"plugin\": [\"@bybrawe\u002Fopencode-loop\"]\n}\n```\n\nUse the scoped package name exactly as shown.\n\n`opencode-loop` without `@bybrawe\u002F` is a different npm package name.\n\nIf `\u002Floop` does not appear after using only the config method, run the installer once:\n\n```bash\nnpx -y @bybrawe\u002Fopencode-loop\n```\n\n### Install from GitHub\n\nUse this if you want to install from source instead of npm.\n\nWindows PowerShell:\n\n```powershell\ngit clone https:\u002F\u002Fgithub.com\u002FByBrawe\u002Fopencode-loop.git\ncd opencode-loop\npowershell -ExecutionPolicy Bypass -File .\\scripts\\install.ps1\n```\n\nmacOS \u002F Linux \u002F Git Bash:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FByBrawe\u002Fopencode-loop.git\ncd opencode-loop\nchmod +x .\u002Fscripts\u002Finstall.sh\n.\u002Fscripts\u002Finstall.sh\n```\n\nThen restart OpenCode and run:\n\n```text\n\u002Floop-help\n\u002Floop-doctor\n```\n\n### Manual global install\n\nWindows PowerShell:\n\n```powershell\nmkdir \"$env:USERPROFILE\\.config\\opencode\\plugins\" -Force\nmkdir \"$env:USERPROFILE\\.config\\opencode\\commands\" -Force\ncopy .\\src\\index.js \"$env:USERPROFILE\\.config\\opencode\\plugins\\opencode-loop.js\"\ncopy .\\commands\\*.md \"$env:USERPROFILE\\.config\\opencode\\commands\\\"\n```\n\nmacOS \u002F Linux:\n\n```bash\nmkdir -p ~\u002F.config\u002Fopencode\u002Fplugins ~\u002F.config\u002Fopencode\u002Fcommands\ncp .\u002Fsrc\u002Findex.js ~\u002F.config\u002Fopencode\u002Fplugins\u002Fopencode-loop.js\ncp .\u002Fcommands\u002F*.md ~\u002F.config\u002Fopencode\u002Fcommands\u002F\n```\n\n### Project-local install\n\nUse this when you want the plugin to be available only inside one repository.\n\n```bash\nmkdir -p .opencode\u002Fplugins .opencode\u002Fcommands\ncp .\u002Fsrc\u002Findex.js .opencode\u002Fplugins\u002Fopencode-loop.js\ncp .\u002Fcommands\u002F*.md .opencode\u002Fcommands\u002F\n```\n\nOn Windows PowerShell:\n\n```powershell\nmkdir .opencode\\plugins -Force\nmkdir .opencode\\commands -Force\ncopy .\\src\\index.js .opencode\\plugins\\opencode-loop.js\ncopy .\\commands\\*.md .opencode\\commands\\\n```\n\n### Verify installation\n\nAfter restarting OpenCode, run:\n\n```text\n\u002Floop-help\n\u002Floop-doctor\n```\n\nIf the commands do not appear:\n\n1. Make sure OpenCode was fully restarted.\n2. Check that `opencode-loop.js` exists in the OpenCode plugin directory.\n3. Check that `loop.md`, `loop-help.md`, and the other command files exist in the OpenCode commands directory.\n4. Run `npx -y @bybrawe\u002Fopencode-loop` again to reinstall the command files.\n\n## Quick start\n\n```text\n\u002Floop 0s continue from progress.md and implement the next unfinished TODO\n```\n\nThis is the closest behavior to a Claude Code CLI style loop: every time OpenCode becomes idle, the loop can send the next continuation prompt.\n\nA safer development loop:\n\n```text\n\u002Floop 0s --name dev --ask-never --safe --no-overlap --batch 5 --compact-every 200m --checkpoint-only --progress-file progress.md Treat progress.md as the main project state file. Continue with the next unfinished TODO, implement it, mark completed items with [x], add useful follow-up TODOs when you discover them, run tests\u002Flint\u002Fbuild when available, and keep going while work remains.\n```\n\nPeriodic compact:\n\n```text\n\u002Floop 200m --name compact --no-now \u002Fcompact\n```\n\nTest-fix loop:\n\n```text\n\u002Floop 0s --name testfix --ask-never --safe --verify \"npm test\" Continue from progress.md. If tests fail, analyze the failure, fix it, and run the tests again.\n```\n\nShell command loop:\n\n```text\n\u002Floop 10m --name tests --safe !npm test\n```\n\n## Background daemon\n\nThe `\u002Floop` command is session-bound. It works while OpenCode is open and the current session emits idle\u002Fstatus events.\n\nIf you close OpenCode, restart the terminal, lose connection, or your PC sleeps, the TUI loop will not keep running.\n\nFor long-running loops, use the daemon:\n\n```bash\nopencode-loopd --project . --every 5m --prompt-file loop-prompt.md\n```\n\nRun immediately after each OpenCode turn:\n\n```bash\nopencode-loopd --project . --every 0s --prompt \"continue from progress.md and implement the next unfinished TODO\"\n```\n\nLimit runs:\n\n```bash\nopencode-loopd --project . --every 5m --max-runs 20 --prompt-file loop-prompt.md\n```\n\nWait before the first run:\n\n```bash\nopencode-loopd --project . --every 10m --sleep-first --prompt-file loop-prompt.md\n```\n\nUse an inline prompt:\n\n```bash\nopencode-loopd --project . --every 0s --prompt \"continue from progress.md and implement the next unfinished TODO\"\n```\n\nExample `loop-prompt.md`:\n\n```md\nContinue from progress.md and implement the next unfinished TODO.\n\nRules:\n- Do not ask questions.\n- Make reasonable assumptions.\n- Mark completed TODO items with [x].\n- Add useful follow-up TODOs when needed.\n- Run tests\u002Flint\u002Fbuild when available.\n- Do not run destructive commands such as git reset, git clean, rm -rf, force push, deploy, or production migrations.\n- Keep going while work remains.\n```\n\n## Windows Task Scheduler\n\nYou can create a Windows scheduled task that runs a one-shot daemon job every N minutes.\n\nInstall a scheduled task:\n\n```powershell\nopencode-loopd install-task --project \"C:\\path\\to\\project\" --every 10m --prompt-file loop-prompt.md --name OpenCodeLoop\n```\n\nRemove it:\n\n```powershell\nopencode-loopd uninstall-task --name OpenCodeLoop\n```\n\nCheck existing tasks:\n\n```powershell\nGet-ScheduledTask | Where-Object { $_.TaskName -like \"*OpenCode*\" }\n```\n\nFor active development, a visible terminal running daemon mode is usually easier to monitor:\n\n```powershell\nopencode-loopd --project \"C:\\path\\to\\project\" --every 0s --prompt-file loop-prompt.md\n```\n\n## Multiple loops and duplicate protection\n\nBy default, `\u002Floop ...` uses an upsert\u002Freplace behavior. Running `\u002Floop 5m ...` again replaces the existing default loop instead of creating duplicate jobs.\n\nUse `--name` to manage separate named loops, or `--multi` when you intentionally want multiple loops with the same shape:\n\n```text\n\u002Floop 5m --name dev continue from progress.md\n\u002Floop 200m --name compact \u002Fcompact\n\u002Floop 10m --multi !npm test\n```\n\n## Core commands\n\n| Command | Purpose |\n|---|---|\n| `\u002Floop \u003Cinterval> \u003Caction>` | Add an idle\u002Finterval loop job |\n| `\u002Floop-help` | Show usage help inside OpenCode |\n| `\u002Floop-status` | Show active loop jobs |\n| `\u002Floop-logs` | Show recent loop log entries |\n| `\u002Floop-now [id\u002Fname\u002Fnumber\u002Fall]` | Run loop job(s) immediately |\n| `\u002Floop-pause [id\u002Fname\u002Fnumber\u002Fall]` | Pause loop job(s) |\n| `\u002Floop-resume [id\u002Fname\u002Fnumber\u002Fall]` | Resume loop job(s) |\n| `\u002Floop-remove [id\u002Fname\u002Fnumber\u002Fall]` | Remove loop job(s) |\n| `\u002Floop-stop [id\u002Fname\u002Fnumber\u002Fall]` | Alias for remove\u002Fstop |\n| `\u002Floop-clear` | Remove all loop jobs for the current session |\n| `\u002Floop-doctor` | Diagnose plugin\u002Fsession state |\n| `\u002Floop-init [file]` | Create a starter `progress.md` or another progress file |\n| `\u002Floop-export` | Export current loop state as JSON |\n\n## Preset commands\n\n| Command | Purpose |\n|---|---|\n| `\u002Floop-dev 0s` | General autonomous OpenCode development loop |\n| `\u002Floop-progress 0s` | Follow `progress.md` and TODOs |\n| `\u002Floop-safe-dev 0s` | Safe dev loop with ask-never, batch 5, and patch checkpoints |\n| `\u002Floop-testfix 0s \"npm test\"` | Run, fix, and re-run tests |\n| `\u002Floop-compact 200m` | Compact loop shortcut |\n\n## Intervals\n\n```text\n0s     run whenever OpenCode becomes idle, like Claude Code auto-continue\n5m     run every 5 minutes when idle\n200m   run every 200 minutes when idle\n1h     run every hour when idle\n```\n\nThe plugin is **idle-driven**. It checks jobs when OpenCode becomes idle, so it avoids intentionally starting a second agent turn on top of an active one.\n\n## Actions\n\n### Prompt action\n\n```text\n\u002Floop 0s continue from progress.md. Work on the next unfinished TODO. Mark completed items with [x].\n```\n\n### Prompt file action\n\nUse this when the prompt is too long for a single command line:\n\n```text\n\u002Floop 0s --prompt-file loop-prompt.md\n```\n\nExample `loop-prompt.md`:\n\n```md\nContinue from progress.md.\nDo not ask questions unless truly blocked.\nMake reasonable assumptions and keep working.\nComplete TODOs in order and mark finished items with [x].\nAdd useful follow-up TODOs when you discover them.\nRun tests, lint, or build when available.\nDo not run destructive commands, force pushes, production deploys, or database resets.\n```\n\n### Include extra context files\n\n```text\n\u002Floop 0s --include-file ARCHITECTURE.md --include-file progress.md continue with the next implementation task\n```\n\n### Slash command action\n\n```text\n\u002Floop 200m \u002Fcompact\n\u002Floop 15m \u002Freview current changes\n```\n\n`\u002Fcompact` and `\u002Fsummarize` map to OpenCode session summarization.\n\n### Shell action\n\n```text\n\u002Floop 10m !npm test\n\u002Floop 30m $pnpm lint\n```\n\nShell actions starting with `!` or `$` run through the OpenCode shell tool.\n\n## Flags\n\n### `--name \u003Cname>`\n\nName a loop so you can manage it later.\n\n```text\n\u002Floop 0s --name dev continue from progress.md\n\u002Floop-pause dev\n\u002Floop-resume dev\n\u002Floop-stop dev\n```\n\n### `--max-runs \u003Cn>`\n\nStop after N runs.\n\n```text\n\u002Floop 5m --max-runs 20 continue from progress.md\n```\n\n### `--max-runtime \u003Cduration>`\n\nStop after total runtime from loop creation.\n\n```text\n\u002Floop 0s --max-runtime 6h continue from progress.md\n```\n\n### `--timeout \u003Cduration>`\n\nBest-effort abort after a single run timeout.\n\n```text\n\u002Floop 0s --timeout 30m continue from progress.md\n```\n\n### `--max-failures \u003Cn>`\n\nPause after repeated verify\u002Fpostrun failures.\n\n```text\n\u002Floop 0s --verify \"npm test\" --max-failures 3 continue from progress.md and fix test failures\n```\n\n### `--pause-on-verify-fail`\n\nPause immediately after the first verify failure.\n\n```text\n\u002Floop 0s --verify \"npm test\" --pause-on-verify-fail continue from progress.md\n```\n\n### `--until \u003Ctext>`\n\nStop when a marker appears in common state files such as `progress.md`, `TODO.md`, or `.opencode\u002Fopencode-loop\u002Funtil.txt`.\n\n```text\n\u002Floop 5m --until ALL_DONE continue from progress.md\n```\n\n### `--stop-file \u003Cfile>`\n\nStop when a file appears. This is a simple manual kill switch.\n\n```text\n\u002Floop 0s --stop-file STOP_LOOP continue from progress.md\n```\n\nCreate `STOP_LOOP` in the project root to stop that job.\n\n### `--no-overlap` and `--allow-overlap`\n\n`--no-overlap` is the default. It prevents a new run from being triggered while a previous run is still considered active.\n\n```text\n\u002Floop 5m --no-overlap continue from progress.md\n```\n\n### `--compact-every \u003Cn|duration>`\n\nCompact before a run every N runs or every duration.\n\n```text\n\u002Floop 0s --compact-every 20 continue from progress.md\n\u002Floop 0s --compact-every 200m continue from progress.md\n```\n\n### `--test \"\u003Ccommand>\"`\n\nAdds a test instruction to prompt actions.\n\n```text\n\u002Floop 0s --test \"npm test\" continue from progress.md\n```\n\n### `--verify \"\u003Ccommand>\"`\n\nRuns a real shell verification command after each assistant turn. If it fails, the next loop prompt includes the failure summary so the agent can fix it.\n\n```text\n\u002Floop 0s --verify \"npm test\" continue from progress.md and fix any failing tests\n```\n\n### `--preflight \"\u003Ccommand>\"`\n\nRuns a real shell command before each loop turn. If it fails, the loop pauses.\n\n```text\n\u002Floop 0s --preflight \"npm install\" continue from progress.md\n```\n\n### `--postrun \"\u003Ccommand>\"`\n\nRuns a shell command after each assistant turn and verification.\n\n```text\n\u002Floop 0s --postrun \"git status --short\" continue from progress.md\n```\n\n### `--notify \"\u003Ccommand>\"`\n\nRuns a shell command when a loop stops or pauses due to a control condition. The command can use `{job}` and `{reason}` placeholders.\n\n```text\n\u002Floop 0s --max-runtime 6h --notify \"echo {job} stopped because {reason}\" continue from progress.md\n```\n\n### `--checkpoint-only`\n\nSave `git status` and `git diff --binary` snapshots under:\n\n```text\n.opencode\u002Fopencode-loop\u002Fcheckpoints\u002F\u003Csession>\u002F\n```\n\n### `--git-checkpoint`\n\nSave a patch checkpoint and attempt to commit all changes after each completed run.\n\n```text\n\u002Floop 0s --git-checkpoint continue from progress.md\n```\n\nUse carefully. It runs `git add -A` and `git commit` when changes exist.\n\n### `--branch \u003Cname>`\n\nSwitch to a branch before the first run, or create it if it does not exist.\n\n```text\n\u002Floop 0s --branch ai-loop continue from progress.md\n```\n\n### `--safe`\n\nAdds safety instructions to prompt actions and blocks obviously destructive shell actions.\n\n```text\n\u002Floop 0s --safe continue from progress.md\n```\n\nSafe mode warns against or blocks patterns such as `git reset`, `git clean`, `rm -rf`, `git push`, `terraform destroy`, destructive delete commands, and production deploys.\n\n### `--batch \u003Cn>`\n\nTell the agent to process at most N TODO items per run.\n\n```text\n\u002Floop 0s --batch 5 continue from progress.md\n```\n\n### `--quiet`\n\nTell the agent to keep replies short.\n\n```text\n\u002Floop 0s --quiet continue from progress.md\n```\n\n### `--ask-never`\n\nTell the agent not to ask questions and to make reasonable assumptions.\n\n```text\n\u002Floop 0s --ask-never continue from progress.md\n```\n\n### `--progress-file \u003Cfile>`\n\nTell the agent which state file to treat as the main progress\u002FTODO source.\n\n```text\n\u002Floop 0s --progress-file progress.md continue from the progress file\n```\n\n### `--watch \u003Cfile>`\n\nRun when watched file metadata changes. This is still checked on idle events.\n\n```text\n\u002Floop --watch progress.md continue after progress.md changes\n\u002Floop 5m --watch progress.md continue when progress.md changes or the interval is due\n```\n\nYou can pass multiple `--watch` flags.\n\n### `--dry-run`\n\nParse and preview a loop without saving it.\n\n```text\n\u002Floop 0s --dry-run --ask-never continue from progress.md\n```\n\n### `--now` and `--no-now`\n\nBy default a new loop is due immediately. Use `--no-now` to wait for the first interval.\n\n```text\n\u002Floop 200m --no-now \u002Fcompact\n```\n\n## Recommended recipes\n\n### Claude Code style auto-continue loop\n\n```text\n\u002Floop 0s --name dev --ask-never --safe --no-overlap --batch 5 --compact-every 200m --checkpoint-only --progress-file progress.md Treat progress.md as the main project state file. Continue with the next unfinished TODO, implement it, mark completed items with [x], add useful follow-up TODOs when you discover them, run tests\u002Flint\u002Fbuild when available, and keep going while work remains.\n```\n\n### Long-running autonomous development loop\n\n```text\n\u002Floop 0s --name dev --ask-never --safe --no-overlap --compact-every 20 --timeout 45m --max-runtime 6h --max-failures 3 --stop-file STOP_LOOP --checkpoint-only Continue from progress.md. Do not ask questions. Make reasonable assumptions. Complete TODOs in order, mark finished items with [x], add useful new ideas to progress.md, and keep going while work remains.\n```\n\n### Daemon-based long-running development loop\n\n```bash\nopencode-loopd --project . --every 5m --prompt-file loop-prompt.md\n```\n\n### Test-fix loop\n\n```text\n\u002Floop 0s --name testfix --ask-never --safe --verify \"npm test\" --max-failures 3 Continue from progress.md. If tests fail, analyze the failure, fix it, and run the tests again.\n```\n\n### Compact loop\n\n```text\n\u002Floop 200m --name compact --no-now \u002Fcompact\n```\n\n### Prompt file loop\n\n```text\n\u002Floop 0s --name dev --prompt-file loop-prompt.md --checkpoint-only --max-runtime 6h\n```\n\n## Suggested OpenCode permission config\n\nFull `permission: \"allow\"` is convenient but risky. For safer long loops, keep destructive commands as ask\u002Fdeny.\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fopencode.ai\u002Fconfig.json\",\n  \"permission\": {\n    \"read\": \"allow\",\n    \"grep\": \"allow\",\n    \"glob\": \"allow\",\n    \"todowrite\": \"allow\",\n    \"edit\": \"allow\",\n    \"bash\": {\n      \"*\": \"ask\",\n      \"git status*\": \"allow\",\n      \"git diff*\": \"allow\",\n      \"npm test*\": \"allow\",\n      \"npm run test*\": \"allow\",\n      \"npm run lint*\": \"allow\",\n      \"pnpm test*\": \"allow\",\n      \"pnpm lint*\": \"allow\",\n      \"git push*\": \"ask\",\n      \"git reset*\": \"ask\",\n      \"git clean*\": \"deny\",\n      \"rm *\": \"deny\",\n      \"del *\": \"ask\",\n      \"rmdir *\": \"ask\"\n    },\n    \"external_directory\": \"ask\"\n  }\n}\n```\n\n## State files\n\nSession loop state is stored under:\n\n```text\n.opencode\u002Fopencode-loop\u002F\n```\n\nPatch checkpoints are stored under:\n\n```text\n.opencode\u002Fopencode-loop\u002Fcheckpoints\u002F\n```\n\nRecent plugin events are appended to:\n\n```text\n.opencode\u002Fopencode-loop\u002Floop.log\n```\n\n## Example progress.md\n\nCreate one with:\n\n```text\n\u002Floop-init\n```\n\nExample content:\n\n```md\n# Progress\n\n## Current Goal\nImprove the application in small safe steps.\n\n## Agent Rules\n- Do not ask questions unless truly blocked.\n- Make reasonable assumptions and continue.\n- Work on unfinished TODOs in order.\n- Mark completed TODOs with [x].\n- Add new bugs, ideas, or follow-up tasks as TODOs.\n- Run tests\u002Flint\u002Fbuild when available.\n- Do not run destructive commands, force pushes, production deploys, or database resets.\n\n## Active TODO\n- [ ] Review the project structure and identify the next safe improvement.\n- [ ] Fix the highest-priority failing test.\n- [ ] Improve the user-facing error state in the main flow.\n\n## Completed\n- [x] Added initial project notes.\n\n## Backlog Ideas\n- [ ] Add a smoke test for the critical path.\n- [ ] Improve developer setup documentation.\n\n## Blocked\n- None.\n```\n\n## Changelog highlights\n\n### v0.5.1\n\n- Cleaned up README installation docs.\n- Removed duplicate npm install section.\n- Removed unresolved merge conflict markers.\n- Added clearer daemon mode documentation.\n- Added Windows Task Scheduler examples.\n- Added daemon usage examples for `--every`, `--max-runs`, `--sleep-first`, and `--prompt-file`.\n\n### v0.5.0\n\n- Added `opencode-loopd` background daemon.\n- Added Windows Task Scheduler helper.\n- Documented TUI loop vs daemon loop.\n- Added background long-running loop examples.\n\n### v0.4.3\n\n- Added duplicate loop protection.\n- Quieted command markdown files.\n\n## Notes and limits\n\n- The TUI plugin is idle-driven. It does not run a background daemon while OpenCode is busy.\n- The TUI `\u002Floop` command stops when OpenCode closes, the terminal closes, the machine sleeps, or the session stops emitting idle events.\n- For long-running work outside the TUI, use `opencode-loopd`.\n- `--timeout` is best-effort and relies on OpenCode's abort API.\n- `--verify`, `--preflight`, `--postrun`, and `--notify` run shell commands, so configure OpenCode permissions carefully.\n- `--until` scans common state files and a limited number of markdown\u002Ftext\u002Fjson\u002Fyaml files to avoid walking huge projects.\n- `--safe` reduces risk but does not replace careful OpenCode permissions.\n- For truly unattended multi-hour work, use a disposable branch or worktree and checkpoint patches.\n\n## License\n\nMIT","OpenCode Loop 是一个为 OpenCode 添加自动继续功能的项目，支持 Claude Code 风格的工作流。其核心功能包括通过 `\u002Floop` 命令实现会话内的自动继续，以及使用 `opencode-loopd` 守护进程进行长时间运行的任务。技术特点涵盖自动继续、定期总结调度、TODO 自动化、测试验证循环、检查点设置、最大运行时间限制、失败控制等。此外，它还提供了 Windows 任务计划程序的支持和安全防护措施。此工具适用于需要长时间编码会话、自动化工作流管理、周期性操作执行及后台任务处理的场景，尤其适合寻求提高开发效率和代码质量的开发者。",2,"2026-06-11 04:03:24","CREATED_QUERY"]