codex-sandbox

Create per-task Git sandboxes with isolated branches for Codex sessions.

131|13|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/regenrek/agent-skills --skill codex-sandbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-sandbox
Source: https://github.com/regenrek/agent-skills/tree/main/skills/codex-sandbox
Command: npx skills add https://github.com/regenrek/agent-skills --skill codex-sandbox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Codex sandboxing solves the problem of cross-task contamination and Git worktree friction by giving every task its own sandbox directory and isolated branch, ensuring predictable environments and safe isolation for Codex sessions.

Core Features & Use Cases

  • Create a dedicated sandbox per task, with a per-task branch and a safe upstream to the real remote.
  • Install safety hooks that prevent commits or pushes on main/master to reduce the risk of accidental changes to protected branches.
  • Use when running multiple Codex sessions or parallel tasks to avoid cwd/branch mixups and environment collisions.
  • Works across repo-scoped and user-scoped setups, with a minimal Python CLI and wrapping Bash helper.

Quick Start

Ask the agent to create a sandbox for a task using the codex_sandbox tool.

Frequently Asked Questions about codex-sandbox

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate parallel Codex tasks to prevent Git worktree collisions?

Isolate parallel Codex tasks by creating a dedicated sandbox directory per task, cloning from a bare mirror and assigning each task its own separate branch to prevent Git worktree collisions and ensure predictable environments.

Can I block commits or pushes to main and master branches during Codex automation?

Block commits or pushes to main and master branches during Codex automation by installing safety hooks that prevent accidental changes to protected branches within each per-task sandbox environment.

How do I create a per-task sandbox for a Codex session?

Create a per-task sandbox for a Codex session by asking the agent to use the codex_sandbox tool, which parses remote URLs, manages bare mirrors, creates isolated sandboxes, and records metadata for full auditability.

Does Codex sandboxing work with both repo-scoped and user-scoped development workflows?

Codex sandboxing works with both repo-scoped and user-scoped development workflows, providing a minimal Python CLI and wrapping Bash helper to manage per-task sandboxes across different project configurations.

Why do I need a separate branch per task when running multiple Codex sessions?

You need a separate branch per task when running multiple Codex sessions to avoid cwd and branch mixups, prevent cross-task contamination, and ensure safe isolation between parallel Codex tasks.

What are the limitations of using bare mirrors for Git sandbox isolation?

A limitation of using bare mirrors for Git sandbox isolation is that the setup requires parsing remote URLs and managing the mirror cloning process, which may add overhead to multi-task projects compared to working directly in a single repository.