前言
笔者最近在高强度的使用AI Coding,在使用过程中发现一些隐藏/实验性功能,并不会默认开放但又很好用,故此记录并分享给需要的人。本篇主要包含个人收集的资料、官方文献以及我正在使用的配置文件,分享给大家参考,欢迎评论区探讨交流。
参考资料
官方Wiki,最权威的资料渠道
非常好用的文档中文站,我对比过,是官方英文版的中文翻译版本,翻译内容基本准确,需要关注左上角显示的最新翻译日期
Codex Docs | App、CLI、IDE 与 Config
其他博客
[分享] Codex + GPT 5.4 火力全开配置调优 - V2EX
关于配置文件
Codex 会从多个位置读取配置。你的个人默认配置位于 ~/.codex/config.toml,也可以通过 .codex/config.toml 为项目添加覆盖配置。出于安全考虑,Codex 只会在你信任该项目时加载项目级 .codex/ 配置层。
配置文件内容示例
config.toml
bash
model = "gpt-5.4"
review_model = "gpt-5.4" # 默认 "gpt-5.2-codex"
model_reasoning_effort = "high"
# 增加上下文大小,结合额度使用,Pro订阅推荐开
# model_context_window = 1000000 # 模型上下文窗口大小,最高 1000000 ( 1M ) for gpt-5.4
# 自动压缩上下文上限,gpt-5.4之后虽然支持 1M ,但是有效注意力不够,不建议开的太高
# model_auto_compact_token_limit = 500000
[features]
shell_tool = true # 启用 shell 工具。默认: true
shell_snapshot = true # 启用 shell 快照功能。默认: false
undo = true # 启用 undo 功能。默认: true
unified_exec = true # 使用统一 PTY 执行工具
multi_agent = false # 结合额度使用,Pro订阅推荐开
prevent_idle_sleep = true
memories = true # 开启记忆
fast_mode = false # 结合额度使用,Pro订阅推荐开,会让 gpt-5.4 用量变 2 倍
[memories] # 强烈建议用新模型来总结 memories,省token用mini,Pro可以考虑 gpt-5.4
extract_model = "gpt-5.4-mini"
consolidation_model = "gpt-5.4-mini"
# generate_memories = true # 默认 true
# use_memories = true # 默认 true ,表示把 memory_summary.md 注入 developer instructions
max_raw_memories_for_consolidation = 64 # 默认256,节省token则使用64 或 128,Pro用户可以256
no_memories_if_mcp_or_web_search = true # 一定要开,不然token爆炸
max_unused_days = 30 # 默认 30
max_rollout_age_days = 30 # 默认 30
# max_rollouts_per_startup = 16 # 默认 16
# min_rollout_idle_hours = 6 # 默认 6
[windows]
sandbox = "elevated"