Add a dedicated read_file tool for Codex (apply_patch is not enough)
What feature would you like to see?
Hello team,
Currently, Codex only provides apply_patch for writing and editing files, but there is no dedicated and explicit tool for reading file contents.
This limitation causes many repetitive issues in real-world workflows:
- The biggest issue is that Codex spends too much time reasoning about how to read files and how to execute file-reading commands
- Because there is no suitable
read_filetool, Codex is forced to rely on indirect mechanisms or guesswork, leading to unnecessary overhead - Encoding errors frequently occur when files contain Vietnamese or other Unicode characters (UTF-8)
- Output can become subtly incorrect (broken characters, missing lines, wrong context)
- A lot of developer time is wasted debugging issues caused by unreliable file reading
I would like to propose a dedicated read_file (or equivalent) tool with the following characteristics:
- Explicitly reads file contents without requiring inference
- Preserves data in a lossless manner
- Fully supports UTF-8 / Unicode (including Vietnamese) (I know there is a UTF-8 shell in
/experimental, but it still has character issues) - Can read the entire file or specific line ranges
- Is clearly separated from write/edit tools like
apply_patch
Additional information
In practice, directly reading files is both faster and safer than reconstructing file state through patch-based workflows.
At the moment, Codex often spends more time reasoning about how to perform file-reading operations than actually executing meaningful tasks. This negatively impacts iteration speed, accuracy, and overall developer productivity.
A proper read_file tool would:
- Eliminate unnecessary reasoning overhead related to file access
- Improve correctness and reproducibility
- Reduce encoding-related errors
- Save tokens and developer time
- Make Codex workflows much closer to real-world IDE usage
This would be a major quality-of-life improvement for anyone using Codex on real codebases, especially those containing non-English or Unicode-heavy content.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗