# Node Inspect Debugger

Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools...

- Repository: https://github.com/EKKOLearnAI/ekko-studio (11634 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add EKKOLearnAI/ekko-studio --skill node-inspect-debugger -g -a claude-code -y`
Codex: `npx skills add EKKOLearnAI/ekko-studio --skill node-inspect-debugger -g -a codex -y`
Cursor: `npx skills add EKKOLearnAI/ekko-studio --skill node-inspect-debugger -g -a cursor -y`
Gemini CLI: `npx skills add EKKOLearnAI/ekko-studio --skill node-inspect-debugger -g -a gemini-cli -y`

## Description

Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools Protocol, heap snapshots, and CPU profiles.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Node Inspect Debugger

Use when Node.js debugging requires hidden locals, async hangs, flaky tests, child processes, startup races, memory analysis, or CPU profiling.

Default to `node inspect` first. Use Chrome DevTools Protocol only for scripted breakpoints, automated state capture, heap snapshots, or CPU profiles.

## Quick start

```bash
node inspect path/to/script.js
node --inspect-brk --import tsx path/to/script.ts
kill -SIGUSR1 <pid>
node inspect -p <pid>
curl -s http://127.0.0.1:9229/json/list | jq
```

For a test runner such as Vitest, debug one file with one worker and avoid worker pools while stepping.

## Debugger REPL

- Continue and step: `cont`, `next`, `step`, `out`, `pause`.
- Breakpoints: `sb('file.js', 42)`, `sb(42)`, `sb('functionName')`, `breakpoints`, `cb('file.js', 42)`.
- Inspect: `bt`, `list(8)`, `watch('expr')`, `exec expr`.
- Current scope: enter `repl`, evaluate locals, then press `Ctrl+C` to exit REPL mode.
- Exit safely: use `cont` before quitting if the process should keep running; otherwise use `kill`.

## Safe setup

- Prefer `127.0.0.1` inspector binds. Do not expose `--inspect=0.0.0.0` unless the network is isolated.
- Use `--enable-source-maps` when TypeScript source breakpoints need it.
- `NODE_OPTIONS=--inspect-brk` can propagate the inspector to child processes, but each process needs a unique port.
- For a long-lived service, confirm the PID and `/json/list` target before attaching.

## Programmatic CDP

Install temporary tooling outside the project unless it is already a dependency:

```bash
mkdir -p /tmp/cdp-tools
npm --prefix /tmp/cdp-tools install chrome-remote-interface
NODE_PATH=/tmp/cdp-tools/node_modules node /tmp/cdp-debug.cjs
```

Minimal driver:

```js
const CDP = require("chrome-remote-interface");

(async () => {
  const client = await CDP({ port: 9229 });
  const { Debugger, Runtime } = client;

The rest: https://github.com/EKKOLearnAI/ekko-studio/blob/HEAD/packages/ekko-agent/skills/node-inspect-debugger/SKILL.md
