kylesnowschwartz/simpleclaude/external-agents
Claude Code and agent skill by kylesnowschwartz/simpleclaude
- community
Checking that the SKILL.md file is still in the repository.
Invoke external AI CLIs (Codex, Gemini) for second opinions, code reviews, or alternative analysis. This skill SHOULD be used when the user asks for a "second opinion", "outside review", says "ask codex", "ask gemini", "run codex", "run gemini", "get another AI's take", or needs verification from a different model.
Install
npx vskill@latest install kylesnowschwartz/simpleclaude/external-agentsSKILL.md
External AI CLIs: Codex & Gemini
Run OpenAI Codex CLI or Google Gemini CLI for second opinions and external reviews.
Critical Rules
- Run CLIs directly via Bash. Subagents cannot approve Bash permissions interactively, so the command gets denied.
run_in_background: trueis fine for long runs.
- End every non-interactive `codex` call with `</dev/null` unless you pipe content in. When stdin is not a terminal,
codex execreads it and waits for end of file before it starts, so an inherited pipe that never closes hangs it with no output. Piping content in on purpose works: when stdin is piped and a prompt is also given, codex appends stdin to the prompt as a<stdin>block.
- Capture the final message and stderr. Pass
-o <file>for the final message and redirect stderr to a file (2><file>). Thesession id:line you need to resume a run is printed on stderr, not stdout. Check that the-ofile exists before reading it.
- Pair every read-only Codex call with `-c 'approval_policy="never"'`. The sandbox alone does not block writes: when the user's
~/.codex/config.tomlsetsapproval_policy = "on-request", Codex can ask to run a command outside the sandbox, and an approved request writes files. With the policy set tonever, Codex cannot escalate and writes fail with "operation not permitted".codex execandcodex exec resumehave no-aflag, so-cis the only way to set it.
Prerequisites
| Tool | Install | Config | |
|---|---|---|---|
| Codex | npm install -g @openai/codex | codex login / ~/.codex/config.toml | |
| Gemini | brew install gemini-cli | Google auth / ~/.gemini/settings.json |
Check availability: codex --version / gemini --version
When to Use
- User wants a second opinion from a different AI model
- Code review from an external perspective
- Verification of an approach or architecture
- User explicitly requests codex or gemini
Models
Codex
Use the default model from ~/.codex/config.toml (model = "..."). Pass -m <model> only when the user names a model.
Codex uses stored OAuth tokens (~/.codex/auth.json) from codex login — no env var needed.
Gemini
| Model | Use Case | |
|---|---|---|
gemini-3.1-pro-preview | Best. Latest model (Feb 2026). Requires previewFeatures: true. | |
gemini-3-pro-preview | Previous generation preview. | |
gemini-3-flash-preview | Faster, good for quick checks. | |
gemini-2.5-pro | Stable GA fallback if preview models have capacity issues. | |
gemini-2.5-flash | Fast GA fallback. |
Always pin the model with `-m` in non-interactive/headless calls. The user's ~/.gemini/settings.json may use auto-gemini-3 routing, which can select Flash for prompts it classifies as "simple" — not what you want for code reviews.
If you hit 429 MODEL_CAPACITY_EXHAUSTED on preview models, fall back to -m gemini-2.5-pro. This is a server capacity issue (not quota) and mostly affects oauth-personal auth. Enterprise API key (gemini-api-key auth with billing) has better capacity allocation.
Set default in ~/.gemini/settings.json:
Codex CLI
Subcommands
| Command | Purpose | |
|---|---|---|
codex review | Git-aware code review (non-interactive) | |
codex exec | Non-interactive prompt execution | |
codex exec resume <id> | Send a follow-up prompt to an earlier codex exec session | |
codex resume | Resume previous interactive session | |
codex apply | Apply latest agent diff via git apply |
Code Review (most common use)
codex review has no -s flag, so the examples set the sandbox and approval policy with -c.
Important: codex review treats --base, --uncommitted, --commit, and [PROMPT] as mutually exclusive modes. You cannot combine a custom prompt with --base or --uncommitted. To review with custom instructions, pipe the diff into codex exec, or save it to a file and name the file in the prompt.
Non-Interactive Execution
Use -s read-only together with -c 'approval_policy="never"' for reviews, questions, and analysis. Use -s workspace-write only when Codex must change files in the repository.
Follow-up questions
Resume the same session by its id, so Codex keeps the context of the first run. Take the id from the session id: line in the stderr file. Use the explicit id rather than --last when several Codex runs may be active.
A resumed session does not inherit the first run's sandbox or model: it falls back to ~/.codex/config.toml, which may allow writes and network access. Pass the sandbox with -c sandbox_mode=... (resume has no -s flag), set -c 'approval_policy="never"' so the resumed run cannot escalate out of the sandbox, and pass -m again if the first run used it.
The sandbox: line in the stderr file shows the sandbox the resumed run used. A resumed run that was not given approval_policy="never" can write outside a read-only sandbox when the user's config allows approval requests. codex exec resume accepts -o and --json. It has no -C flag. Outside a git repository, run it from the same directory as the first run and add --skip-git-repo-check.
Key Flags
| Flag | Purpose | |
|---|---|---|
-m, --model <MODEL> | Model selection; omit it to use the config.toml default | |
-c key=value | Override config (TOML format). Read-only calls set -c 'approval_policy="never"'; exec resume and review also set -c 'sandbox_mode="read-only"' | |
-s, --sandbox <MODE> | read-only (reviews and analysis; pair with approval_policy="never"), workspace-write (edits inside the repository), danger-full-access | |
-C, --cd <DIR> | Set the working root. Not needed when the shell is already in the repository. Outside a git repository, also pass --skip-git-repo-check | |
--skip-git-repo-check | Allow running outside a git repository | |
--json | JSONL event output (exec only) | |
-o, --output-last-message <FILE> | Write last message to file (exec and exec resume) |
Gemini CLI
Non-Interactive (Headless)
Interactive
Key Flags
| Flag | Purpose | |
|---|---|---|
-m, --model <MODEL> | Model selection | |
-p, --prompt <TEXT> | Non-interactive (headless) mode | |
-i, --prompt-interactive <TEXT> | Run prompt then stay interactive | |
-y, --yolo | Auto-approve all actions | |
--approval-mode <MODE> | default, auto_edit, yolo | |
-r, --resume <ID> | Resume session (latest or index) | |
--include-directories <DIRS> | Additional workspace directories | |
-o, --output-format <FMT> | text, json, stream-json |
Usage Patterns
Get a Second Opinion on Changes
Review a Design Decision
Review a Branch Before PR
Troubleshooting
Gemini: GEMINI_API_KEY not found
Gemini with gemini-api-key auth reads GEMINI_API_KEY from the environment. If the key is managed by direnv, it's only available when direnv loads the .envrc that exports it. A child directory with its own .envrc shadows the parent without inheriting — so the key can be missing depending on which directory the session runs from.
Pre-flight check (run before any Gemini invocation):
If unset, tell the user and skip Gemini. Codex does not have this problem — it uses stored OAuth tokens from codex login.
Gemini: stdin bug
cat file | gemini -p "..." fails with "Cannot use both a positional prompt and the --prompt flag together." Gemini's arg parser treats cat-piped stdin as a positional argument conflicting with -p. Use < file redirection instead: gemini -m MODEL -p "prompt" < /path/to/file. This works correctly.
Gemini: headless tool trust bug
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/sc-skills/skills/external-agents/SKILL.md
Popularity
- Repository stars
- 103
- Repository forks
- 15
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kylesnowschwartz/simpleclaude/external-agents)