Skip to content

Opencode runs Claude processes that kill my machine #17

@wojteksbt

Description

@wojteksbt

Summary

When running opencode from inside the pai-opencode repository directory, after each prompt it spawns a large number of claude processes, quickly saturating CPU and making macOS unresponsive (often requiring a reboot). This does not happen when running opencode from other directories on the same machine.

This looks like something in this repo’s configuration / integration triggers repeated Claude CLI invocations.

Environment

Steps to reproduce

  1. Clone and setup this repo:
    git clone https://github.com/Steffen025/pai-opencode
    cd pai-opencode
    bun run .opencode/PAIOpenCodeWizard.ts
  2. Start opencode from the repo root:
    opencode
  3. Enter any prompt (even a short one like “hi”) and submit.
  4. Repeat with 1–2 more prompts.

Expected behavior

  • opencode handles each prompt normally without spawning an unbounded number of claude processes.
  • CPU usage remains stable/usable.

Actual behavior

  • After each prompt submission, many claude processes appear and accumulate.
  • CPU quickly spikes toward 100% across cores, the system becomes sluggish/unresponsive, and recovery sometimes requires a reboot.

Frequency

  • 100% reproducible when launched inside pai-opencode repo root.
  • 0% reproducible when launched from other directories on the same machine.

What I already tried / additional observations

  • Setting export OPENCODE_DISABLE_CLAUDE_CODE=1 does not help.
  • Renaming ~/.claude does not help.
  • After renaming ~/.claude, opencode recreates a .claude folder and adds a project named:
    • -Users-Wojtek-repos-pai-opencode

Notes / suspicion

Because the behavior depends on the working directory, it may be triggered by something in this repo (e.g., config files, hooks, or integration that causes repeated Claude CLI invocations). Any idea what might happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions