[DOCS] Tools reference missing Bash `cat`/`sed -n` to `Edit` workflow guidance

Resolved 💬 3 comments Opened Apr 1, 2026 by coygeek Closed May 17, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/tools-reference

Section/Topic

Bash, Read, and Edit tool behavior when Claude inspects a file with Bash before editing it

Current Documentation

The tools reference currently describes these tools separately:

| Bash | Executes shell commands in your environment. See [Bash tool behavior](#bash-tool-behavior) | Yes | | Edit | Makes targeted edits to specific files | Yes | | Read | Reads the contents of files | No |

The Bash section only documents command-process persistence:

The Bash tool runs each command in a separate process with the following persistence behavior: Working directory persists across commands. Set CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 to reset to the project directory after each command. Environment variables do not persist. An export in one command will not be available in the next.

Related workflow guidance says:

* Let Claude fetch what it needs. Tell Claude to pull context itself using Bash commands, MCP tools, or by reading files.

And the permissions page says:

Read and Edit deny rules apply to Claude's built-in file tools, not to Bash subprocesses. A Read(./.env) deny rule blocks the Read tool but does not prevent cat .env in Bash.

No current page explains that viewing a file with Bash cat or sed -n is enough context for a later Edit call, or that a separate Read call is no longer required.

What's Wrong or Missing?

Changelog v2.1.89 says:

Changed Edit to work on files viewed via Bash with sed -n or cat, without requiring a separate Read call first

That is user-visible tool behavior, but the docs still make Bash file viewing and file-edit tools look unrelated.

A. Missing cross-tool behavior

No tools page documents that cat and sed -n file views can satisfy the file-context requirement for a later Edit call.

B. Missing supported command examples

The changelog names two supported Bash read patterns (cat and sed -n), but the docs do not mention them anywhere in the tool-behavior documentation.

C. Missing clarification about what changed

Because the permissions docs explicitly distinguish Read from Bash cat, advanced users cannot tell whether this v2.1.89 change affects permissions, edit eligibility, or both.

Suggested Improvement

Add a short note to tools-reference (either under Bash tool behavior or in a new Edit tool behavior subsection) such as:

When Claude inspects a file with read-only Bash commands such as cat path/to/file or sed -n 'start,endp' path/to/file, Claude can edit that file afterward without issuing a separate Read tool call first.

Then add one clarifying sentence that this changes context tracking for edits, not the permission model: Bash commands are still governed by Bash permissions, while Read/Edit rules still apply to the built-in file tools.

If Anthropic wants this workflow to be discoverable outside the tool reference, add a brief cross-reference from the existing best-practices guidance about letting Claude fetch context with Bash commands.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/tools-reference | Primary reference for Bash, Read, and Edit tool behavior |
| https://code.claude.com/docs/en/best-practices | Tells users Claude can fetch context using Bash commands or by reading files |
| https://code.claude.com/docs/en/permissions | Explains that Read rules do not apply to Bash cat, so the cross-tool edit behavior needs clarification |

Total scope: 3 pages affected

Source: Changelog v2.1.89

Changelog entry:

Changed Edit to work on files viewed via Bash with sed -n or cat, without requiring a separate Read call first

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗