anthropics / anthropics/claude-code

Read tool silently returns partial content for large instruction/rule files; documented 2,000-line default not enforced

Đang mở
#92,979 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:tools bug
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## Summary

Reading a large rules/instruction file -- a `CLAUDE.md` companion, a `.claude/rules` file, or an `--append-system-prompt` target -- truncates inconsistently and can be silent: the model can treat a partial read as the whole file and drop rules in the unread tail, with no error and no operator notice. Two related reports, #6910 (2,000-line default not enforced) and #28783 (silent guardrail loss from Read truncation), were auto-closed as stale without a fix.

## Evidence (current Claude Code 2.1.x)

A 65,800-character / 1,400-line file is read in **full** with no `offset`/`limit` -- so the documented "reads up to 2,000 lines by default" is not applied (matches #6910). Larger files can return partial content, and the truncation is not signaled in a way the model reliably interprets as "content is missing" (#28783), so the agent proceeds confidently on a partial read.

## Impact

Safety-relevant: instructions in the unread portion are silently absent. An operator who placed guardrails in a file and told the agent to read it has no indication they were never loaded.

## Request (any one would help)

1. Make Read truncation unmistakable to the model -- a structured marker such as "showing lines X-Y of Z; use offset/limit for the rest" that cannot be mistaken for end-of-file.
2. Enforce the documented 2,000-line default, or document the actual threshold.
3. Optionally, a setting to raise the inline-read ceiling.

Prior art: #6910, #28783, #22699.

---
_Filed via Claude Code on the user's behalf._

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by reproducing the behavior with a large CLAUDE.md or .claude/rules file, and compare reads with an --append-system-prompt target against the documented 2,000-line default. Trace the Read tool entry point and verify that truncated output is unmistakably marked, the default limit is enforced or documented, and tests cover the reported cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.