Description
opencode can hang on startup with very high CPU usage on macOS when external skills contain a symlink cycle.
In my environment, launching opencode in Terminal shows no usable UI (appears frozen) and process CPU stays very high (300%+ observed), while opencode web and non-TUI commands still work.
Root cause appears to be external skill discovery traversing a symlink loop:
/Users/bigo/.emp-agent/skills/empjs -> /Users/bigo/Desktop/Develop/emp-workspace/emp/skills/empjs
- inside that folder, subpaths point back to
~/.emp-agent/skills/empjs:
.agent/skills/empjs -> /Users/bigo/.emp-agent/skills/empjs
.agents/skills/empjs -> /Users/bigo/.emp-agent/skills/empjs
.shared/skills/empjs -> /Users/bigo/.emp-agent/skills/empjs
With this structure, TUI startup hangs/high-CPU. If I disable external skills, it starts normally.
Plugins
None (user config plugin: []; only internal defaults)
OpenCode version
1.2.17
Steps to reproduce
- Ensure there is a symlink cycle in external skills paths (example pattern above).
- Run
opencode (TUI) in Terminal.
- Observe startup appears stuck and
.opencode process uses very high CPU for a long time.
- Run with workaround:
OPENCODE_DISABLE_EXTERNAL_SKILLS=1 opencode
- Observe TUI starts immediately and CPU usage is normal.
Screenshot and/or share link
No screenshot; command evidence from local debug:
lsof -p <opencode_pid> shows skill directories/symlinked paths being traversed.
sample <pid> during hang shows the process busy in repeated filesystem traversal/open calls.
Operating System
macOS 26.2 (arm64)
Terminal
Apple Terminal
Suggested fix ideas:
- During skills discovery, avoid following symlinks recursively by default; or
- Track visited inode/realpath to break cycles; and
- Skip known transient skill helper directories like
.agent, .agents, .shared if they are not intended as user skill roots.
Current workaround (works reliably):
OPENCODE_DISABLE_EXTERNAL_SKILLS=1 opencode
Description
opencodecan hang on startup with very high CPU usage on macOS when external skills contain a symlink cycle.In my environment, launching
opencodein Terminal shows no usable UI (appears frozen) and process CPU stays very high (300%+ observed), whileopencode weband non-TUI commands still work.Root cause appears to be external skill discovery traversing a symlink loop:
/Users/bigo/.emp-agent/skills/empjs -> /Users/bigo/Desktop/Develop/emp-workspace/emp/skills/empjs~/.emp-agent/skills/empjs:.agent/skills/empjs -> /Users/bigo/.emp-agent/skills/empjs.agents/skills/empjs -> /Users/bigo/.emp-agent/skills/empjs.shared/skills/empjs -> /Users/bigo/.emp-agent/skills/empjsWith this structure, TUI startup hangs/high-CPU. If I disable external skills, it starts normally.
Plugins
None (user config
plugin: []; only internal defaults)OpenCode version
1.2.17
Steps to reproduce
opencode(TUI) in Terminal..opencodeprocess uses very high CPU for a long time.OPENCODE_DISABLE_EXTERNAL_SKILLS=1 opencodeScreenshot and/or share link
No screenshot; command evidence from local debug:
lsof -p <opencode_pid>shows skill directories/symlinked paths being traversed.sample <pid>during hang shows the process busy in repeated filesystem traversal/open calls.Operating System
macOS 26.2 (arm64)
Terminal
Apple Terminal
Suggested fix ideas:
.agent,.agents,.sharedif they are not intended as user skill roots.Current workaround (works reliably):
OPENCODE_DISABLE_EXTERNAL_SKILLS=1 opencode