<- back to runpane.com

agent loops

how to set up your first ai agent loop

Instead of babysitting one terminal, you have one agent that manages your whole workspace. It picks up work, creates isolated panes, starts agents in each one, checks their output, sends follow-up input, and tells you what needs review. Pane makes that work with any agent, on any OS.

any agent

Codex, Claude Code, Aider, Goose, OpenCode, or any terminal CLI.

any OS

Windows, WSL, macOS, Linux, VMs, and remote hosts.

open source

AGPL-3.0. The app, CLI, and orchestrator skills are all public.

the shape of a loop

The useful version is not a magic prompt. It is a small operating loop:

loop stepwhat the agent doeswhat Pane gives it
inspectread issues, PRs, CI, or repo statesaved repositories and existing panes
spawncreate isolated work for each taskworktree-backed panes
drivestart agents, answer prompts, send inputterminal-backed panels
validateread recent output before claiming successlimited terminal output (won't blow up context)
reportsummarize what needs human reviewvisible panes, diffs, branches, and statuses

first loop recipe

  1. 1.

    install or update pane

    Use the package-manager path so both you and your agents can rely on the same runpane command:

    npx --yes runpane@latest
    pnpm dlx runpane@latest
    pipx run runpane
  2. 2.

    let the agent find pane

    Have your agent check what commands are available. The summary is short by default. Full details for any command load only when needed.

    curl -fsSL https://runpane.com/runpane-cli-contract.json
    runpane doctor --json
    runpane agent-context --json
    runpane agent-context --command "panes create" --json
    runpane agent-context --command "panels wait" --json
    runpane agent-context --command "panels submit" --json
  3. 3.

    add the repo if needed

    Don't assume Pane already knows about the repo. Check first, then add it if it's missing.

    runpane repos list --json
    runpane repos add --path "$PWD" --yes --json
    runpane agents doctor --agent codex --repo active --json
  4. 4.

    create a pane for each task

    Each pane maps to one piece of work: an issue, a PR review, an implementation. Use a built-in agent or pass a custom terminal command for anything else.

    runpane panes create \
      --repo active \
      --name "review-pr-51" \
      --agent codex \
      --prompt "Review PR #51. Run checks, summarize findings, and stop before merging." \
      --source agent \
      --wait-ready \
      --yes \
      --json
  5. 5.

    check what actually happened

    After creating a pane or sending input, verify it worked. Use screen for a quick look at what's on screen now. Use output when you need scrollback.

    runpane panes list --repo active --json
    runpane panels list --pane <pane-id> --json
    runpane panels wait --panel <panel-id> --for ready --timeout-ms 30000 --json
    runpane panels screen --panel <panel-id> --limit 80 --json
    runpane panels output --panel <panel-id> --limit 200 --json
  6. 6.

    answer prompts and continue

    For ordinary follow-up text, use panels submit. Use panels submit-composer for Codex or Claude composer boxes, and keep panels inputfor exact bytes such as Ctrl-C or shell-sensitive payloads.

    runpane panels submit --panel <panel-id> --text "Continue with the review pass." --yes --json
    runpane panels submit-composer --panel <panel-id> --strategy auto --yes --json
    
    printf '\003' | runpane panels input --panel <panel-id> --input-file - --yes --json
    
    runpane panels wait --panel <panel-id> --for idle --timeout-ms 300000 --json
    runpane panels screen --panel <panel-id> --limit 80 --json

a starter prompt for your orchestrator

Give this to Codex, Claude Code, or any agent setup that can run shell commands:

You are running an agent loop for this repo.

Every cycle:
1. Inspect GitHub issues and PRs that need action.
2. Fetch the public contract if needed, then run runpane doctor --json and runpane agent-context.
3. Make sure this repository is saved in Pane and the requested agent is runnable.
4. Create one background-friendly Pane per task or review stream with --source agent and --wait-ready.
5. Start the right terminal agent in each pane with a clear initial prompt.
6. Use panels wait and panels screen before claiming a pane started correctly.
7. Send follow-up input with panels submit or submit-composer; use panels input only for exact bytes.
8. Report the panes created, what each is doing, and what needs human review.

Keep output brief. Do not merge without explicit human approval.

windows and wsl

Pane can run as a Windows app while your repo and agent live inside WSL. In that setup, a Linux shell may not see the Windows Pane daemon directly. The loop can call the Windows wrapper through PowerShell and choose the saved WSL repository by name or id:

powershell.exe -NoProfile -Command \
  'Set-Location $env:TEMP; runpane repos list --json'

powershell.exe -NoProfile -Command \
  'Set-Location $env:TEMP; runpane panes create --repo "Pane" --name "loop-smoke" --agent codex --prompt "Say hello from this loop and wait." --source agent --wait-ready --yes --json'

pane handles the workspace, not the world

Pane gives your loop the workspace commands. Your agent can still use GitHub CLI, MCP servers, Linear, Jira, or anything else for the outside world. That's the point: Pane doesn't lock you into one model, one editor, or one hosting provider.

You don't need to wait for built-in scheduling to start using loops. Use your existing agent as the loop runner and Pane as the workspace it manages. The full issue-to-PR workflow is packaged as open-source Codex and Claude Code skills.

useful next pages

- runpane CLI and agent control

- runpane CLI docs

- AI agent orchestration

- Git worktrees for AI agents

- Agent loops are here

- Run the Codex orchestration skill

- Run the Claude Code orchestration skill

pertanyaan yang sering diajukan

atau
Unduh*
Peringatan Windows SmartScreenUnduhan langsung bisa menampilkan peringatan SmartScreen selama Pane belum ditandatangani. Pane sepenuhnya open source. Kamu bisa memeriksa kodenya atau build sendiri dari kode sumber.1. Klik Info selengkapnya2. Klik Tetap jalankan3. Lanjutkan instalasiInstalasi PowerShell mengunduh rilis resmi secara langsung dan menghindari sebagian besar masalah saat mengunduh lewat browser.instalasi global npm
Tempelkan di PowerShell.MacLinux