[Feature Request] Improve regex pattern validation for allow/deny rules in settings.json
Bug Description
Need better regex for allow/deny patterns in settings.json.
With the new cd && git rules I've been looking at creating a standard set of "safe" allowed rules, but the settings.json allow/deny pattern only allows glob patterns.
I wrote hooks to rewrite unafe commands into safe commands, but the patterns are still not flexible enough.
I rewrite "cd <dir> && git *" to "git -C <dir>" in the hook and add the pattern:
"Bash(git -C diff ")
But now the user can add --exec-path and override the default git binary to one downloaded in a prompt.
I can add more rules to the hook, but then I have to make the allow pattern very gneral "Bash(git *)" which would be a disaster if the hook isn't installed but the settings.json file is in github.
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.68
- Feedback ID: e8d56ffd-b64d-48bb-828c-01bd3b896a51
Errors
[{"error":"Error: LSP server plugin:pyright-lsp:pyright failed to start: Executable not found in $PATH: \"pyright-langserver\"\n at start (B:/~BUN/root/claude.exe:2730:22114)\n at async E (B:/~BUN/root/claude.exe:2730:24426)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:09.104Z"},{"error":"Error: Executable not found in $PATH: \"pyright-langserver\"\n at spawn (unknown)\n at spawn (node:child_process:679:35)\n at spawn (node:child_process:14:39)\n at start (B:/~BUN/root/claude.exe:2730:20640)\n at E (B:/~BUN/root/claude.exe:2730:24426)\n at L (B:/~BUN/root/claude.exe:2730:32554)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:09.106Z"},{"error":"Error: Failed to start LSP server plugin:pyright-lsp:pyright: Executable not found in $PATH: \"pyright-langserver\"\n at <anonymous> (B:/~BUN/root/claude.exe:2730:32576)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:09.107Z"},{"error":"Error: LSP server plugin:rust-analyzer-lsp:rust-analyzer crashed with exit code 1\n at <anonymous> (B:/~BUN/root/claude.exe:2730:21267)\n at emit (node:events:98:22)\n at #handleOnExit (node:child_process:532:14)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:11.322Z"},{"error":"Error: 1P event logging: 73 events failed to export (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\n at queueFailedEvents (B:/~BUN/root/claude.exe:6275:2654)\n at async doExport (B:/~BUN/root/claude.exe:6275:1561)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:19.007Z"},{"error":"Error: {\"message\":\"Failed to export 73 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\",\"originalLine\":\"6275\",\"originalColumn\":\"1713\",\"line\":\"6275\",\"column\":\"1713\",\"sourceURL\":\"B:/~BUN/root/claude.exe\",\"stack\":\"Error: Failed to export 73 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\\n at doExport (B:/~BUN/root/claude.exe:6275:1713)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (B:/~BUN/root/claude.exe:2421:25029)\n at <anonymous> (B:/~BUN/root/claude.exe:118:92465)\n at A_0 (B:/~BUN/root/claude.exe:118:93009)\n at <anonymous> (B:/~BUN/root/claude.exe:119:17366)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:19.008Z"},{"error":"Error: 1P event logging: 57 events failed to export (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\n at queueFailedEvents (B:/~BUN/root/claude.exe:6275:2654)\n at async doExport (B:/~BUN/root/claude.exe:6275:1561)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:31.405Z"},{"error":"Error: {\"message\":\"Failed to export 57 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\",\"originalLine\":\"6275\",\"originalColumn\":\"1713\",\"line\":\"6275\",\"column\":\"1713\",\"sourceURL\":\"B:/~BUN/root/claude.exe\",\"stack\":\"Error: Failed to export 57 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\\n at doExport (B:/~BUN/root/claude.exe:6275:1713)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (B:/~BUN/root/claude.exe:2421:25029)\n at <anonymous> (B:/~BUN/root/claude.exe:118:92465)\n at A_0 (B:/~BUN/root/claude.exe:118:93009)\n at <anonymous> (B:/~BUN/root/claude.exe:119:17366)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:31.406Z"},{"error":"Error: 1P event logging: 1 events failed to export (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\n at queueFailedEvents (B:/~BUN/root/claude.exe:6275:2654)\n at async doExport (B:/~BUN/root/claude.exe:6275:1561)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-04T13:36:46.541Z"},{"error":"Error: {\"message\":\"Failed to export 1 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\",\"originalLine\":\"6275\",\"originalColumn\":\"1713\",\"line\":\"6275\",\"column\":\"1713\",\"sourceURL\":\"B:/~BUN/root/claude.exe\",\"stack\":\"Error: Failed to export 1 events (status=429, code=ERR_BAD_REQUEST, Request failed with status code 429)\\n at doExport (B:/~BUN…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗