codex
Use Codex CLI as a bounded coding agent for repo exploration, implementation, review, and session resume.
- License 许可
- Apache-2.0
- 所属仓库
- ncmlabs/forge
- 最近更新
- 2026-10-16
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- codex
- timeout
- 1800
- description
- Use Codex CLI as a bounded coding agent for repo exploration, implementation, review, and session resume.
- capabilities
- [ { "name": "explore", "inputs": [ "Text", "Text" ], "output": "Text" }, { "name": "implement", "inputs": [ "Text", "Text", "Text" ], "output": "Text" }, { "name": "review", "inputs": [ "Text", "Text" ], "output": "Text" }, { "name": "resume_session", "inputs": [ "Text", "Text" ], "output": "Text" } ]
- allowed-tools
- [ "Bash(codex:*)" ]
03 SKILL.md 正文
Codex CLI Skill
Use this skill when FORGE needs to delegate coding work to Codex CLI.
Default operating pattern:
- Explore in read-only sandbox mode.
- Implement with bounded automatic execution.
- Verify with deterministic checks.
- Resume by session id when follow-up is needed.
Codex currently exposes its machine-readable interface as JSONL events. Treat the event stream as canonical and derive the final result from the last assistant message plus terminal usage events.
Capabilities
explore(prompt, repo_path)
Use for read-only planning and repo analysis.
Preferred command:
codex exec --json --sandbox read-only "$PROMPT"
Expected behavior:
- no file edits
- command execution restricted by sandbox mode
- progress available via
item.startedanditem.completed
implement(prompt, repo_path, verify_cmd)
Use for bounded code changes.
Preferred command:
codex exec --json --full-auto "$PROMPT"
Prompt requirements:
- specify the target repo and allowed scope
- require minimal edits
- name the verification command
- require a final summary of what changed and what passed
Expected behavior:
- Codex may edit files and run shell commands
- progress is visible through JSONL events
- final answer is delivered as the last assistant message
review(prompt, repo_path)
Use for read-heavy verification.
Preferred command:
codex exec --json --sandbox read-only "$PROMPT"
Review prompts should ask for:
- findings first
- concrete file references
- missing verification
- residual risk
resume_session(session_id, prompt)
Use to continue a prior noninteractive session.
Preferred command:
codex exec resume "$SESSION_ID" "$PROMPT" --json
The CLI also supports:
codex exec resume --last "$PROMPT" --json
Session Adapter Mapping
| FORGE session field | Codex CLI |
|---|---|
prompt |
positional prompt |
agent = "codex" |
codex exec |
tools |
no direct allowlist flag |
workdir |
process working directory or --cd |
timeout |
managed by FORGE wrapper |
budget |
no direct cost-cap flag observed |
resume |
codex exec resume <session-id> [prompt] --json |
output_mode |
--json |
| analysis mode | --sandbox read-only |
| bounded edit mode | --full-auto |
AgentResult Mapping
Map the JSONL stream into AgentResult as follows:
| Codex event or field | AgentResult field |
|---|---|
thread.started.thread_id |
session_id |
final assistant item.completed |
output |
turn.completed.usage.input_tokens |
tokens_in |
turn.completed.usage.output_tokens |
tokens_out |
| command execution items | progress_events |
| failed command items | progress metadata or error if terminal |
Important limitation:
- Current
codex exec --jsondoes not emit a single terminal object equivalent to Claude'sresultschema. - Cost is not directly exposed in the observed JSONL event stream.
Safety Rules
- Use
--sandbox read-onlyfor exploration and review. - Use
--full-autoonly for bounded implementation tasks. - Do not rely on prompt-only tool restrictions; Codex does not currently expose a Claude-style
--allowedToolssurface. - Prefer one implementer session plus a separate reviewer session over parallel editing sessions.
04 同仓库更多 Skills
greeter
Greet a person by name.
git_analysis
Deep agentic analysis of git repository health and trends
write-forge
Writing, checking or running FORGE `.forge` programs — the authoring loop, the CLI's JSON envelope and exit codes, and the syntax and checker mistakes that break agents. Use when a task asks for a FORGE program or `.forge` file, names FORGE tasks/flows/agents/pools/wardens, or when the project has a forge.project.toml.
slack
Slack operations via the Web API — messages, channels, threads, reactions, and approvals.
ollama
Use Ollama local inference for text generation, classification, and analysis via local GPU models.
github
GitHub operations via the gh CLI — issues, PRs, branches, and CI checks.