Claude CodeからOpen AI Codexに乗り換えたので、初期設定を簡単にメモしておく。
やったこと
以下を作成した。
~/.codex/config.toml-> toml形式でMCPを含めた各種configurationを書くファイル~/.codex/AGENTS.md->claude.md風にsystem prompt的な要望を書くファイル
公式ドキュメント
config.toml
以下のブログを参考に作成した。Context7 MCPも、これを機に使ってみる。
config.toml
model = "gpt-5-codex" model_reasoning_effort = "high" hide_agent_reasoning = true network_access = true [tools] web_search = true [mcp_servers.context7] command = "npx" args = ["-y", "@upstash/context7-mcp@latest"]
(2025/11/01)
後日、以下のように修正した。web_search はdeprecatedとなった様子。
# https://zenn.dev/dely_jp/articles/codex-cli-matome model = "gpt-5-codex" # https://www.docswell.com/s/rakutek/KJQYQM-2025-09-codex#p13 model_reasoning_effort = "medium" hide_agent_reasoning = true # https://www.docswell.com/s/rakutek/KJQYQM-2025-09-codex#p25 sandbox_mode = "read-only" approval_policy = "on-request" network_access = true [features] # https://zenn.dev/sencorp/articles/06270347f7792d web_search_request=true [mcp_servers.context7] command = "npx" args = ["-y", "@upstash/context7-mcp@latest"]
AGENTS.md
お試し的にお願い事項をいくつか書いてみた。うまく動くようなら、内容を充実させていく。
※英文はGeminiに添削してもらった。
AGENTS.md
## Direct and Formal - Please speak to me in Japanese. - I am an IT engineer, and I prefer strictly accurate and precise language, even if it results in redundancy. - When speaking to me, please clearly separate facts from the observations and inferences derived from them. ## Python tips - Switch to uv instead of relying on separate tools like pip and venv. ## AWS Severless Application Model Tips - Always run 'sam validate --lint' after modifying your template.yaml or samconfig.toml to ensure your changes are working correctly.