---
title: "Find and stop background node processes on a Mac. — iSurge"
description: "Dev servers and watchers keep running after you close the editor. How to find and stop them in Terminal, and how iSurge shows what each project costs."
url: https://isurgemac.com/blog/mac-dev-projects-running/
---

[BLOG](https://isurgemac.com/blog/)

# Find and stop background node processes on a Mac. What each project left running, what it costs, and how to put it away.

Dev servers and watchers keep running after you close the editor. How to find and stop them in Terminal, and how iSurge shows what each project costs.

By Ruthran Baskar · 27 October 2026 · 6 min read

IN SHORT

- List the servers you have open with `lsof -nP -iTCP -sTCP:LISTEN`, and find one port with `lsof -i:3000`.

- Stop one program with `kill` and its number. Use `pkill -f` with the exact command, not `pkill node`.

- A program whose parent number (PPID) is 1 has lost what started it. That is usually what got left behind.

- iSurge’s Dev › Running groups all of this by project, says what is safe to put away, and can Pause a whole project and Resume it later.

To find background node processes on a Mac, open Terminal and run `lsof -nP -iTCP -sTCP:LISTEN` for the servers, or `pgrep -fl node` for every node program. To stop one, run `kill` with its process number. Below are the commands, how to tell which project a process belongs to, and what to stop without breaking something you still need.

DEV

## Why do dev servers keep running?

A project rarely runs one program. A web app might have a dev server, a CSS watcher, a type checker and a test runner, each its own process. When you close the terminal or the editor, most of them stop with it. Some don’t: anything started in the background, by a script, or by a coding agent can keep going on its own. It holds its port and its memory until something stops it.

Activity Monitor doesn’t help much here. It shows a column of rows all called `node` or `python`, with no word on which folder they run in. (Why Mac lists so many processes at all is in [A thousand processes](https://isurgemac.com/blog/a-thousand-processes/).)

DEV

## How do you find them in Terminal?

Start with what is listening for connections. These are your servers:

`lsof -nP -iTCP -sTCP:LISTEN`

Each line shows the program, its process number (PID) and the port. If you only care about one port:

`lsof -i:3000`

Watchers and build tools don’t listen on a port, so look for them by name. This prints each matching process number with its whole command line:

`pgrep -fl node`

To see which ones were left behind, add the parent number and how long each has run. A parent of 1 means the program now belongs to launchd, macOS’s first process, because whatever started it has gone:

`ps -eo pid,ppid,etime,command | grep -E 'node|python' | grep -v grep`

And to see which project a process belongs to, ask for its working folder:

`lsof -a -p 12345 -d cwd`

DEV

## How do you stop them safely?

- `kill -INT 12345` asks the program to stop as Ctrl-C would. Most dev servers close cleanly this way.

- `kill 12345` sends the usual stop signal. Try it if the first one was ignored.

- `pkill -f 'next dev'` stops every process whose command line matches. Make the pattern exact.

- `kill -9 12345` forces it. Keep it for last: the program gets no chance to save or close files.

Avoid a bare `pkill node`. Editors and other tools run node programs of their own, and that line stops all of them along with your server. Check what a pattern matches with `pgrep -fl` before you use it with `pkill`.

Before you stop one, it’s worth a look at two things: is it busy (a build or tests halfway through), and is anything connected to it (a browser tab still open on it)? `ps` shows its CPU with `ps -o %cpu= -p 12345`, and `lsof -i:3000` lists connections as well as the listener.

DEV

## How iSurge shows what each project runs

iSurge 0.4 has a Dev page in its window that does this reading for you. Its first tab, Running, sorts your programs into projects. A project is the folder a program runs in, up to the nearest folder with Git, `package.json`, `Package.swift`, `pyproject.toml` or the like. iSurge also follows each program’s line of parents to say who started it: you in a terminal (Terminal, iTerm2, Warp, Ghostty and others), an editor, or a coding agent such as Claude Code or Codex.

Dev › Running: each project with what it uses.

Each project gets a card. It shows where the folder is and who started it, the memory it uses split by what uses it (its programs, its containers, an agent’s session), its CPU, the share of a full battery it used since midnight, and how much its build folders take on disk. Runs lists every command, and opens into a row each with its port, memory and CPU. If a project asks for one version of node or python and runs on another, the card says so.

The battery figure comes from the energy macOS measures for each program, added up per project. The ⋯ menu opens the project’s localhost, shows it in Finder, opens a Terminal in its folder, or sets Tell Me When It’s Done for a build or test run: its time shows beside the notch, and the notch says when it ends.

DEV

## Left behind: what’s safe to put away?

Left behind is the last card on Running. It lists programs still running after what started them went away: a closed terminal window, an ended agent session, a quit editor. Programs inside tmux, screen or Zellij don’t count, because those sessions are meant to outlive the window.

Each program shows what it is, the folder it runs in by name, and one of three badges:

- **Safe to put away**: idle, and nothing is connected to it.

- **In use**: a browser tab or an app is connected to its port now. Putting it away cuts that off.

- **Working**: using 5% CPU or more now, maybe building or running tests. Putting it away stops that partway.

Put Away first shows what goes and how much memory and which ports it frees. When there are several, it leaves the In use and Working ones unticked. Each program is asked to stop as Ctrl-C would, then once more if it doesn’t. If one still won’t, iSurge tells you, and Force Quit is your choice. Nothing is deleted. iSurge only stops the exact programs it read, checked by number and start time, so a new program that took an old number is never touched.

If you want to hear about it, Settings › Dev › Notify me when › Programs left running can tell you when they hold over 1 GB (the default), over 2 GB, or when memory is low. iSurge only tells you. It never stops anything by itself.

DEV

## Pause and Resume a whole project

When you switch to other work, you don’t have to stop a project’s programs one by one. Pause on its card shows what stops (its programs and its containers), what stays (a task you are watching, a Homebrew service another project uses, an agent’s session, which is yours to stop), and the commands Resume will run. Then everything stops and gives back its memory.

Pause isn’t a freeze. The project stays on Running under Paused, with Resume. Resume opens a Terminal window in the project’s folder for each command and runs it again as it was typed, starts its containers, and says whether its ports are free. Its output is in that window, and Ctrl-C stops it there.

The notch’s Dev tab: Pause without opening the window.

The same Pause is in the notch’s Dev tab, which shows while something is running, and the menu bar’s Dev card opens the full page. The Dev page appears in the window on its own once you use dev servers, containers or Homebrew; Settings › Dev can show it always or never.

## Questions

### Why is my dev server still running after I closed VS Code?

It was probably started in the background, by a script or by an agent, so it didn’t stop with the editor. Find it with `lsof -i:3000` or `pgrep -fl node` and stop it with `kill`.

### Is it safe to kill a node process?

Usually, if it’s a dev server or watcher you started. Ask it to stop first (`kill -INT`), check it isn’t busy or in use, and keep `kill -9` for last. Don’t match all of `node`: your editor’s tools run on it too.

### Does iSurge stop anything on its own?

No. Put Away and Pause always show what will stop and ask first. Its alerts only tell you.

Dev is part of iSurge 0.4. See [the changelog](https://isurgemac.com/changelog/) for everything in it, and [pricing](https://isurgemac.com/pricing/) for a year or Lifetime.

## Get iSurge

Pay once, yours for good.

[Buy iSurge](https://isurgemac.com/pricing/)

Already have it? [Download](https://isurgemac.com/download)

Requires a Mac with Apple silicon (M1 or later) and macOS 15 Sequoia or later. Notch features need a MacBook with a notch; everything else works on any supported Mac.
