skills/codex-sandbox/SKILL.md
Create and manage per-task isolated git clones (sandboxes) for Codex CLI sessions, with automatic branch creation and safety hooks that block committing/pushing on main/master. Use when running multiple Codex sessions or parallel tasks and you want to avoid git worktree friction, cwd/branch mixups, or environment collisions.
npx skillsauth add regenrek/agent-skills codex-sandboxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create one directory per task and run the agent inside that directory. Prefer this over git worktrees when:
This skill bundles a small Python CLI plus a Bash wrapper:
scripts/codex_sandbox.py (primary)scripts/codex-task (convenience)Run the scripts from the skill folder, depending on where you installed it:
$REPO_ROOT/.codex/skills/codex-sandboxes$CODEX_HOME/skills/codex-sandboxes (macOS/Linux default: ~/.codex/skills/codex-sandboxes)Use git rev-parse --show-toplevel to get $REPO_ROOT.
This skill is always invoked by an agent. Do not run it manually.
Example command the agent should run:
SKILL_DIR="$(git rev-parse --show-toplevel)/.codex/skills/codex-sandboxes"
python3 "$SKILL_DIR/scripts/codex_sandbox.py" new fix-123
The command will:
origin).origin/main.origin/<branch> (pushes once if needed).main/master.Always request this via the agent. Provide:
--base-dir ~/projects).If you do not provide extra details, the agent should use defaults. If the task name is ambiguous or missing, the agent should ask back.
Example prompt to the agent:
Use codex-sandbox to create a sandbox for task "fix-123".
Place it under ~/projects, base branch main.
Command: python3 <skill_dir>/scripts/codex_sandbox.py new fix-123 --base-dir ~/projects --base-branch main
Use these terms consistently in prompts and logs:
Prefer: one writing session per sandbox.
python3 <skill_dir>/scripts/codex_sandbox.py new <task> [options]
Common patterns:
# Create sandbox + branch and print its path
python3 <skill_dir>/scripts/codex_sandbox.py new feat-auth
# Use a different base branch
python3 <skill_dir>/scripts/codex_sandbox.py new fix-123 --base-branch develop
# Copy .env.example to .env on creation
python3 <skill_dir>/scripts/codex_sandbox.py new feat-auth --env-copy
Key options:
--base-dir DIR: Where to place sandboxes (default: ~/wip).--bare-dir DIR: Where to keep the bare mirror (default: ~/.cache/codex-sandboxes/<repo>.git).--remote NAME: Which remote to use (default: origin).--remote-url URL: Override remote URL discovery.--base-branch NAME: Base branch to branch from (default: main).--branch NAME: Explicit branch name (default: derived from <task>).--env-copy: Copy .env.example to .env if present and .env missing.python3 <skill_dir>/scripts/codex_sandbox.py list
python3 <skill_dir>/scripts/codex_sandbox.py path <task>
python3 <skill_dir>/scripts/codex_sandbox.py status <task>
python3 <skill_dir>/scripts/codex_sandbox.py rm <task>
Follow these rules in every run:
main/master protected on the remote (PR-only merges).If the sandbox is currently on main/master, the tool will refuse to proceed unless you pass --allow-main.
If you want multiple sessions for one workset, create multiple sandboxes:
python3 <skill_dir>/scripts/codex_sandbox.py new feat-auth-ui-1
python3 <skill_dir>/scripts/codex_sandbox.py new feat-auth-ui-2
python3 <skill_dir>/scripts/codex_sandbox.py new feat-auth-core-1
Avoid running two writing sessions in the same sandbox.
--remote-url.<task> name or remove with rm.references/naming.md.tools
Live-test any Electron desktop app with native-devtools-mcp, Chrome DevTools Protocol, screenshots, OCR, and accessibility tools. Use when the user asks for Electron UI verification, MCP-driven app control, renderer CDP interaction, native desktop automation, screenshots, or OCR-driven checks.
testing
Find, clone, inspect, and summarize high-quality GitHub reference repositories for coding agents. Use when a user asks for GitHub reference projects, examples, prior art, inspiration, implementation patterns, or includes "$search-context" in a coding prompt.
testing
Run or install repo security leak checks with BetterLeaks and Trivy. Use when asked to scan for leaked secrets, vulnerable dependencies, misconfigurations, add secret-leak guardrails, add BetterLeaks, add forbidden-path hooks, or run secleak-check before release.
development
Run a reusable JavaScript supply-chain security baseline with pnpm-first hardening, release-age gating, lifecycle-script controls, exotic dependency checks, CI install checks, and optional incident IOC profiles.