[DOCS] Tools reference omits `grep`/`egrep`/`fgrep` as read-before-edit views

Resolved 💬 2 comments Opened Jun 2, 2026 by coygeek Closed Jun 23, 2026

Documentation Type

Incorrect/outdated documentation

Documentation Location

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

Section/Topic

Edit tool behavior → read-before-edit requirement

Current Documentation

The docs currently say:

Three checks must pass for an edit to apply: * Read-before-edit: Claude must have read the file in the current conversation, and the file must not have changed on disk since that read. This check runs first, before any string matching. ... Viewing a file with Bash also satisfies the read-before-edit requirement when the command is cat, head, tail, or sed -n 'X,Yp' on a single file with no pipes, redirects, or other flags. Piped output and other Bash commands do not count, and Claude must use Read before editing in those cases.

What's Wrong or Missing?

This section is outdated as of v2.1.160. The v2.1.160 changelog says Claude Code now accepts single-file grep/egrep/fgrep commands as satisfying the read-before-edit check, but the Edit tool behavior section still lists only cat, head, tail, and sed -n 'X,Yp'.

That mismatch makes the current rule incomplete and can lead readers to believe a separate Read is still required after a single-file grep/egrep/fgrep view.

Suggested Improvement

Update the Edit tool behavior section to include the new v2.1.160 behavior explicitly. For example, revise the Bash-view sentence to mention that single-file grep, egrep, and fgrep commands also satisfy read-before-edit when used without pipes, redirects, or multi-file targets.

If there are edge cases (for example, line-number flags allowed but recursive or multi-file searches excluded), document those limits in the same paragraph so the rule is unambiguous.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/tools-reference | 130-136 | Edit tool read-before-edit rules still enumerate only cat, head, tail, and sed -n |
| https://code.claude.com/docs/en/changelog | 13-16 | v2.1.160 changelog says single-file grep/egrep/fgrep now satisfy the read-before-edit check |

Total scope: 2 pages affected

The same page's Write section already says its Bash-view behavior follows the rules in Edit tool behavior, so updating the Edit section should also clarify the inherited rule for writes.

View original on GitHub ↗

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