codex-cli-subagent

Spawn a nested Codex subagent via codex exec for non-interactive project tasks.

8|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/timurkhakhalev/cc-plugins --skill codex-cli-subagent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-cli-subagent
Source: https://github.com/timurkhakhalev/cc-plugins/tree/main/plugins/codex-cli-subagent/skills/codex-cli-subagent
Command: npx skills add https://github.com/timurkhakhalev/cc-plugins --skill codex-cli-subagent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill lets you spawn a nested Codex process (a “subagent”) using codex exec so it can work with the same project and AGENTS.md instructions.

Core Features & Use Cases

  • Focused subagents: Run a dedicated Codex subagent inside your project to perform refactors, audits, or scripted operations without disrupting your main session.
  • Safe execution: Non-interactive mode by default; logging captures for debugging without exposing inner steps to caller.
  • Long-running tasks: Supports generous timeouts and log streaming to /tmp/${filename}.log for troubleshooting.

Quick Start

filename="$(openssl rand -hex 4)" codex exec "count the total number of lines of code in this project" 2>>/tmp/${filename}.log

Frequently Asked Questions about codex-cli-subagent

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

FAQPage Schema
How do I run a nested Codex subagent to perform automated tasks on my project?

Use `codex exec` to spawn a nested Codex subagent that operates within the same project and inherits your AGENTS.md instructions. The subagent runs in non-interactive read-only mode by default, making it safe for refactors, audits, and scripted operations without disrupting your main session.

Can I configure timeout and logging for long-running Codex subagent tasks?

Yes. The Skill enforces a minimum 20-minute Run/Bash timeout and generates unique logfiles via hex strings to /tmp/${filename}.log. Redirect stderr for debugging, and configure model, sandbox, and timeout settings via flags to suit your workflow.

What are the default safety settings when running a Codex subagent?

Subagents default to non-interactive, read-only execution to prevent accidental modifications. A flag-driven policy lets you explicitly enable edits or network access only when needed, keeping nested execution isolated and predictable.

How do I enable edits or network access in a Codex subagent if my task requires it?

Pass flag arguments to `codex exec` to selectively enable edits or network access beyond the default read-only sandbox. This maintains safety by requiring explicit opt-in rather than allowing unrestricted modification by default.

When should I use a Codex subagent instead of running tasks in my main session?

Use subagents for focused, isolated work like code audits, refactors, or scanning operations that benefit from independent logging and timeout control. Subagents isolate side effects and capture execution details without exposing intermediate steps to your caller.