I've seen too many vague posts about "Claw eating CPU" with zero actionable diagnostics. If you're complaining about performance, you need to isolate the problem to a specific thread before anyone can help you. General "high CPU" reports are noise. The primary suspect is usually a language server thread gone wild, but it could be indexing, a misbehaving plugin's background process, or a deadlock. You must identify which one.
On Linux/macOS, `htop` is the tool. On Windows, you need Process Explorer from Sysinternals. The goal is to find the specific Claw thread consuming sustained high CPU, note its Thread ID (TID) or PID, and map it to a known function. Here's the concrete process.
**Step 1: Launch the right tool with proper settings.**
* Linux/macOS (`htop`):
* Install it if needed (`sudo apt install htop` / `brew install htop`).
* Run `htop` in a terminal.
* Press `F2` (Setup), go to "Display options," and ensure "Tree view" is enabled. This shows parent/child relationships.
* Also enable "Custom thread names" if available. This is critical.
* Windows (Process Explorer):
* Download from Microsoft's site.
* Run as Administrator for full visibility.
* Find `claw.exe` or `claw64.exe` in the list.
* Double-click the process, then go to the "Threads" tab. This is the equivalent view.
**Step 2: Identify the offending thread.**
* In `htop`, with Tree view on, expand the Claw process (press `+`). You'll see its child threads.
* Sort by CPU percentage (press `F6`, then choose `%CPU`). Look for a thread consistently at a high percentage (e.g., >25% sustained).
* The key column is the `COMMAND` column, which may show a thread name if Claw/plugins set it. Common culprits:
* `lsp-*`, `clangd`, `jdtls`, `rust-analyzer` → Language server thread.
* `indexer`, `scan`, `pool` → File indexing.
* `gc`, `finalizer` → Garbage collection (usually short spikes).
* A plugin name like `copilot.*` or `tabnine`.
* In Process Explorer, the "Threads" tab shows CPU time and Start Address. The "Start Address" column often shows a DLL or function name that can be googled.
**Step 3: Correlate and act.**
Once you have the thread name/TID, you can report something useful. For example:
> "Claw 2024.1.3 on Ubuntu 22.04, CPU pinned at 110% on one core. `htop` shows a single thread named `lsp-jdtls` consistently at 98% CPU. Plugin list: Java LSP (v1.2), Project Viewer (v4.5)."
This tells us it's almost certainly the Java language server, not Claw core. The next steps become clear: check the Java project size, invalidate caches, or debug the LSP plugin configuration.
Without this specific thread data, you're asking us to guess. Guesses waste everyone's time. Do the profiling work first. If you need help interpreting the thread names, post the *specific* output from `htop` or Process Explorer, along with your exact Claw version and OS.
—davidr
—davidr