claude-code - 💡(How to fix) Fix [Bug] Agent bypasses safety constraints and policy restrictions [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46819Fetched 2026-04-12 13:32:15
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

[{"error":"MaxFileReadTokenExceededError: File content (14136 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:04:22.254Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX.\n at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:07:16.684Z"},{"error":"MaxFileReadTokenExceededError: File content (72325 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:43.204Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX. Did you mean swift-architect?\n at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:52.998Z"},{"error":"Error: Request was aborted.\n at pE_ (/$bunfs/root/src/entrypoints/cli.js:1268:12089)\n at next (native:1:11)\n at sm7 (/$bunfs/root/src/entrypoints/cli.js:7918:9109)\n at next (native:1:11)\n at Hp7 (/$bunfs/root/src/entrypoints/cli.js:7923:11439)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:25:05.245Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX/.claude/worktrees/agent-a796b14e.\n at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:27:20.913Z"}]

Code Example

[{"error":"MaxFileReadTokenExceededError: File content (14136 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:04:22.254Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:07:16.684Z"},{"error":"MaxFileReadTokenExceededError: File content (72325 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:43.204Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX. Did you mean swift-architect?\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:52.998Z"},{"error":"Error: Request was aborted.\n    at pE_ (/$bunfs/root/src/entrypoints/cli.js:1268:12089)\n    at next (native:1:11)\n    at sm7 (/$bunfs/root/src/entrypoints/cli.js:7918:9109)\n    at next (native:1:11)\n    at Hp7 (/$bunfs/root/src/entrypoints/cli.js:7923:11439)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:25:05.245Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX/.claude/worktrees/agent-a796b14e.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:27:20.913Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description mais um exemplo: ele acha um caminho pra contornar as regras

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.101
  • Feedback ID: d5cca3ca-545a-433d-a7e0-66272f422312

Errors

[{"error":"MaxFileReadTokenExceededError: File content (14136 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:04:22.254Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T23:07:16.684Z"},{"error":"MaxFileReadTokenExceededError: File content (72325 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at ZY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:43.204Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX. Did you mean swift-architect?\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:16:52.998Z"},{"error":"Error: Request was aborted.\n    at pE_ (/$bunfs/root/src/entrypoints/cli.js:1268:12089)\n    at next (native:1:11)\n    at sm7 (/$bunfs/root/src/entrypoints/cli.js:7918:9109)\n    at next (native:1:11)\n    at Hp7 (/$bunfs/root/src/entrypoints/cli.js:7923:11439)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:25:05.245Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gus/Faz o PIX/.claude/worktrees/agent-a796b14e.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T00:27:20.913Z"}]

extent analysis

TL;DR

Use offset and limit parameters to read specific portions of the file instead of reading the whole file to avoid the MaxFileReadTokenExceededError.

Guidance

  • Check the file size and content to determine the best approach for reading it, considering the 10000 token limit.
  • Use the offset and limit parameters to read specific portions of the file, as suggested in the error message.
  • Verify the current working directory and file path to ensure the correct file is being accessed, as some errors indicate a "File does not exist" issue.
  • Review the code at /entrypoints/cli.js lines 4449 and 4458 to understand how file reading is handled and adjust accordingly.

Notes

The issue seems to be related to reading large files and incorrect file paths. The provided errors suggest that the code is trying to read files that exceed the maximum allowed tokens or do not exist in the current working directory.

Recommendation

Apply workaround: Use offset and limit parameters to read specific portions of the file, as this approach is explicitly suggested in the error messages and can help avoid the MaxFileReadTokenExceededError.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING