Troubleshooting

Atlas read tool: "Cannot read binary file: <path>" and how to fix it

Updated 7 min read

Atlas fails with "Cannot read binary file: <path>" because the read tool detects binary content and refuses rather than pushing raw bytes into the model context, and the fix is to stop reading the binary directly and extract text from it instead. Use bash with a tool that extracts text, for example strings, file, or an unpacker. For images, attach them as an image part instead, because Atlas has an image pipeline with decode and resize. If the file is actually text in an unusual encoding, convert it first and read the converted copy, and use grep to search inside large or mixed-content files without loading them.

Why does Atlas refuse to read a binary file

Atlas refuses with "Cannot read binary file: <path>" because the read tool detects binary content and declines rather than pushing raw bytes into the model context. In 2026, a single compiled artifact or archive would fill the context window with bytes that carry no usable meaning for the agent.

The refusal is a guard, not a bug. Language models consume text, and a binary file decoded as text produces long runs of replacement characters and control bytes. Feeding that into a session degrades every subsequent turn: the context is now full, and it is full of noise. Atlas's read tool therefore checks the content before it returns anything and stops at the boundary. Because the check is on content rather than on the file extension, a file with a text-looking name can still be rejected if its bytes are binary, and a file with an unfamiliar extension can still read fine if its bytes are text. That is the correct trade, but it does mean the error message tells you about the bytes, not about the name you typed.

How to extract text from a binary in Atlas with bash

Extract text from a binary in Atlas by using the bash tool instead of read. Run `file` to identify the artifact in 1 line, run `strings` to pull readable text out of it, or run an unpacker if the file is an archive. Bash returns text Atlas can reason over.

The pattern is to convert the binary into text outside the model, then bring only the text in. `file` is the cheapest first step because it tells you what you are dealing with in one line, which often ends the investigation immediately. `strings` is the workhorse when you need embedded literals, version markers, or error text out of a compiled artifact. An unpacker is the right move when the binary is really a container, since the interesting content is usually one of the files inside it rather than the wrapper. The honest caveat: `strings` output on a large binary can itself be enormous, so pipe it through a filter or a head before you hand it to the agent. Extracting text is only a win if the extracted text is smaller and more meaningful than the bytes it came from.

How to give Atlas an image instead of reading it

Images are the exception in Atlas. Rather than calling read on a PNG and hitting "Cannot read binary file: <path>", attach the image as an image part: Atlas has an image pipeline with decode and resize. That is 1 tool call, and no binary refusal.

The distinction matters because an image is genuinely useful to a model, unlike a compiled binary. A screenshot of a failing UI, a diagram of a data flow, or a rendered chart all carry information the agent can act on, so Atlas provides a path for them that does not go through the read tool. The image pipeline decodes and resizes the file so it arrives in a form the model can process, which is precisely the step read cannot do. If you find yourself trying to read an image because you want the agent to look at it, you are using the wrong door. Attach it as an image part and the refusal never happens.

What if the file is text but Atlas calls it binary

If Atlas reports "Cannot read binary file: <path>" on a file you believe is text, the file is probably text with an unusual encoding. Convert it first and read the converted copy. Atlas checks the bytes, not the extension, so 1 unreadable encoding is enough to trip the binary detector.

This is the false-positive case, and it has a clean fix: convert, then read. Produce a converted copy in a standard text encoding with a bash call, then point the read tool at that copy. Do not try to force read at the original, because the detection is doing exactly what it was built to do given the bytes it sees. The alternative, when you only need one thing out of the file, is to skip loading it entirely. Use grep to search inside large or mixed-content files without loading them, which returns matching lines rather than the whole file. That is often better anyway: a targeted grep against a 40 MB log beats reading it, whether or not the encoding is unusual.

How to verify the binary read error is fixed

Verify the fix in Atlas by confirming that read is no longer pointed at the binary. A successful run returns text from the converted copy, from `strings`, or from 1 grep match, and the message "Cannot read binary file: <path>" does not appear anywhere in the output.

The verification is about the target, not the tool. If the error returns, check whether the path you passed is still the binary itself rather than the extracted text you produced. A common slip is generating a converted copy and then re-running the previous read call out of habit, which points at the old path and reproduces the error exactly. Once the read call names the text output, the tool returns content and the session moves on. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so if the bash extraction step is the one being blocked rather than the read, the message you see will be a permission prompt and not the binary refusal. The two errors are distinct and it is worth reading which one you actually got.

How to fix it

  1. 01Do not read binaries. Use bash with a tool that extracts text, for example `strings`, `file`, or an unpacker, and read that text output instead.
  2. 02For images, attach them as an image part instead: Atlas has an image pipeline with decode and resize, so an image goes into the conversation as an image, not as bytes.
  3. 03If the file is actually text with an unusual encoding, convert it first and read the converted copy rather than the original.
  4. 04Use grep to search inside large or mixed-content files without loading them into context.
  5. 05Re-run and confirm the read now targets a text file, not the original binary path.

Frequently asked questions

why does Atlas say Cannot read binary file
The Atlas read tool detects binary content and refuses rather than pushing raw bytes into the model context. Raw bytes would fill the context window with unreadable content, so read declines the file.
how do I read a binary file in Atlas
Do not read it directly. Use bash with a tool that extracts text, for example `strings`, `file`, or an unpacker, and have Atlas read the extracted text instead of the binary.
how do I show Atlas an image or a screenshot
Attach it as an image part rather than calling read. Atlas has an image pipeline with decode and resize, so images go into the conversation as images instead of raw bytes.
Atlas says binary but my file is text, what now
The file is likely text with an unusual encoding. Convert it first and read the converted copy, since Atlas checks the bytes rather than the file extension.
how do I search inside a huge file without Atlas loading it
Use grep. Grep searches inside large or mixed-content files without loading them into context, returning matching lines instead of the entire file.
does Atlas reject files based on the file extension
No. Atlas's read tool detects binary content in the file itself, so an unfamiliar extension can read fine if the bytes are text, and a text-looking name can still be refused if the bytes are binary.
what is the fastest way to identify an unknown file in Atlas
Run `file` through the bash tool. It identifies the artifact in one line, which often answers the question before any extraction with `strings` or an unpacker is needed.

Try SeaShell in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install SeaShell

Related guides

Atlas with GLM-4.7 Flash in 2026

Explore Atlas with GLM-4.7 Flash, a genuinely free hosted model offering a 200K token context window. Ideal for background tasks, it's a zero-cost option for developers in 2026.

Atlas with IBM Granite Code 20B (Ollama) in 2026

Explore Atlas with IBM Granite Code 20B (Ollama) in 2026. This self-hosted, free model offers 12GB weights for strong generation, fitting 16GB VRAM, but has an 8K token context window.

Atlas with Qwen3 Coder Plus in 2026

Atlas with Qwen3 Coder Plus in 2026: Harness its 1M token context and $1/Mtok input for agentic coding. Understand its prose limitations and $5/Mtok output cost.

Self-Review Your Working Diff Before Committing with Atlas (2026 Workflow)

How to self-review your working diff before committing with Atlas in 2026: bash produces the diff, read checks each file, grep finds leftovers, session revert undoes bad edits.

Atlas with Llama 3.1 8B (local via Ollama) in 2026

Explore Atlas with Llama 3.1 8B (local via Ollama) for on-device AI coding in 2026. This 4.9GB model offers a 128,000 token window and runs free, self-hosted.

Atlas with GPT-5 in 2026

Explore GPT-5's capabilities with Atlas in 2026. Understand its 400K token context, $1.25 in / $10 out pricing, and how it supports complex coding tasks.

Atlas with Qwen3.5 Plus in 2026

Drive Atlas, the terminal-native AI coding agent, with Qwen3.5 Plus. Leverage its 1,000,000 token context window and cost-effective $0.40 per Mtok input for deep code understanding.

Atlas with GLM-4.5 in 2026

Explore Atlas with GLM-4.5, Z.ai's 2025 flagship model. Discover its 128K context, MIT license, and high output cap for coding tasks in 2026. Understand its cost and tradeoffs.

Browse this resource hub