AI Coding Agents Skill
Expert knowledge for Codex CLI and Claude Code CLI — the two leading AI coding agents.
Note:
This skill documents both tools for reference. VMark development primarily uses
Claude Code CLI
. The Codex CLI sections are retained for completeness and cross-tool workflows.
When to Use
Orchestrating complex coding tasks via CLI
Configuring MCP servers for either tool
Setting up automation pipelines (CI/CD)
Troubleshooting authentication or sandbox issues
Comparing capabilities between agents
Custom agent/subagent configuration
Quick Reference
Starting Sessions
Task
Codex CLI
Claude Code CLI
Interactive session
codex
claude
With prompt
codex "fix the bug"
claude "fix the bug"
Non-interactive
codex exec "task"
claude -p "task"
Resume last
codex resume --last
claude -c
Resume by ID
codex resume
or
brew install --cask codex Authentication codex login
OAuth via ChatGPT
codex login --with-api-key
Read API key from stdin
codex login status
Check auth status
codex logout
Remove credentials
Core Commands codex - Interactive Mode codex
Start TUI
codex "fix all TypeScript errors"
With initial prompt
codex -i screenshot.png "explain"
With image
codex --full-auto "refactor"
Low-friction mode
codex --search "find docs"
Enable web search
codex exec - Non-Interactive codex exec "write tests"
Run and exit
codex e "task"
Short alias
echo "task" | codex exec -
From stdin
codex exec --json "task"
JSONL output
codex exec -o result.txt "task"
Save to file
codex exec --output-schema schema.json "task"
Validate output
codex resume - Continue Sessions codex resume
Interactive picker
codex resume --last
Most recent
codex resume --all
Show all (any directory)
codex resume < session-id
Specific session
codex resume < id
"continue with this"
With prompt
codex review - Code Review codex review
Review current branch vs main
codex review --uncommitted
Review uncommitted changes
codex review --base develop
Against specific branch
codex review --commit abc123
Review specific commit
codex review "focus on security"
Custom instructions
codex apply - Apply Cloud Task codex apply < task-id
Apply diff from cloud task
codex cloud - Cloud Tasks (Experimental) codex cloud
Browse cloud tasks
codex cloud exec "task" --env < env-id
Submit task
codex cloud status < task-id
Check status
codex cloud diff < task-id
Show diff
codex cloud apply < task-id
Apply changes
codex mcp - MCP Server Management codex mcp list
List servers
codex mcp list --json
JSON output
codex mcp get < name
Server details
codex mcp add < name
-- npx my-server
Add stdio server
codex mcp add < name
--url https:// .. .
Add HTTP server
codex mcp add < name
--env API_KEY = xxx -- cmd
With env vars
codex mcp remove < name
Remove server
codex mcp login < name
--scopes read,write
OAuth for HTTP
codex mcp logout < name
Remove OAuth
codex sandbox - Run Sandboxed Commands
macOS
codex sandbox macos -- npm test codex sandbox seatbelt --full-auto -- ./script.sh
Linux
codex sandbox linux -- npm test codex sandbox landlock -- ./script.sh codex completion - Shell Completions codex completion bash
~/.bashrc codex completion zsh
~/.zshrc codex completion fish
~/.config/fish/completions/codex.fish Slash Commands (Interactive) Command Purpose /model Switch model (gpt-5-codex, gpt-5, etc.) /approvals Change approval policy /compact Summarize conversation, free context /diff Show git diff /review Analyze working tree /status Show config and token usage /mcp List available MCP tools /mention Attach files /fork Branch conversation /resume Reopen previous session /new Fresh conversation /init Create AGENTS.md scaffold /feedback Submit logs/diagnostics /quit , /exit Exit CLI Configuration ( ~/.codex/config.toml ) model = "gpt-5-codex" approval_policy = "on-request" [ sandbox ] mode = "workspace-write" [ features ] web_search = true [ profiles.ci ] model = "gpt-4.1" approval_policy = "never" Global Flags -m, --model
Model selection -s, --sandbox read-only|workspace-write|danger-full-access -a, --ask-for-approval untrusted|on-failure|on-request|never -c, --config
Override config -C, --cd Working directory -i, --image Attach image(s) -p, --profile Config profile --full-auto Low-friction mode --yolo Bypass all safety (DANGEROUS) --search Enable web search --add-dir Grant additional write access --enable Enable feature flag --disable Disable feature flag --oss Use local OSS model Claude Code CLI (Anthropic) Installation npm install -g @anthropic-ai/claude-code Authentication claude
First run prompts login
claude setup-token
Set up long-lived token
Requires Claude Pro/Max subscription OR API key
Core Commands claude - Interactive Mode claude
Start REPL
claude "explain this project"
With prompt
claude -c
Continue last conversation
claude -r "session-name"
Resume by name/ID
claude --model opus
Select model
claude --chrome
Enable Chrome integration
claude --ide
Auto-connect to IDE
claude -p - Print Mode (Non-Interactive) claude -p "explain this function"
Query and exit
cat file | claude -p "explain"
Process piped input
claude -p --output-format json "q"
JSON output
claude -p --output-format stream-json "q"
Streaming JSON
claude -p --max-turns 3 "task"
Limit agent turns
claude -p --max-budget-usd 5 "task"
Spending limit
claude -p --json-schema '{...}' "q"
Validate output schema
claude mcp - MCP Server Management claude mcp list
List servers
claude mcp get < name
Server details
claude mcp add < name
< cmd
Add stdio server
claude mcp add -t http < name
< url
Add HTTP server
claude mcp add -e KEY = val < name
-- cmd
With env vars
claude mcp add -H "Auth: Bearer x" < name
< url
With headers
claude mcp add -s project < name
< cmd
Project scope
claude mcp remove < name
Remove server
claude mcp serve
Run as MCP server
claude mcp add-from-claude-desktop
Import from desktop app
claude mcp reset-project-choices
Reset approvals
claude plugin - Plugin Management claude plugin list
List plugins
claude plugin install < name
Install plugin
claude plugin install < name
@marketplace
From specific marketplace
claude plugin uninstall < name
Remove plugin
claude plugin enable < name
Enable disabled plugin
claude plugin disable < name
Disable plugin
claude plugin update < name
Update plugin
claude plugin validate < path
Validate manifest
claude plugin marketplace
Manage marketplaces
claude update - Self-Update claude update
Check and install updates
claude doctor - Diagnostics claude doctor
Check health/issues
claude install - Native Build claude install
Install native build
claude install stable
Specific version
claude install latest
Latest version
Slash Commands (Interactive)
Command
Purpose
/init
Generate CLAUDE.md
/clear
Reset context
/compact
Summarize conversation
/bug
Report issues
/doctor
Run diagnostics
/model
Switch model
/config
View/edit settings
/permissions
Manage permissions
/memory
View/edit memory
/project: user,project,local
--session-id
Restrict built-in tools
--allowedTools
Auto-approve tools
--disallowedTools
Remove tools from context
Permissions
--permission-mode
Codex: Use /compact to free context
In session: /compact
Claude: Use /compact or start fresh
claude --no-session-persistence -p "analyze src/" Multi-Directory Access
Codex
codex --add-dir .. /shared-lib --add-dir .. /config
Claude
claude --add-dir .. /shared-lib .. /config Structured Output Codex: codex exec --output-schema schema.json "generate API spec" Claude: claude -p --json-schema '{"type":"object","properties":{"name":{"type":"string"}}}' "extract data" Image Input Codex: codex -i screenshot.png "explain this UI" codex -i img1.png -i img2.png "compare these" Claude:
Via file reference in prompt
claude "analyze the image at ./screenshot.png" Session Forking
Codex: /fork in session
Claude
claude -r "session-id" --fork-session "try alternative approach" MCP Server Debugging Codex: codex mcp list --json | jq . Claude: claude --debug "mcp" --mcp-config ./mcp.json Troubleshooting Authentication Issues Problem Codex Claude Not logged in codex login status claude doctor Token expired codex logout && codex login claude setup-token API key issues Check OPENAI_API_KEY Check ANTHROPIC_API_KEY Sandbox Issues Problem Solution Permission denied Use --add-dir for specific directories Can't run commands Check sandbox mode, use workspace-write Network blocked Sandbox may block network; use danger-full-access carefully MCP Server Issues Problem Solution Server not found Check mcp list , verify installation Connection failed Check server logs, verify URL/command Auth required Use mcp login (Codex) or add headers (Claude) Performance Issues Problem Solution Slow responses Use lighter model (gpt-4.1-mini / haiku) Context overflow Use /compact to summarize High costs Set --max-budget-usd (Claude) Best Practices Start with read-only for exploration, escalate as needed Use sessions - resume work instead of starting fresh Create AGENTS.md/CLAUDE.md for project-specific instructions Leverage MCP servers for external integrations Use structured output in CI/CD for parsing Set spending limits with --max-budget-usd Review diffs before applying ( /diff , codex cloud diff ) Commit checkpoints before major changes