[Bug] grep shim misdirection causes agents to bypass permission allowlist with absolute paths

Resolved 💬 1 comment Opened May 5, 2026 by rugheid Closed Jun 2, 2026

Bug Description
Title: grep shim errors push agents toward absolute paths, bypassing permission allowlist

Body:

  • CC injects grep shell function routing to bundled ugrep
  • ugrep diverges from GNU on some flags → confusing errors mentioning "ugrep"
  • Agents misdiagnose as user shell misconfig, retry with /usr/bin/grep or command grep
  • Those paths don't match grep permission rule → either prompt user (friction) or, worse, succeed under broader rules and silently sidestep the intended policy
  • Result: permission model leaks through a tool agents are nudged to invoke
  • Asks:

a. Permission matcher should treat grep, /usr/bin/grep, command grep as same tool
b. Or: opt-out for the shim
c. Or: error messages stay branded as grep so agents don't pivot

Environment Info

  • Platform: darwin
  • Terminal: kitty
  • Version: 2.1.128
  • Feedback ID: 55a7523e-f567-41c0-b81e-96aa44076b0b

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/rugheid/.local/share/claude/versions/2.1.128 (expected in multi-process scenarios)\n    at Nq6 (/$bunfs/root/src/entrypoints/cli.js:2764:2177)\n    at uGH (/$bunfs/root/src/entrypoints/cli.js:2764:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T12:26:49.162Z"},{"error":"Error: Failed to fetch version from https://downloads.claude.ai/claude-code-releases/latest: timeout of 30000ms exceeded\n    at yP5 (/$bunfs/root/src/entrypoints/cli.js:2762:5605)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T16:56:44.815Z"},{"error":"Error: Failed to fetch version from https://downloads.claude.ai/claude-code-releases/latest: timeout of 30000ms exceeded\n    at yP5 (/$bunfs/root/src/entrypoints/cli.js:2762:5605)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T16:56:44.816Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:120:13305)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:119:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:122:2467)\n    at async As6 (/$bunfs/root/src/entrypoints/cli.js:447:4799)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T17:10:31.968Z"}]

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗