home / skills / bahayonghang / my-claude-code-settings / codex

This skill helps you generate and analyze code with deep reasoning and perform online research by web searching and fetching sources.

npx playbooks add skill bahayonghang/my-claude-code-settings --skill codex

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

Files (1)
SKILL.md
4.5 KB
---
name: codex
description: Execute Codex CLI for code generation, analysis, web search and web fetch. Two capabilities - (1) Code Generation with deep reasoning, (2) Web Search & Fetch for online research.
category: development-tools
tags: [cli, code-generation, web-search, reasoning, codex]
---

# Codex CLI Integration

Two specialized capabilities for different use cases.

## Capability 1: Code Generation

Deep code analysis and generation with maximum reasoning power.

### When to Use

- Complex code analysis requiring deep understanding
- Large-scale refactoring across multiple files
- Automated code generation with safety controls
- Tasks requiring specialized reasoning models

### Default Configuration

- Model: `gpt-5.3-codex`
- Reasoning: `xhigh` (maximum thinking depth)

### Command Pattern

```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=xhigh \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  -C <workdir> \
  "<task>"
```

### Parameters

- `<task>` (required): Task description, supports `@file` references
- `-m <model>`: Override model (e.g., `gpt-5.3-codex`, `gpt-5`)
- `-c model_reasoning_effort=<level>`: Override reasoning (low/medium/high/xhigh)
- `-C <workdir>`: Working directory (default: current)

### Examples

Basic code analysis:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=xhigh \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "explain @src/main.ts"
```

Refactoring with custom model:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=high \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "refactor @src/utils for performance"
```

Multi-file analysis:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=xhigh \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  -C /path/to/project \
  "analyze @. and find security issues"
```

---

## Capability 2: Web Search & Fetch

Online research with web search and page content fetching.

### When to Use

- Online research and documentation lookup
- Fetch and summarize specific web pages (GitHub repos, docs, articles)
- Current information retrieval
- API documentation search
- Technology comparison and recommendations

### Default Configuration

- Model: `gpt-5.3-codex`
- Reasoning: `high`
- Web search: enabled

### Command Pattern

```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=high \
  --enable web_search_request \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "<task>"
```

### Parameters

- `<task>` (required): Search query or research task
- `-m <model>`: Override model
- `-c model_reasoning_effort=<level>`: Override reasoning (low/medium/high/xhigh)
- `--enable web_search_request`: Enable web search (required for this capability)

### Alternative: Config File

Add to `~/.codex/config.toml`:
```toml
[features]
web_search_request = true
```

### Examples

Fetch GitHub repo:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=high \
  --enable web_search_request \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "Fetch and summarize https://github.com/user/repo"
```

Documentation search:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=high \
  --enable web_search_request \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "find the latest React 19 hooks documentation"
```

Technology research:
```bash
codex e -m gpt-5.3-codex -c model_reasoning_effort=high \
  --enable web_search_request \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "compare Vite vs Webpack for React projects in 2024"
```

---

## Session Resume

Both capabilities support session resumption for multi-turn conversations.

### Resume Command

```bash
codex e resume <session_id> "<follow-up task>"
```

### Example

```bash
# First session (code generation)
codex e -m gpt-5.3-codex -c model_reasoning_effort=xhigh \
  --dangerously-bypass-approvals-and-sandbox \
  --skip-git-repo-check \
  "add comments to @utils.js"
# Output includes: thread_id in JSON output

# Continue the conversation
codex e resume <session_id> "now add type hints"
```

---

## Notes

- Requires Codex CLI installed and authenticated
- `@file` syntax references files relative to working directory
- `@.` references entire working directory
- JSON output available with `--json` flag for programmatic use
- All commands use `--dangerously-bypass-approvals-and-sandbox` for automation
- Use `--skip-git-repo-check` to work in any directory

Overview

This skill provides a CLI integration named codex that performs deep code generation and online research. It exposes two capabilities: advanced code analysis and generation with high-reasoning models, and web search & fetch for live documentation and page summarization. Commands support session resumption and programmatic JSON output for automation.

How this skill works

The code generation capability runs model-driven analysis and transformations using high-reasoning models (default gpt-5.3-codex) and supports file references like @file and @. for whole-directory operations. The web search & fetch capability enables live web queries and page fetching when web_search_request is enabled, then summarizes or extracts information. Both capabilities accept model and reasoning overrides, produce JSON output, and support resuming multi-turn sessions via a session_id.

When to use it

  • Perform deep code analysis, multi-file refactors, or generate complex implementations requiring high reasoning.
  • Automate safety-controlled code generation and produce thorough explanations of existing code.
  • Fetch and summarize current web content: docs, articles, or GitHub repositories.
  • Compare technologies or search API documentation that requires up-to-date information.
  • Run iterative workflows that need session resumption across multiple CLI interactions.

Best practices

  • Reference files with @file and use @. to include the entire working directory for broad analysis.
  • Start code tasks with model_reasoning_effort=high or xhigh for complex reasoning; use lower levels for quick edits.
  • Enable web_search_request or set it in ~/.codex/config.toml when you need online research.
  • Use --json for machine-readable outputs and session IDs to resume multi-step workflows reliably.
  • Be mindful of automation flags; --dangerously-bypass-approvals-and-sandbox and --skip-git-repo-check are intended for automated environments.

Example use cases

  • Analyze an entire project for security issues: codex e ... "analyze @. and find security issues"
  • Refactor a utility folder for performance with explicit reasoning depth and model choice.
  • Fetch and summarize a GitHub repo or documentation page using web_search_request.
  • Iteratively add type hints across files by resuming a session using the returned session_id.
  • Compare build tools or libraries with up-to-date web research and summarized recommendations.

FAQ

How do I resume a conversation or continue a previous task?

Use codex e resume <session_id> "<follow-up task>" with the session_id returned in the JSON output from the prior run.

How do I enable web search for research tasks?

Add --enable web_search_request to the command or set web_search_request = true under [features] in ~/.codex/config.toml.