call-codex
Call Codex
Invoke OpenAI Codex CLI non-interactively to get a second opinion or critique, then present the result.
Command Pattern
cat <<'PROMPT' | codex exec --full-auto --skip-git-repo-check -o /tmp/codex_output.md -
<your prompt here>
Do NOT modify any files. Do NOT run any shell commands. Only output your analysis as text.
PROMPT
Then read /tmp/codex_output.md for the clean response.
Workflow
- Construct the prompt. Combine the user's request with relevant context (file contents, code snippets, error messages). Always append:
Do NOT modify any files. Do NOT run any shell commands. Only output your analysis as text. - Run the command. Use
cat <<'PROMPT' | codex exec --full-auto --skip-git-repo-check -o /tmp/codex_output.md -with the constructed prompt. Use single-quoted heredoc delimiter ('PROMPT') to prevent shell expansion. - Read the output. Read
/tmp/codex_output.mdfor Codex's response. The-ofile contains only the agent's final message (stdout includes session metadata). - Present the result. Summarize or relay Codex's response to the user. If the user asked for a comparison, contrast Codex's view with your own.
Key Flags
| Flag | Purpose |
|---|---|
exec |
Non-interactive subcommand (required for scripted use) |
--full-auto |
Skips confirmation prompts (alias for -a on-request --sandbox workspace-write) |
--skip-git-repo-check |
Run outside or independent of current git repo |
-o /tmp/codex_output.md |
Write final message to file for clean reading |
- (trailing) |
Read prompt from stdin (avoids shell quoting issues) |
Optional Flags
-m <model>to override the default model (default:gpt-5.4)-C /pathto set a different working directory for Codex
Example
User asks: "Ask codex to review my sort function in utils.py"
- Read
utils.pyto get the sort function code - Run:
cat <<'PROMPT' | codex exec --full-auto --skip-git-repo-check -o /tmp/codex_output.md -
Review the following Python sort function for correctness, efficiency, and style:
```python
<contents of the sort function>
Do NOT modify any files. Do NOT run any shell commands. Only output your critique as text. PROMPT
3. Read `/tmp/codex_output.md`
4. Present Codex's feedback to the user
## Important Notes
- Always include the safety instruction ("Do NOT modify any files...") since `--full-auto` grants write access to the sandbox.
- Use single-quoted heredoc delimiter `'PROMPT'` to prevent `$variable` expansion and `` `backtick` `` execution in the prompt text.
- If `codex` is not found, inform the user to install it (`brew install codex` or see OpenAI docs).
- Token usage is printed to stdout at the end of the session.
More from touricks/fanshi_personal_skills
study-notes-generator
Transform documents into interactive HTML study notes with key concepts, problem-solution pairs, examples, and self-quiz questions. Use when asked to create study notes, summarize lecture slides, or generate learning materials from documents in slides/ folder. Output goes to notes/ folder.
9scientific-slides
Build slide decks and presentations for research talks. Use this for making PowerPoint slides, conference presentations, seminar talks, research presentations, thesis defense slides, or any scientific talk. Provides slide structure, design templates, timing guidance, and visual validation. Works with PowerPoint and LaTeX Beamer.
7langgraph
Expert in LangGraph - the production-grade framework for building stateful, multi-actor AI applications. Covers graph construction, state management, cycles and branches, persistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern. Used in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended approach for building agents. Use when: langgraph, langchain agent, stateful agent, agent graph, react agent.
6humanizer-zh
去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。基于维基百科的\"AI 写作特征\"综合指南。检测并修复以下模式:夸大的象征意义、宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段式法则、AI 词汇、否定式排比、过多的连接性短语。
6docx
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
6ml-paper-writing
Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.
6