Description
Basically sometimes when I run opencode afterwards I can no longer use bun because this what I get as an output
❯ bun run dev
$ bun run scripts/generate-icon-manifest.ts
> build · claude-opus-4-6
Opencode it's injecting inself into all of my bun commands
This is what Opencode has to say about this issue
opencode is a terminal-based AI coding tool (similar to Claude Code). It needs to intercept and wrap bun and node calls made by the projects it manages — likely to inject instrumentation, capture output, or control the runtime environment.
The mechanism:
1. When opencode starts a session, it creates a temp directory like /tmp/bun-node-<hash>/
2. It places symlinks in that directory: bun -> opencode and node -> opencode
3. It prepends that temp directory to PATH when spawning subprocesses
4. When a subprocess calls bun or node, it hits the symlink, which actually runs opencode — opencode detects it was invoked as "bun" or "node" (via argv[0]), does whatever interception it needs, then delegates to the real binary
This is a common pattern called PATH shimming — tools like nvm, asdf, volta, and mise all do something similar.
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
- Run Opencode, it generates the shims
- Try running any Bun project
- You get greeted with Opencode stuff
Screenshot and/or share link
Operating System
macOS
Terminal
Ghostty
Description
Basically sometimes when I run
opencodeafterwards I can no longer use bun because this what I get as an outputOpencode it's injecting inself into all of my bun commands
This is what Opencode has to say about this issue
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
Screenshot and/or share link
Operating System
macOS
Terminal
Ghostty