Skip to content

YashK55/PortHawk

Repository files navigation

PortHawk

See every port your machine is listening on, know which ones a coding agent left behind, and kill the ones that shouldn't still be running.

npm version VS Code Marketplace Open VSX CI License: MIT

Why

AI coding agents — Claude Code, Cursor, and others — spin up dev servers in your terminal constantly, and it's easy to lose track of which ones are still running long after you've moved on. A leftover node, python, or next dev process quietly holding onto a port isn't dangerous, but it's clutter, and eventually it collides with something you're trying to start fresh.

The obvious fix is a port-monitor extension, but most of the existing ones are closed-source: you're installing something with filesystem and process access and just trusting that it's not phoning home. PortHawk is a small, open-source, telemetry-free alternative — you can read every line of what it does, because there isn't much of it.

It also does one thing generic port listers don't: it tags each listening port as agent, manual, or unknown based on whether the process traces back to a known coding-agent or editor terminal, so the orphaned ones actually stand out.

Install

VS Code Marketplace

Search for PortHawk in the Extensions view, or install directly:

ext install YashK55.porthawk-vscode

Or from the command line:

code --install-extension YashK55.porthawk-vscode

Open VSX (Cursor, Windsurf, VSCodium, and other forks)

VS Code forks that use Open VSX instead of the Microsoft Marketplace can install the same extension from open-vsx.org/extension/YashK55/porthawk-vscode, or search PortHawk directly in the Extensions view of Cursor, Windsurf, or VSCodium.

Note: vscode.dev and github.dev aren't supported — browser-based VS Code has no process or filesystem access, so there's nothing for PortHawk to detect there.

CLI (npx)

No install needed:

npx porthawk list

Or install it globally:

npm install -g porthawk
porthawk watch

Features

  • Cross-platform port detection — Windows, macOS, and Linux, with native OS commands as a fallback if the primary detection method comes up empty.
  • Agent-aware classification — every listening port is tagged agent, manual, or unknown depending on whether its process traces back to a known coding-agent or editor terminal, not just a generic PID list.
  • VS Code sidebar + status bar — a dedicated Activity Bar view grouped by process name, plus a live status bar count, both native to your editor's theme.
  • porthawk watch — a live, keyboard-driven terminal UI (arrow keys to select, k to kill, q to quit), not just a static table.
  • Confirmation before every kill — in both the CLI and the extension, so nothing gets terminated on a stray keypress or click.
  • No telemetry, ever, by default — nothing phones home. If usage analytics are ever added, they'll be opt-in and clearly disclosed.
  • Works in any Open VSX–based fork — Cursor, Windsurf, VSCodium, Trae — not just VS Code itself.

How it compares

PortHawk Typical closed-source port-monitor extension
Source available to read
Telemetry disclosed (or absent) Often unclear
Tags agent-spawned vs manual ports
Works outside VS Code (CLI)
Works in Open VSX forks Varies

This isn't a claim that every alternative is malicious — most probably aren't. It's that with PortHawk you don't have to take that on faith.

Contributing

Issues and pull requests are welcome. This is a pnpm workspace with three packages — packages/core (detection/kill engine), packages/cli, and packages/vscode-ext — sharing one core dependency.

pnpm install
pnpm run build
pnpm run test

Please open an issue before a large change so the direction can be agreed on first.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages