codex-background-burn-orchestration
Run quota-aware Codex usage-burn waves as useful background issue-execution lanes, including Hermes stdin-close and sandbox recovery patterns.
Best use case
codex-background-burn-orchestration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Run quota-aware Codex usage-burn waves as useful background issue-execution lanes, including Hermes stdin-close and sandbox recovery patterns.
Teams using codex-background-burn-orchestration should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/codex-background-burn-orchestration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How codex-background-burn-orchestration Compares
| Feature / Agent | codex-background-burn-orchestration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Run quota-aware Codex usage-burn waves as useful background issue-execution lanes, including Hermes stdin-close and sandbox recovery patterns.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Codex Background Burn Orchestration
## Trigger / when to use
Use this when the user asks to deliberately spend/burn Codex capacity over a short window, or to keep Codex productively occupied on approved work, especially phrases like:
- "burn X% of Codex usage"
- "use up Codex capacity over the next 24 hours"
- "keep Codex lanes running"
- "route underused Codex quota to approved issues"
Class of task: quota-aware Codex lane orchestration that converts available Codex capacity into bounded, approved GitHub issue execution rather than synthetic token waste.
## Operating pattern
1. Refresh telemetry first
- Run the provider utilization refresh if available:
```bash
bash scripts/cron/provider-utilization-refresh.sh
```
- Inspect:
- `config/ai-tools/agent-quota-latest.json`
- `config/ai-tools/provider-routing-scorecard.json`
- `config/ai-tools/provider-work-queue.json`
- Convert the target into a rough message budget. Example: if Codex shows `week_messages=5`, `weekly_limit=1400`, and the user asks for 50% remaining in 24h, target about `(1400-5)*0.5 ≈ 700` messages.
2. Select useful lanes, not synthetic burn
- Prefer `provider-work-queue.json -> provider_queues.codex.top_issues`.
- Favor open issues with `status:plan-approved` and bounded implementation/test/refactor/documentation scope.
- Respect existing `agent:*` labels and avoid issues already `status:working` unless recovering a known stalled lane.
- Keep about 3-5 concurrent Codex lanes; top up periodically rather than launching too many at once.
3. Isolate each lane
- Create one worktree or clone per issue under a run directory, e.g.:
```bash
git worktree add -b codex/burn-YYYYMMDD-issue-NNNN /mnt/local-analysis/codex-burn-YYYYMMDD/issue-NNNN origin/main
```
- If `git worktree add` is slow or leaves corrupt metadata, use a shared clone fallback:
```bash
git clone --shared --branch main /mnt/local-analysis/workspace-hub /mnt/local-analysis/codex-burn-YYYYMMDD/issue-NNNN
git -C /mnt/local-analysis/codex-burn-YYYYMMDD/issue-NNNN checkout -B codex/burn-YYYYMMDD-issue-NNNN
```
- Never run dangerous Codex modes in a dirty shared checkout.
4. Coordinate GitHub
- Add labels when safe:
```bash
gh issue edit NNNN --add-label agent:codex,status:working
```
- Post an execution-start comment naming the branch/worktree and validation intent.
5. Prompt each Codex lane
Include:
- issue URL and number
- branch/worktree path
- approved plan artifact paths
- hard gates: verify issue open + `status:plan-approved`, TDD, validation, adversarial self-review
- commit/push/comment requirements
- explicit forbidden paths and no force-push
- close only if landed/allowed by policy
## Hermes/Codex background launch gotchas
### Stdin close is mandatory in Hermes background mode
Codex may print `Reading additional input from stdin...` and hang indefinitely even when the command uses `< /dev/null` or an empty pipe.
Reliable Hermes pattern:
```python
# 1. Launch background process
terminal(
command='codex exec -c model_reasoning_effort="high" --dangerously-bypass-approvals-and-sandbox --cd /abs/worktree "$(cat /abs/prompt.md)"',
background=True,
notify_on_complete=True,
workdir='/abs/worktree',
)
# 2. Immediately close stdin on the returned session_id
process(action='close', session_id='<session_id>')
# 3. Then monitor
process(action='poll', session_id='<session_id>')
```
If a run is stuck at only `Reading additional input from stdin...`:
1. `process(action='close', session_id='...')`
2. wait briefly
3. if still stuck, kill and relaunch with the explicit close pattern
### Prefer Codex `--cd` over terminal workdir alone
Codex may report an unexpected banner `workdir` when relying only on the terminal tool's `workdir`. Pass both:
```bash
codex exec --cd /abs/worktree "$(cat /abs/prompt.md)"
```
### Sandbox loopback failure recovery
In some environments, `--full-auto` / sandboxed Codex runs cannot execute shell commands and emit:
```text
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
```
For implementation lanes that are already isolated to a dedicated worktree/clone, relaunch with:
```bash
codex exec \
-c model_reasoning_effort="high" \
--dangerously-bypass-approvals-and-sandbox \
--cd /abs/worktree \
"$(cat /abs/prompt.md)"
```
Safety requirements for this fallback:
- only in an isolated issue worktree/clone
- prompt must narrowly constrain owned paths and issue scope
- no force-push
- verify diffs before landing
## Periodic controller pattern
For a multi-hour burn target, create a scheduled controller every 1-2 hours that:
1. refreshes quota/routing artifacts
2. counts active Codex processes/lanes
3. inspects completed lane outputs and worktree status
4. avoids duplicate issues
5. launches new lanes only until the target concurrency is restored
6. reports issue URLs, branches, process IDs, quota snapshot, and blockers
Do not let the controller recursively schedule more cron jobs.
## Verification before claiming success
Before reporting that a lane landed:
- inspect process output
- check `git -C <worktree> status --short`
- check `git -C <worktree> log --oneline -3`
- verify pushed branch or main ancestry
- verify GitHub comment/closure state
Report "running" or "blocked" rather than claiming completion when the process is only launched.Related Skills
verify-Codex-run-commit-vs-working-tree-before-closing
After a Codex implementation run, verify the claimed file set against the actual commit and working tree before treating the issue as fully complete.
multi-file-tax-prep-orchestration
Structured approach to complex multi-file tax return preparation with traceability and planning
extract-skills-from-Codex-sessions
Automatically extract reusable skills from Codex session transcripts using LLM analysis and wire them into a Stop hook
interactive-Codex-to-file-based-fallback
Switch from tmux/interactive Codex to file-based Codex -p execution when interactive runs fail with upstream errors or analysis-only stalls, then verify landing from git/GitHub state.
exclude-wiki-Codex-md-from-harness-line-limit-hook
Fix false-positive pre-commit failures where workspace-hub's AGENTS.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.
session-start-dirty-state-triage-with-background-agents
Distinguish real implementation dirt from generated session-state churn when resuming a repo with active overnight/background agents.
overnight-worktree-Codex-noop-recovery
Recover overnight Codex worktree batches that appear to succeed but produce no artifacts; harden rerun prompts and launch commands.
codex-skill-loader-broken-symlink-recovery
Diagnose Codex startup failures in workspace-hub caused by a broken `.Codex/skills/skills` symlink and recover without misattributing the failure to issue scope.
Codex-quota-failover-to-codex-for-overnight-plan-lanes
Recover an overnight multi-worktree planning wave when some Codex lanes hit quota by relaunching only the failed lanes with Codex in the same isolated worktrees and prompt files.
background-Codex-worktree-absolute-path-launch
Prevent overnight/background Codex worker launch failures in git worktrees by using absolute prompt/log paths and immediate post-launch polling.
background-service-manager
Create and manage long-running background processes with start/stop/status controls, logging, and monitoring. Use for batch processing jobs, data pipelines, continuous services, or any long-running tasks.
Codex-design
Design one-off HTML artifacts (landing, deck, prototype).