claude-code - 💡(How to fix) Fix [Bug] Embedded `bfs`/`ugrep` not exposed in `Bash` tool (native macOS build 2.1.117+) [2 comments, 3 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#52476Fetched 2026-04-24 06:06:11
View on GitHub
Comments
2
Participants
3
Timeline
10
Reactions
0
Timeline (top)
labeled ×5commented ×2renamed ×2closed ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/slz/.local/share/claude/versions/2.1.118 (expected in multi-process scenarios)\n at ai_ (/$bunfs/root/src/entrypoints/cli.js:2756:2177)\n at IK8 (/$bunfs/root/src/entrypoints/cli.js:2756:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T15:37:53.872Z"}]

Fix Action

Fix / Workaround

The Claude Code binary is a multi-call binary (BusyBox-style). Overriding argv[0] via exec -a dispatches to the embedded tool correctly:

Workaround

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/slz/.local/share/claude/versions/2.1.118 (expected in multi-process scenarios)\n    at ai_ (/$bunfs/root/src/entrypoints/cli.js:2756:2177)\n    at IK8 (/$bunfs/root/src/entrypoints/cli.js:2756:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T15:37:53.872Z"}]

---

$ which bfs ugrep
bfs not found
ugrep not found

$ type bfs
bfs not found

$ type ugrep
ugrep not found

$ bfs --version
zsh: command not found: bfs

$ ugrep --version
zsh: command not found: ugrep

---

$ exec -a bfs ~/.local/share/claude/versions/2.1.118 --version
bfs 4.1
Copyright © Tavian Barnes and the bfs contributors
No rights reserved (https://opensource.org/license/0BSD)

$ exec -a ugrep ~/.local/share/claude/versions/2.1.118 --version
ugrep 7.5.0 aarch64-apple-darwin23.6.0 +neon/AArch64; -P:pcre2; -z:zlib,bzip2,zstd,brotli,7z,tar/pax/cpio/zip
License: BSD-3-Clause

---

alias bfs='"$SHELL" -c exec -a bfs ~/.local/bin/claude'
alias ugrep='"$SHELL" -c exec -a ugrep ~/.local/bin/claude'
RAW_BUFFERClick to expand / collapse

Bug Description 2.1.117 changelog claims that bfs and ugrep are available to the Bash tool on native-build macOS, but this transcript clearly shows that Claude cannot easily access them in its Bash tool environment on macOS zsh withoug shell aliases defined. This is a bug and defeats the purpose of the embedding.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.118
  • Feedback ID: b325896e-8eba-404e-8668-0b74bf8b6108

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/slz/.local/share/claude/versions/2.1.118 (expected in multi-process scenarios)\n    at ai_ (/$bunfs/root/src/entrypoints/cli.js:2756:2177)\n    at IK8 (/$bunfs/root/src/entrypoints/cli.js:2756:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T15:37:53.872Z"}]

Summary

The 2.1.117 changelog announced:

Native builds on macOS and Linux: the Glob and Grep tools are replaced by embedded bfs and ugrep available through the Bash tool — faster searches without a separate tool round-trip

On my native 2.1.118 install, bfs and ugrep are not reachable from inside the Bash tool, so the replacement for Glob/Grep is effectively broken. The embedded binaries themselves exist and work — they're just not wired into the Bash tool's shell environment.

Reproduction (inside Claude Code Bash tool)

$ which bfs ugrep
bfs not found
ugrep not found

$ type bfs
bfs not found

$ type ugrep
ugrep not found

$ bfs --version
zsh: command not found: bfs

$ ugrep --version
zsh: command not found: ugrep

Not on $PATH, not a shell alias, not a shell function. Tested both inside tmux and in a fresh Apple Terminal session — identical result, so it's not a terminal-multiplexer issue.

Confirmation that the embedded binaries do exist

The Claude Code binary is a multi-call binary (BusyBox-style). Overriding argv[0] via exec -a dispatches to the embedded tool correctly:

$ exec -a bfs ~/.local/share/claude/versions/2.1.118 --version
bfs 4.1
Copyright © Tavian Barnes and the bfs contributors
No rights reserved (https://opensource.org/license/0BSD)

$ exec -a ugrep ~/.local/share/claude/versions/2.1.118 --version
ugrep 7.5.0 aarch64-apple-darwin23.6.0 +neon/AArch64; -P:pcre2; -z:zlib,bzip2,zstd,brotli,7z,tar/pax/cpio/zip
License: BSD-3-Clause

So bfs 4.1 and ugrep 7.5.0 are bundled inside the binary and fully functional — the harness just isn't exposing them to the shell spawned by the Bash tool.

Expected behavior

Per the changelog, bfs and ugrep should be invokable directly from the Bash tool (e.g., bfs . -name '*.ts', ugrep -r 'pattern'). This likely requires one of:

  1. Prepending a temp directory containing bfs/ugrep symlinks to the Claude binary onto $PATH when spawning Bash tool shells, or
  2. Injecting shell functions/aliases into the Bash tool's shell init that exec -a into the Claude binary.

Impact

The old Glob and Grep tools were removed (per the changelog) on the assumption the Bash-tool path would replace them. On native macOS builds, neither path works, so there's effectively no built-in file/content search — users/assistants have to fall back to system find/grep/rg if those happen to be installed.

Workaround

Users can manually add aliases to their shell init:

alias bfs='"$SHELL" -c exec -a bfs ~/.local/bin/claude'
alias ugrep='"$SHELL" -c exec -a ugrep ~/.local/bin/claude'

Although I have not manually confirmed that this works.

extent analysis

TL;DR

The issue can be fixed by prepending a temporary directory containing bfs and ugrep symlinks to the Claude binary onto the $PATH environment variable or by injecting shell functions/aliases into the Bash tool's shell init.

Guidance

  • Verify that the bfs and ugrep binaries are correctly embedded in the Claude Code binary by running the exec -a commands as shown in the issue description.
  • Check the shell init files (e.g., ~/.zshrc) to see if any existing aliases or functions are interfering with the expected behavior.
  • Consider adding the suggested aliases to the shell init file as a temporary workaround: alias bfs='"$SHELL" -c exec -a bfs ~/.local/share/claude/versions/2.1.118' and alias ugrep='"$SHELL" -c exec -a ugrep ~/.local/share/claude/versions/2.1.118'.
  • Test the bfs and ugrep commands in the Bash tool after applying the workaround to ensure they are working as expected.

Example

# Add aliases to shell init file
echo "alias bfs='"$SHELL" -c exec -a bfs ~/.local/share/claude/versions/2.1.118'" >> ~/.zshrc
echo "alias ugrep='"$SHELL" -c exec -a ugrep ~/.local/share/claude/versions/2.1.118'" >> ~/.zshrc
# Reload shell init file
source ~/.zshrc

Notes

The issue seems to be related to the way the Bash tool's shell environment is set up, and the suggested workarounds may not be the final solution. Further investigation may be needed to determine the root cause and implement a permanent fix.

Recommendation

Apply the workaround by adding the suggested aliases

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