ai-co-scientist
Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers…
Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.
$ npx -y skills add sundial-org/skills --skill codex --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/codexContext preview
The summary Claude sees to decide when to auto-load this skill.
Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.
name: codex description: Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.
Codex is OpenAI's coding agent. Use `codex exec` to run it non-interactively from any cli agent.
Use Codex when:
Do NOT use Codex for:
# Analysis (read-only, default) codex exec "describe the architecture of this codebase" # Allow file edits codex exec --full-auto "fix the failing tests" # Code review codex exec review --uncommitted codex exec review --base main # Structured JSON output codex exec --output-schema schema.json -o result.json "extract metadata" # Continue previous session (inherits original sandbox settings) codex exec resume --last "now add tests"
Progress goes to stderr, final result to stdout. To capture only the result:
codex exec "summarize the repo" 2>/dev/null > summary.txt
To see progress while capturing result:
codex exec "generate changelog" 2>&1 | tee output.txt
In non-interactive mode, **no approval prompts are possible**. Permissions must be set upfront:
| Mode | Flag | Behavior | |------|------|----------| | Read-only | (default) | Reads anywhere, writes/commands blocked | | Workspace-write | `--full-auto` | Pre-approves edits and commands in workspace | | Full access | `--yolo` | No restrictions. Use in isolated environments only |
**Choose based on task:**
Note: `~/.codex/config.toml` can set project trust levels that override defaults.
Default model is `gpt-5.2-codex`. Override with `-m`:
codex exec -m gpt-5 "explain this code"
By default, the user should already be authenticated. If not, set `CODEX_API_KEY`:
CODEX_API_KEY=sk-... codex exec "task"
Built-in review subcommand:
# Review uncommitted changes codex exec review --uncommitted # Review against a base branch codex exec review --base main # Review a specific commit codex exec review --commit abc123
Use `--output-schema` for JSON output. **Important**: OpenAI requires `additionalProperties: false` on all object types.
codex exec --output-schema schema.json -o result.json "extract API endpoints"
Schema example:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"endpoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"method": { "type": "string" }
},
"required": ["path", "method"],
"additionalProperties": false
}
}
},
"required": ["name", "endpoints"],
"additionalProperties": false
}Resume continues a previous session, **inheriting its sandbox settings**:
# Start a task codex exec --full-auto "implement rate limiter" # Continue later (inherits --full-auto from original) codex exec resume --last "add unit tests" # Or resume by session ID codex exec resume <SESSION_ID> "follow-up task"
**Note**: Cannot pass `--full-auto` to resume; it inherits from the original session.
For programmatic use, `--json` outputs structured events:
codex exec --json "analyze code" 2>/dev/null | jq -c 'select(.type == "item.completed")'
Complex tasks typically take **60-120+ seconds**. Simple analysis tasks complete in 10-30 seconds.
Break complex work into focused tasks:
# Good: Focused, single-purpose tasks codex exec --full-auto "add star ratings to the skill cards" codex exec --full-auto "add a search filter to the toolbar" # Avoid: Multi-feature requests in one task codex exec --full-auto "add ratings, search, filters, modal, and animations"
**Avoid running multiple Codex sessions on the same file simultaneously.** While it may work, concurrent edits risk merge conflicts or overwrites.
Files over ~2000 lines slow execution as Codex reads the entire file multiple times. Consider:
Common errors:
Codex reads `AGENTS.md` files for project instructions:
# AGENTS.md - Run `npm
The skill skill can help you find, improve, and publish skills — install it with npx sundial-hub add skill. You'll be able to peruse this library of curated skills, plus 50,000+ more aggregated from the web.
Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers…
Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and…
Conduct a literature review and develop a CS research proposal. Use when asked to review a research area, find gaps in existing…
Paper reviewer that evaluates machine learning research projects following official ICML reviewer guidelines. Provides…
Neuro-symbolic AI combining LLMs with symbolic solvers. Use when exploring neuro-symbolic approaches (ideation, no code) or…
Critiques ML conference papers with reviewer-style feedback. Use when users want to anticipate reviewer concerns, identify…