/hey-codex:hey-codex [task description]from hey-codex
Delegate tasks to the Codex CLI. Use for requests that hand off or delegate work to the Codex CLI, including "codex", "codex한테", "codex로", "코덱스", "codex 시켜", "codex에게", "codex delegate".
Ships in hey-codex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Delegate tasks to the OpenAI Codex CLI and handle the results. Respond to the user in Korean.
Check whether the codex CLI is installed using the helper script:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/preflight.sh"
Strip trigger phrases:
For natural-language triggers, remove the following pattern from the prompt:
codex(한테|에게|로|가)?\s*(시켜|해줘|해봐|부탁)?
For slash commands (/hey-codex), use the argument as-is.
Set the working directory:
Set the working directory with the Codex CLI's --cd flag rather than injecting it as text into the prompt.
Analyze the prompt to decide the execution mode.
| Mode | Codex command | Description |
|---|---|---|
| read | codex exec | Analysis, review, explanation (read-only) |
| review | codex review | Code review only (when review keywords are detected) |
| suggest | codex exec | Suggestion/advice request (applied by Claude Code) |
| write | codex exec --full-auto | Create/modify/delete files (Codex modifies directly) |
Priority: write > suggest > read (default)
Full keyword table: references/mode-detection.md
Check whether .git exists (Bash: test -d .git)
├─ Yes → run without restriction
└─ No + write mode →
Ask the user to confirm:
"현재 디렉토리는 Git 저장소가 아닙니다.
Codex가 파일을 직접 수정합니다. 롤백이 불가능할 수 있습니다.
계속하시겠습니까? (y/N)"
├─ y → run
└─ N or no response → cancel
└─ No + read/suggest → run as-is
Run via the codex-run.sh wrapper, invoked with run_in_background: true. The wrapper handles PID tracking, completion waiting, and process-output.sh post-processing automatically. Remember the SESSION=<TOKEN> on the first output line for status checks.
read/suggest mode:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh" exec "$(pwd)" "프롬프트"
Bash tool: run_in_background: true (no timeout)
review mode (when review keywords are detected):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh" review "$(pwd)"
Bash tool: run_in_background: true (no timeout)
write mode (git repo):
# Step 1: check git status (plain Bash call)
git status --short
# Step 2: run codex (background)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh" exec-full-auto "$(pwd)" "프롬프트"
Step 2 Bash tool: run_in_background: true (no timeout)
write mode (non-git):
# Step 1: pre-snapshot (plain Bash call)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot-diff.sh" pre .
# Step 2: run codex (background)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh" exec-full-auto "$(pwd)" "프롬프트" --skip-git-repo-check
Step 2 Bash tool: run_in_background: true (no timeout)
After the completion notification:
# Step 3: post-snapshot (plain Bash call)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot-diff.sh" post .
Status check (optional, for long runs):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-status.sh" <SESSION_TOKEN>
Output: RUNNING (PID=..., output=Nlines) | COMPLETED | FAILED (exit code: N) | CRASHED
Do not use a leading sleep chain such as
sleep 30 && tail -f <raw.txt>— the Bash tool blocks it. Background completion is delivered via an automatic notification, so polling is not needed. If you must wait, callcodex-status.shonce on its own, or use theMonitortool withuntil <check>; do sleep 2; done. To peek at a log file, runtail -N <path>on its own rather than chaining it aftersleep.
Per-mode post-processing strategy: references/output-handling.md
read mode: Show the Codex output to the user and stop (one-way).
suggest mode:
write mode (git):
git diffgit diff --stat depending on the number of changed filesgit checkout . rollback optionwrite mode (non-git):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot-diff.sh" post .
| Output size | Handling |
|---|---|
| < 50 lines | Show verbatim |
| 50~200 lines | Summarize + offer to show full output |
| > 200 lines | Summarize + save to /tmp/codex-output-$(date +%s).txt |
| Situation | Handling |
|---|---|
| Codex not installed | Guide with npm install -g @openai/codex |
| API auth failure (auth/key error in stderr) | Show "API 키를 확인해주세요" |
| Process failure (exit code ≠ 0) | Check status with codex-status.sh, show stderr, then decide whether to retry |
| Long-running execution | Check progress with codex-status.sh <SESSION_TOKEN> |
| Empty output | Show "Codex가 결과를 반환하지 않았습니다" |
| Large write-mode change (6+ files) | git diff --stat summary + rollback option |
codex exec subcommand (interactive mode is not usable from the Bash tool).codex-run.sh wrapper with run_in_background: true. There is no fixed timeout. To check status, run codex-status.sh as a separate Bash call.references/mode-detection.md — 모드 판별 키워드 테이블 (LLM이 참조)references/output-handling.md — 결과 처리 전략${CLAUDE_PLUGIN_ROOT}/scripts/preflight.sh — codex CLI 설치 확인${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh — codex 실행 래퍼 (PID 추적 + 완료 대기 + 후처리)${CLAUDE_PLUGIN_ROOT}/scripts/codex-status.sh — 프로세스 상태 확인 (RUNNING/COMPLETED/FAILED)${CLAUDE_PLUGIN_ROOT}/scripts/process-output.sh — ANSI 스트립 + 줄 수 측정 + 대용량 저장${CLAUDE_PLUGIN_ROOT}/scripts/snapshot-diff.sh — non-git 디렉토리 스냅샷 생성/비교What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub oozoofrog/oozoofrog-plugins --plugin hey-codex