home / skills / hiroro-work / claude-plugins / ask-codex

ask-codex skill

/skills/ask-codex

This skill helps you interact with the Codex CLI to get coding assistance, generate code, and debug via a local, repeatable workflow.

npx playbooks add skill hiroro-work/claude-plugins --skill ask-codex

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.5 KB
---
name: ask-codex
description: Asks Codex CLI for coding assistance. Use for getting a second opinion, code generation, debugging, or delegating coding tasks.
allowed-tools: Bash(codex:*)
---

# Ask Codex

Executes the local `codex` CLI to get coding assistance.

**Note:** This skill requires the `codex` CLI to be installed and available in your system's PATH.

## Quick start

Run a single query with `codex exec`:

```bash
codex exec "Your question or task here"
```

## Common options

| Option | Description |
|--------|-------------|
| `-m MODEL` | Specify model |
| `-C DIR` | Set working directory |
| `--full-auto` | Enable automatic execution with workspace-write sandbox |

> For all available options, run `codex exec --help`

## Examples

**Ask a coding question:**

```bash
codex exec "How do I implement a binary search in Python?"
```

**Analyze code in a specific directory:**

```bash
codex exec -C /path/to/project "Explain the architecture of this codebase"
```

**Use a specific model:**

```bash
codex exec -m o4-mini "Write a function that validates email addresses"
```

**Let Codex make changes automatically:**

```bash
codex exec --full-auto "Add error handling to all API endpoints"
```

## Notes

- Codex runs non-interactively with `exec` subcommand
- By default, output goes to stdout and no files are modified without approval
- Use `--full-auto` for automatic execution within sandbox constraints
- The command inherits the current working directory unless `-C` is specified

Overview

This skill integrates with the local codex CLI to ask for coding assistance from models available to the CLI. It runs non-interactive queries, can target a specific working directory or model, and supports automatic execution modes for making changes. Use it to get a second opinion, generate code, or delegate routine code edits to the Codex toolchain.

How this skill works

The skill executes the codex CLI using the exec subcommand and passes your plain-text prompt and any flags you provide. It can change the working directory (-C), choose a model (-m), and enable full-auto mode (--full-auto) to allow sandboxed workspace writes. By default, output streams to stdout and files are never modified without explicit full-auto approval.

When to use it

  • Request code explanations or design overviews for a project directory
  • Generate functions, tests, or snippets in a chosen model
  • Debug or review code by pointing Codex at a repo or folder
  • Automate repetitive code edits with sandboxed automatic execution
  • Get a quick second opinion before merging a change or deploying

Best practices

  • Install and verify the codex CLI is on your PATH before use
  • Run queries from the project root or use -C to target the correct directory
  • Start without --full-auto to review suggestions before applying changes
  • Pin a model with -m when you need consistent behavior or cost control
  • Keep prompts concise and include relevant file paths or examples for context

Example use cases

  • Ask for a code review of a specific module: codex exec -C /repo "Explain issues in module X"
  • Generate a utility function with a chosen model: codex exec -m o4-mini "Write a function to normalize dates"
  • Fix common bugs across a codebase using sandboxed automation: codex exec --full-auto "Add null checks to all API handlers"
  • Summarize architecture and dependency points for onboarding: codex exec -C /path/to/project "Summarize the architecture and main dependencies"
  • Create unit tests for functions in a directory: codex exec -C ./src "Write pytest tests for functions in file Y"

FAQ

Do I need network access to use this skill?

No. It runs the local codex CLI installed on your machine; network requirements depend on how your codex CLI is configured to reach models or services.

Will files be changed automatically?

Not by default. codex exec prints suggestions to stdout. Use --full-auto to allow automatic, sandboxed workspace writes, but review the implications before enabling it.