ddnetters/homelab-agent-skills / invoking-codex-exec
invoking-codex-exec
VerifiedUse when delegating a single coding task to `codex exec` ("hand off to codex", "run codex on this", "dispatch codex on this ticket", any one-shot invocation). Covers flags, sandbox traps, monitoring, and recovery. Not for multi-issue parallel batches — use codex-issue-waves for those.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.2 KB |
| scripts/detect_sandbox_spiral.shexecutable | script | 2.0 KB |
scripts/detect_sandbox_spiral.sh
View on GitHub#!/usr/bin/env bash
# Detect codex-exec sandbox-bypass spirals from a codex log.
#
# Usage:
# detect_sandbox_spiral.sh <logfile> # tail -f, emit one line per hit, run forever
# detect_sandbox_spiral.sh --once <logfile> # scan existing content, exit 0 (clean) or 1 (spiral)
#
# Designed for use with the Monitor tool: each match becomes a stdout line, which
# the harness surfaces as a notification. The agent decides whether to kill codex,
# usually after a `git status` / `git diff` check (see SKILL.md "Before killing").
#
# Signatures are derived from a real spiral observed 2026-04-28: codex used
# `--full-auto` (workspace-write sandbox), gradle daemon socket bind was blocked,
# codex tried GRADLE_USER_HOME=/tmp, then patched the gradle CLI jar.
set -euo pipefail
mode="follow"
if [[ "${1:-}" == "--once" ]]; then
mode="once"
shift
fi
logfile="${1:-}"
if [[ -z "$logfile" ]]; then
echo "usage: $(basename "$0") [--once] <logfile>" >&2
exit 2
fi
if [[ ! -r "$logfile" ]]; then
echo "error: cannot read $logfile" >&2
exit 2
fi
# Earliest-to-latest signal order. Order does not matter for matching, but the
# earlier signals (sandbox-policy rejections, GRADLE_USER_HOME=/tmp) tend to fire
# minutes before the JVM-verifier and jar-patching ones.
pattern='blocked by policy|rejected by policy|GRADLE_USER_HOME=/tmp|MAVEN_OPTS=.*-Duser\.home=/tmp|/tmp/gradle-(patch|home)|/tmp/maven-(patch|home)|Expecting a stack( |-)?map frame|BuildActionsFactory|DefaultFileLockCommunicator|PatchBuildActionsFactory|jar (uf|xf|cf) /tmp|--no-daemon.*--no-daemon|Net\.bind0|DatagramSocket.*bind'
if [[ "$mode" == "once" ]]; then
hits=$(grep -nE "$pattern" "$logfile" 2>/dev/null || true)
if [[ -n "$hits" ]]; then
printf '%s\n' "$hits" | awk 'NR<=5'
exit 1
fi
exit 0
fi
# follow mode — line-buffered grep so events surface immediately
exec tail -n0 -F "$logfile" 2>/dev/null \
| grep -E --line-buffered "$pattern" \
| awk '{ print "[sandbox-spiral] " $0; fflush(); }'
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |