Get the FREE Ultimate OpenClaw Setup Guide →

handoff-codex

Scanned
npx machina-cli add skill claude-world/director-mode-lite/handoff-codex --openclaw
Files (1)
SKILL.md
1.5 KB

Handoff to Codex CLI

Delegate tasks to OpenAI Codex CLI to save Claude context.


When to Use Codex

Use Codex ForKeep in Claude
Simple file editsComplex reasoning
Bulk refactoringArchitecture decisions
Code generation from specsProblem analysis
Documentation updatesMulti-step workflows

Prerequisites

npm install -g @openai/codex

Handoff Process

1. Prepare Context

## Task for Codex
**Goal**: [What needs to be done]
**Files**: [Which files to modify]
**Details**: [Specific requirements]

2. Generate Command

# Single file
codex "Update login function in src/auth.ts to add rate limiting"

# Multiple files
codex "Refactor console.log to logger in src/**/*.ts"

3. Provide Instructions

  • Why Codex is suitable
  • Expected changes
  • After completion steps

Example

## Task: Update All Import Statements

**Command:**
codex "Update all imports from 'lodash' to 'lodash-es' in src/**/*.ts"

**Expected:**
- ~15 files modified
- Each import updated

**After:**
1. Run `npm test`
2. Return if issues arise

Benefits

  • Token Savings: Simple tasks don't consume Claude context
  • Speed: Fast for straightforward edits
  • Context Preservation: Keep Claude fresh for complex reasoning

Source

git clone https://github.com/claude-world/director-mode-lite/blob/main/skills/handoff-codex/SKILL.mdView on GitHub

Overview

Handoff to Codex CLI lets you delegate straightforward edits and small tasks to the Codex command-line interface. This helps keep Claude focused on complex reasoning and preserves context for in-depth work. It provides a structured flow with prerequisites and a three-step handoff.

How This Skill Works

You prepare a Task for Codex with a clear Goal, a list of Target Files, and detailed requirements. Then you generate a codex command to perform the change (single-file or multi-file), and finally you provide post-change instructions to verify and continue. This separation minimizes Claude usage for simple edits while Codex handles routine tasks.

When to Use It

  • Simple file edits
  • Bulk refactoring
  • Code generation from specs
  • Documentation updates
  • Quick, cross-file edits that save Claude context

Quick Start

  1. Step 1: Prepare Context
  2. Step 2: Generate Command
  3. Step 3: Provide Instructions

Best Practices

  • Install Codex CLI globally before you start (npm install -g @openai/codex).
  • Prepare a Task for Codex that includes Goal, Files, and Details.
  • Use precise codex commands for single-file or multi-file edits.
  • Always include Why Codex is suitable, Expected changes, and After completion steps in Instructions.
  • Rely on Codex handoff to save Claude context for straightforward edits, reserving Claude for complex reasoning.

Example Use Cases

  • Example 1: Task: Update All Import Statements — Command: codex "Update all imports from 'lodash' to 'lodash-es' in src/**/*.ts" — Expected: ~15 files modified; After: Run npm test.
  • Example 2: Task: Update login function in src/auth.ts to add rate limiting — Command: codex "Update login function in src/auth.ts to add rate limiting" — Expected: Changes in login logic; After: Run tests and manual verify.
  • Example 3: Task: Refactor console.log to logger in src/**/*.ts — Command: codex "Refactor console.log to logger in src/**/*.ts" — Expected: logger usage across files; After: Build and test.
  • Example 4: Task: Update API docs to reflect new endpoints — Command: codex "Update API documentation in docs/ to reflect v2 endpoints" — Expected: Docs updated; After: Serve docs locally and verify.
  • Example 5: Task: Apply a small code style fix across a module — Command: codex "Format code and adjust indentation in src/module/**/.ts" — Expected: Consistent style; After: Run lint and tests.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers