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

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Jun 2, 2026 · 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 ↗

3 Comments

github-actions[bot] · 4 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/60406

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

coygeek · 3 months ago

Issue #64641 Verification

Title: [DOCS] Tools reference omits grep/egrep/fgrep as read-before-edit views
Issue Date: June 2, 2026
Verification Date: 2026-06-23
Status: RESOLVED

---

Issue Summary

This issue reports that the Edit tool behavior section of the tools-reference page (https://code.claude.com/docs/en/tools-reference) is outdated as of v2.1.160. The v2.1.160 changelog entry states that single-file grep/egrep/fgrep commands now satisfy the read-before-edit check, but the docs page still listed only cat, head, tail, and sed -n 'X,Yp', creating a mismatch.

---

Verification Results

Claim 1: The Edit tool behavior section omits grep/egrep/fgrep from the Bash-view list of read-before-edit commands

Status: RESOLVED

At https://code.claude.com/docs/en/tools-reference, line 135:

Viewing a file with Bash also satisfies the read-before-edit requirement when the command is cat, head, tail, sed -n 'X,Yp', grep, egrep, or fgrep on a single file with no pipes or redirects. Piped output and other Bash commands do not count, and Claude must use Read before editing in those cases.

The current docs explicitly include grep, egrep, and fgrep alongside cat, head, tail, and sed -n 'X,Yp', with the same single-file / no-pipes / no-redirects constraint called out in the issue's suggested wording. The follow-up sentence at line 137 also notes that egrep and fgrep count for read-before-edit even though they are not checked against Read deny rules, which addresses the "edge cases" the issue asked to document.

Verdict: The current wording matches what the issue requested; the omission has been corrected.

---

Claim 2: The v2.1.160 changelog says single-file grep/egrep/fgrep satisfy read-before-edit

Status: RESOLVED

At https://code.claude.com/docs/en/changelog, line 396 (under the 2.1.160 entry dated June 2, 2026):

Edit no longer requires a separate Read after viewing a file with grep: single-file grep/egrep/fgrep commands now satisfy the read-before-edit check

This matches the claim and remains in the changelog.

Verdict: The changelog entry exists; the doc page now mirrors its content.

---

Current State

| Claim | Status |
|-------|--------|
| Edit tool behavior section lists grep/egrep/fgrep as read-before-edit views | RESOLVED |
| v2.1.160 changelog records the same behavior | RESOLVED |

---

Suggested Fix

N/A - issue has been resolved.

---

References

---

Conclusion & Recommendation

Primary Concern: The tools-reference page did not reflect v2.1.160's expansion of the read-before-edit Bash-view list to include single-file grep/egrep/fgrep.

Resolution Status: RESOLVED

Recommendation: CLOSE

Both the tools-reference page (line 135) and the changelog (line 396) now consistently document that single-file grep, egrep, and fgrep commands without pipes or redirects satisfy the read-before-edit check.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.