anomalyco / anomalyco/opencode
Reading binary files causes unexpected behavior
Open
@rekram1-node is already working on this.
Since Sep 10, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When the opencode agent is instructed to read a binary file, it fails to recognize the file type and attempts to read and output the raw binary data. This results in terminal corruption, unreadable output, and fills the LLM context window with garbage data.
Plugins
None
OpenCode version
1.18.30
Steps to reproduce
- Start an
opencodesession in your terminal. - Instruct the agent to read a binary file. For example, you can ask it to read its own binary:
read the file at /home/[user]/.opencode/bin/opencode - The agent will execute a command similar to:
(or use its internal file reading tool on the binary path).$ cat /home/[user]/.opencode/bin/opencode - Observe the terminal output being flooded with binary characters.
Screenshot and/or share link

Operating System
Linux
Terminal
Standard Terminal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.