codex-environment

Create, inspect, and repair Codex Local Environment configurations for worktrees.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/zuzu59/z-skills --skill codex-environment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-environment
Source: https://github.com/zuzu59/z-skills/tree/main/skills/codex-environment
Command: npx skills add https://github.com/zuzu59/z-skills --skill codex-environment

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codex worktrees require consistent local environment configuration, including environment.toml, and reproducible setup and cleanup processes.

Core Features & Use Cases

  • Manage Codex Local Environments: create, inspect, and repair environment.toml and related worktree config.
  • Setup and cleanup automation: provide hooks via scripts/worktree-up and scripts/worktree-down to prepare and restore worktrees.
  • Workload isolation: copy and manage ignored env files (e.g., .env) per worktree to avoid cross-contamination.
  • Reusable actions: expose Codex app actions (e.g., Dev, Typecheck, Unit tests, Lint) for quick access in the Codex UI.
  • Environment portability: standardize environment patterns and environment.toml across worktrees for consistency.

Quick Start

Run scripts/worktree-up from the project root to initialize a new Codex worktree.

Frequently Asked Questions about codex-environment

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

FAQPage Schema
How do I configure environment.toml for local worktrees?

To configure environment.toml for local worktrees, you can create, inspect, or repair Codex Local Environment configurations. This standardizes environment patterns across worktrees for consistent project setup and cleanup automation.

How do I automate worktree setup and cleanup scripts?

You can automate worktree setup and cleanup by providing hooks through scripts/worktree-up and scripts/worktree-down. These hooks prepare and restore worktrees, enabling reproducible environment initialization and teardown across projects.

Can I isolate .env files across multiple Codex worktrees?

Yes, you can isolate .env files across multiple Codex worktrees by copying and managing ignored env files per worktree. This workload isolation prevents cross-contamination of environment variables between separate project branches.

How do I expose reusable actions like Typecheck and Unit tests in Codex?

You can expose reusable actions like Typecheck, Dev, Unit tests, and Lint by defining them as Codex app actions within the local environment configuration. This provides quick access to ready-to-run commands in the Codex UI.

What is the best way to standardize environment patterns across worktrees?

The best way to standardize environment patterns across worktrees is by applying a versioned environment.toml schema. This ensures environment portability and consistent configuration management across all project worktrees.

Does Codex worktree environment management handle worktree-specific databases?

Yes, Codex worktree environment management includes worktree-specific database handling. This ensures that database configurations are properly isolated and managed alongside the environment.toml setup for each individual worktree.