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 Atlas in your terminal

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

Install Atlas

Related guides

Atlas with GLM-4.7 Flash: A Free 200K Context Model for the small_model Slot (2026)

GLM-4.7 Flash is free at $0 / $0 per Mtok with a 200,000 token context. Set it as Atlas's small_model so titles and summaries cost nothing at all.

Atlas with IBM Granite Code 20B (Ollama): More Capacity, Less Window in 2026

IBM Granite Code 20B (Ollama) is 12GB on disk and Free (self-hosted), but the 20b tag drops to 8K tokens (8,192) where the 8B instruct advertises 125K.

Atlas with Qwen3 Coder Plus: Agentic Coding on a 1M Window in 2026

Qwen3 Coder Plus in Atlas: a 1,048,576 token window at $1 / $5 per Mtok, post-trained for agentic coding, with ollama pull qwen3-coder:30b as the local counterpart.

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): The 4.9GB Baseline for 2026

Llama 3.1 8B (local via Ollama) in Atlas for 2026: a 4.9GB pull that fits 8GB of VRAM, Free (self-hosted), and honest limits on a general-purpose 8B model.

Atlas with GPT-5: The Original 400K Reasoning Model in 2026

GPT-5 in Atlas: the August 2025 launch model with a 400K context, 128K max output, and $1.25 per Mtok input, still the floor price for a full size GPT-5 class model.

Atlas with Qwen3.5 Plus: A Million-Token Window for $0.40 per Mtok in 2026

Qwen3.5 Plus gives Atlas a 1M tokens (1,000,000) context window at $0.40 per Mtok input and $2.40 per Mtok output. What the million tokens buy, and what closed weights cost.

Atlas with GLM-4.5: The MIT-Licensed Open Weights Baseline in 2026

GLM-4.5 runs Atlas at $0.60 per Mtok input and $2.20 per Mtok output on a 128K tokens (131,072) window, under an MIT license that permits commercial self-hosting.

Browse this resource hub