본문으로 건너뛰기
Skillpedia
일반 코딩48k · #6263

codex-subagent

하는 일

이 도구는 Codex CLI(명령줄 코딩 도구)를 사용해 특정하고 독립적인 코딩 작업을 실행하게 해 줍니다. 프로젝트의 다른 부분에 간섭하지 않고 명확히 정의된 코드 작업을 AI에게 맡길 때 유용합니다.

사용하는 경우

  • ✓특정 파일의 특정 버그를 AI가 수정해야 할 때.
  • ✓코드에 작은 기능을 추가하고 싶을 때.
  • ✓코드의 일부를 AI가 검토해서 올바른지 확인해야 하는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/codex-subagent/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/codex-subagent/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“`auth.py`의 로그인 함수 버그를 고쳐 주시고, 끝나면 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 별도의 환경에서 Codex CLI를 실행합니다. 무엇을 할지 명확한 지시를 제공하면 Codex CLI가 작업을 시도하고 최종 결과를 돌려줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Codex CLI as a Subagent

When to Use

  • Use when a bounded coding, review, or verification task can run in a separate Codex CLI session.
  • Use when parallel work needs explicit file ownership and a clear definition of done.

Codex CLI is OpenAI's terminal coding agent. codex exec runs it non-interactively: it works autonomously in a sandbox, streams progress to stderr, and prints only the final message to stdout. Auth reuses the user's ChatGPT subscription — never an API key.

When to delegate

  • Self-contained coding task with clear success criteria (fix, feature, refactor, review).
  • Parallel work: several independent tasks at once (see Parallel runs).
  • Second opinion / independent verification of your own changes.

Do NOT delegate tasks that need conversation context you can't fully write into the prompt.

Preflight

codex --version       # missing? npm i -g @openai/codex  (or: brew install --cask codex)
codex login status    # exit 0 + "Logged in using ChatGPT" = ready

Not logged in → stop and tell the user to run codex login (one-time browser OAuth). Never read, print, or copy credentials (~/.codex/auth.json).

Launch

OUT=$(mktemp /tmp/codex-out.XXXXXX)
codex exec \
  --cd /path/to/repo \
  --sandbox workspace-write \
  --output-last-message "$OUT" \
  "Full task prompt: goal, constraints, files to touch, definition of done." \
  </dev/null
  • </dev/null is MANDATORY when stdin is not a real terminal (background shells, scripts): codex treats open stdin as extra context and waits forever for EOF.
  • Codex sees NOTHING of your conversation. Put all context in the prompt: goal, relevant paths, constraints, and how to verify it's done.
  • Long prompt? Pipe it via stdin instead: codex exec [flags] - < /tmp/task.md.
  • Wrap the command in a background/Bash subagent if your host agent has one (Cursor: Task tool with a shell subagent) so Codex's verbose stream stays out of the parent context. Fallback: a plain background terminal.
  • Runs take minutes and have no built-in timeout — background it and monitor.
  • Optional: -m <model> to override the model, --json for JSONL event stream.

Collect results

cat "$OUT"                            # final message = the deliverable
git -C /path/to/repo status --short   # see what Codex actually changed

Follow-up in the same session (run from the same cwd — resume filters by cwd):

codex exec resume --last "follow-up instruction" </dev/null

Parallel runs

Parallelize only genuinely independent tasks, and assign file ownership upfront so results merge cleanly. One git worktree per Codex run — never two in the same tree:

git worktree add /tmp/wt-taskA -b codex/task-a
codex exec --cd /tmp/wt-taskA --sandbox workspace-write -o /tmp/outA.md "task A" </dev/null

Failure modes

  • Hangs forever with no output → stdin was left open. Kill it, relaunch with </dev/null.
  • codex login status non-zero → the user must run codex login. Don't work around it.
  • ChatGPT plan rate limit hit → report to the user; never retry in a loop.
  • "Not a git repo" error → add --skip-git-repo-check, or init a repo first.
  • Network is blocked inside the workspace-write sandbox by default. If the task needs it (installs, API calls): -c sandbox_workspace_write.network_access=true.
  • NEVER use --dangerously-bypass-approvals-and-sandbox.

Rules

  • One task per launch. Split big jobs into multiple launches.
  • Review Codex's diff yourself before declaring the task done.

Cursor-native wrapper (optional)

For auto-routing and /codex invocation inside Cursor, add ~/.cursor/agents/codex.md — a custom subagent whose description is "delegates coding tasks to Codex CLI" and whose body points at this skill.

Limitations

  • Adapted from davidondrej/skills; verify local paths, tools, credentials, and agent features before acting.
  • For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
자주 묻는 질문

Codex CLI란 무엇인가요?

OpenAI가 만든 명령줄 도구로, 코드를 자율적으로 작성하고 검토하도록 돕습니다.

특별한 계정이 필요한가요?

ChatGPT 계정에 로그인되어 있어야 합니다. 도구는 기존 구독을 사용하므로 API 키는 필요하지 않습니다.

여러 작업을 한 번에 요청해도 되나요?

AI가 집중하고 기대한 결과를 내도록 한 번에 한 작업만 요청하는 것이 가장 좋습니다.

상세 정보

작성자의 원본 설명

Launch Codex CLI as an isolated subagent for bounded coding, review, or verification tasks.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#6263
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬