# CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS

> It sets how much of a file one read can return.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS environment variable

## Think of it like

It is like you read a book a few pages at a time. This sets how many.

## Definition

CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS sets how many tokens one file read can return. The default is 25,000 tokens. A bigger file has to be read in parts. Raise it when Claude needs to read a big file all at once.

## Example

Emma's data file is just over the limit, and Claude keeps reading it in slices. She raises the limit, and it reads the file in one go.

## Example code

```bash
export CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS=60000
claude
```

Let Claude read bigger files at once.

## Why it matters

One whole read is clearer for Claude than many slices it has to join.

## Common mistake

Raising it very high for every project. Each big read fills the chat and makes it squeeze sooner.

## Three principles

- **Default 25,000.** Tokens per read.
- **Bigger files.** Read in parts.
- **Costs chat room.** Use with care.

## Related terms

- [Read Tool](https://learn.benibix.com/term/ai/read-tool)
- [Context Window](https://learn.benibix.com/term/ai/context-window)
- [BASH_MAX_OUTPUT_LENGTH](https://learn.benibix.com/term/ai/bash-max-output-length-variable)

![Each tool has its own cap on how much of its output Claude gets to read.](https://learn.benibix.com/diagrams/env-output-caps.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-file-read-max-output-tokens-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
