An agent loop is a repeated workflow where a coding agent checks work, creates or resumes panes, starts terminal agents, reads bounded terminal output, sends follow-up input, and reports what needs human review.
Pane provides the local control plane for that loop. Your scheduler can be Codex, Claude Code, a shell script, cron, a GitHub-aware skill, or any other orchestrator.
If you want the exact workflow Pane uses for issue fan-out, PR testing, independent Codex/Claude review, and RunPane dogfooding, start from the open-source runpane-orchestrator Codex skill or runpane-orchestrator Claude Code skill.
Minimal Loop Contract
Start with a doctor check and the brief contract:
runpane doctor --json
runpane agent-contextFetch detailed command definitions only when needed:
runpane agent-context --command "panes create" --json
runpane agent-context --command "panels wait" --json
runpane agent-context --command "panels submit" --jsonAgents can also read the public machine contract before installing anything: /runpane-cli-contract.json.
Register the Repository
Do not assume Pane already knows about the repo:
runpane repos list --json
runpane repos add --path "$PWD" --yes --json
runpane agents doctor --agent codex --repo active --jsonrepos add requires an existing git repository. It does not create directories or initialize git for you.
Create Task Panes
Create one visible pane per task, issue, PR review, or implementation stream:
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 \
--jsonFor non-built-in agents, use a custom terminal command:
runpane panes create \
--repo active \
--name "custom-agent-loop" \
--tool-command "bash -lc 'my-agent --flag'" \
--initial-input-file prompt.txt \
--source agent \
--wait-ready \
--yes \
--jsonUse --source agent or --no-focus for orchestrator-created panes so Pane does not steal the user’s active view. Use --focus only when the user asked to be moved to the new pane.
Validate Output
After creating a pane, find its terminal panel and read recent output:
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 --jsonPrefer panels screen for compact current state. Use panels output when you need scrollback. Increase --limit only when the JSON result indicates more history is needed.
Send Input
Use panels submit for ordinary text plus Enter:
runpane panels submit \
--panel <panel-id> \
--text "Continue with the review pass." \
--yes \
--jsonUse panels input --input-file for prompts, newlines, quotes, Ctrl-C, or anything shell-sensitive:
printf 'Continue with the review pass.\n' | \
runpane panels input --panel <panel-id> --input-file - --yes --json
runpane panels output --panel <panel-id> --limit 200 --jsonIf interrupting a running command, send Ctrl-C first, validate output, then send the next command in a separate input call.
printf '\003' | runpane panels input --panel <panel-id> --input-file - --yes
runpane panels screen --panel <panel-id> --jsonIf text is already in an agent composer, let Pane submit the composer instead of guessing whether Enter or Ctrl+Enter is correct:
runpane panels submit-composer --panel <panel-id> --strategy auto --yes --jsonWSL and Windows Pane
If an agent runs inside WSL but Pane is installed as a Windows app, the Linux shell may not see the Windows Pane daemon directly. Call the Windows wrapper through PowerShell and use a Windows working directory:
powershell.exe -NoProfile -Command \
'Set-Location $env:TEMP; runpane repos list --json'Create panes through the same form and select the saved WSL repository by name or id:
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'Starter Loop Prompt
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.
5. Start the right terminal agent in each pane with a clear initial prompt.
6. Use --source agent or --no-focus for background work unless the user asked to be moved.
7. Wait for readiness and read compact screen state before claiming a pane started correctly.
8. Send follow-up input with panels submit or submit-composer; use panels input only for exact bytes.
9. Report the panes created, what each is doing, and what needs human review.
Keep output brief. Do not merge without explicit human approval.For the product-level walkthrough, see How to Set Up Your First AI Agent Loop with Pane.