Are there any future plans to support a basic subset of tools beyond `shell`
What feature would you like to see?
Background
Every other coding agent—CLI-based or not—exposes a base subset of tools for basic operations like reading files, (over)writing files, editing files, grepping, and globbing.
Codex is unique in this regard because it only exposes one practical tool for getting work done: shell. Even apply_patch is called via shell.
Why dedicated tools
Advantages
- Unified read: A dedicated
readtool could let the model read images, PDFs and text through a single interface. It could also read whole files in one call instead of dealing with the current head + tail elision you get from shell output (truncation after ~10 kilobytes or 256 lines). That forces the model to read files in chunks, which can make it miss important info and not realize crucial cascading changes when it could’ve read the whole file at once and get all the context it needs. It also reduces costs because this would be a single tool call instead of many. Obviously, there would be length limits to avoid blowing up the models context and an ability to only read snippets via the tool. - Cross‑platform sanity: Giving the agent a few purpose tools for extremely common operations (e.g., grepping) means the only command it would likely need to execute is git-related or directory listing.
- No ripgrep bundling hack: A dedicated
grepandglobcould remove the need to bundleripgrepwith Codex and add its directory to PATH. Since this project already uses Rust, implementing anrgandrg --filesequivalent with the useful features (I’ve never seen the model use more than a few specific flags) is not akin to boiling the ocean.
Problems with adding additional tools
- Overfitting to the Codex shell flow:
gpt-5-codexin my testing is incredibly overfitted to the shell-only way of doing things and is acutely aware of shell truncation despite that not being present in the system prompt, which shows it was specifically heavily fine-tuned with the Codex shell flow in mind.gpt-5also appears to be slightly overfitted. This ultimately means the models may be slightly reluctant to adopt the tools, but I'm hopeful this isn't the case.
Proposal
read(path, offset, limit)— Supports text, PDFs and images. Reads whole files in a single call by default.write(path, content)— Writes/overwrites the file. (Maybe add a safeguard that a file must be read before overwriting to avoid mishaps.)apply_patch(patch)— Keep the capability but transition it to a dedicated tool instead of going throughshell.glob(pattern, path)— Search for files (anrg --filesequivalent).grep(...)— Equivalent torgwith useful parameters: output mode (content, files with matches, etc.), a toggle for line numbers, glob pattern, etc. I have a version with full parity on ~15 useful parameters (based on how the models actually usergand other agents’ tools); in practice I’ve only seen the model use ~8–9 of them.
Bottom line
Overall, giving the model a few different tools for the most common operations will cut cost, avoid truncation-related mistakes, smooth cross-platform differences, and remove PATH/ripgrep hacks while keeping things simple and inline with the status quo of coding agents nowadays
Are you interested in implementing this feature?
I've already implemented the grep and glob tool backend (grep with many useful rg parameters, very similar to the tool Claude Code has access to but it is in full parity with rg as I use ripgrep's underlying crates like grep). Extensive unit tests are in place with all major combination of parameters ensuring exact output parity with the rg command.
The grep and glob tool logic is by far the hardest parts, implementing these as tools (along with the other few tools to add) and making a few changes to the system prompt (like instructing the model to prefer reading in chunks when searching for specific code to avoid blowing up the context) is a modest challenge.
Additional information
_No response_
7 Comments
now sure if it helps but for me personally have i have been starting the chat with my prompt +
You MUST follow these rules (Git Bash default):
PLANNING + REAL‑TIME TODOs
PARALLEL DISCOVERY MINDSET
TOOL‑FIRST EDITING (NO SHELL MUTATIONS)
EXPLORATION AND SEARCH
SHELL USAGE (RUN SCRIPTS ONLY, GIT BASH)
STATUS, LINTS, OUTPUT
PARALLELIZE BY DEFAULT
REPO HYGIENE
If any rule conflicts, prioritize: apply_patch/edit_file > tool‑first edits > parallel discovery > Git Bash for scripts > no shell text mutations.
DO: Set terminal profile to Git Bash; run commands via bash -lc "cd <dir> && <cmd>"
DON’T: Use PowerShell as the default terminal
DO: Install rg and jq; prefer rg/rg --files for searches; jq for JSON inspection
DON’T: Use find/grep (slow/limited) or parse JSON with sed/awk
DO: Paste this prompt that enforces apply_patch/edit_file, parallelization, and no shell mutations
DON’T: Start sessions without it or allow ad‑hoc shell edits
DO: Edit tracked code via apply_patch; if it fails 3x, use edit_file
DON’T: Use Python/Perl/sed/awk/PowerShell to mutate repo files
DO: read_file the target before editing (re‑read if stale or after failures)
DON’T: Assume file content hasn’t changed since last read
DO: Use codebase_search for “how/where” questions; grep for exact symbols; glob_file_search to find names
DON’T: Grep the whole tree for vague phrases or read_many files blindly
DO: Use multi_tool_use.parallel for independent read_file/grep/codebase_search calls
DON’T: Run sequential tool calls when outputs don’t depend on one another
DO: Use read_file offset/limit for big files; widen context only where necessary
DON’T: Pull entire massive files when only portions are needed
DO: Use run_terminal_cmd to run project scripts (e.g., bash -lc "cd scripts && python build_common_drug_mapping.py")
DON’T: Use run_terminal_cmd to edit files or perform shell text substitutions
DO: Edit via editor tools; regenerate outputs from scripts
DON’T: Use sed/awk/Python/Perl to rewrite tracked files
DO: Track multi-step work with todo_write; one in_progress; mark complete immediately; brief 1–3 sentence updates
DON’T: Skip status or leave todos stale across steps
DO: Use code references for existing code and fenced blocks for new code
DON’T: Paste giant blobs or mix formats
DO: Set is_background=true for servers/watchers
DON’T: Block the session with foreground long jobs
DO: Return high‑signal, skimmable info; link to code references
DON’T: Dump full file contents or verbose logs
Examples
multi_tool_use.parallel over:
• codebase_search: “Where are SIG_* composed?”
• grep: "SIG_.*" in scripts/build_common_drug_mapping.py
• glob_file_search: "build_mapping.py"
read_file target → apply_patch minimal diff → read_lints on that file
If errors: fix via apply_patch (≤3 tries), else edit_file fallback
Avoid: bash -lc "sed -i 's/foo/bar/' scripts/build_common_drug_mapping.py"
Instead: apply_patch the specific lines
bash -lc "cd scripts && python build_common_drug_mapping.py"
DON’T: Regenerate via pseudo-scripts in messages; always run the real script
Priority if conflicts: apply_patch/edit_file > tool-first (grep/glob/codebase_search/read_file) > parallelize > Git Bash for scripts > no shell text mutations.
Not everything is needed here but on windows especially it does get annoying at times so i just use this
also very anecdotal but what i found is to use the above prompt intially with gpt and then codex models will apply patch after i switch in the same chat window
@editnori your prompt seems to contain instructions tailored towards Claude Code or some kind of other coding agent because Codex only actually has a few tools calls:
shell,update_planandview_image.@fouad-openai @ae-openai @pakrym-oai are there any future plans for this feature?
its just a consolidation of what i found others recommended in various issues. That being said you are right some of the thigns i added is just extra that is probably ignored in the prompt. I wasn't sure exactly of which tool calls codex used so i defaulted to using this list. Should probably shorten it to those 3 tools. surprised apply patch isn't one of them I wonder why?
Edit: I actually am so confused if it isnt using apply_patch because i have been getting codex models to apply patches consistently with this prompt see attachment.
<img width="1022" height="641" alt="Image" src="https://github.com/user-attachments/assets/a332163b-c9dc-4cf5-a9d9-323779631636" />
We hoisted apply_patch to a top-level tool and are experimenting with other tools in the future that we could give to the model to improve performance and ergonomics. Thanks a lot for the write-up and suggestions here, I've shared them with the team.
Im curious why codex didnt decide to expose a set of primitive tools for the agent for doing search and basic file patching, writing, reading, renaming, moving, etc
It seems it would make overall permissions much easier/safer and also could make these operations more efficient and ergonomic for the agents