process-tree

View the system process hierarchy as a tree with resource usage. Use when exploring parent-child process relationships, finding what process owns a port, monitoring CPU/memory, or sending signals. Triggers include "process tree", "ptree", "what is running", "process on port", "pstree", "who owns port", "kill process".

7 stars

Best use case

process-tree is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

View the system process hierarchy as a tree with resource usage. Use when exploring parent-child process relationships, finding what process owns a port, monitoring CPU/memory, or sending signals. Triggers include "process tree", "ptree", "what is running", "process on port", "pstree", "who owns port", "kill process".

Teams using process-tree should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/process-tree/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/cli-tools/process-tree/skills/process-tree/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/process-tree/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How process-tree Compares

Feature / Agentprocess-treeStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

View the system process hierarchy as a tree with resource usage. Use when exploring parent-child process relationships, finding what process owns a port, monitoring CPU/memory, or sending signals. Triggers include "process tree", "ptree", "what is running", "process on port", "pstree", "who owns port", "kill process".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# process-tree

CLI tool for visualizing the system process hierarchy with resource usage.

## Quick Start

```bash
# Full process tree
ptree

# Find what is running on port 3000
ptree --port 3000

# Find all node processes
ptree --name node

# Detailed info for a process
ptree info 8421

# Watch mode (refreshes every 2 seconds)
ptree watch
```

## Tree View

```bash
ptree                    # full process tree
ptree --root 8421        # subtree from specific PID
ptree --compact          # collapse identical-name siblings
ptree --sort cpu         # sort by CPU usage
ptree --sort mem         # sort by memory usage
```

## Filter

```bash
ptree --name node        # processes named "node"
ptree --port 3000        # process on port 3000
ptree --user deploy      # processes owned by user
ptree --min-cpu 5        # processes using more than 5% CPU
ptree --min-mem 200      # processes using more than 200MB
```

## Find (flat table)

```bash
ptree find node          # all matching processes in table
ptree find --port 5432   # find by port
ptree find --user www    # find by user
```

## Process Info

```bash
ptree info 8421          # all details including subtree aggregates
```

## Kill

```bash
ptree kill 8421              # send SIGTERM (with confirmation)
ptree kill 8421 --yes        # skip confirmation
ptree kill 8421 --signal SIGKILL   # force kill
ptree kill 8421 --subtree    # kill process and all children
```

## Watch Mode

```bash
ptree watch                  # refresh every 2 seconds
ptree watch --interval 5     # refresh every 5 seconds
ptree watch --name node      # filter in real time
```

Press `q` or `Ctrl-C` to exit watch mode.

## CLI Reference

| Command/Flag | Description |
|---|---|
| (default) | Show full process tree |
| `find <name>` | Flat table of matching processes |
| `info <pid>` | Detailed info for one process |
| `kill <pid>` | Send SIGTERM to process |
| `watch` | Continuously refresh tree |
| `--name <text>` | Filter by process name |
| `--port <N>` | Filter by listening port |
| `--user <name>` | Filter by user |
| `--root <pid>` | Show subtree from PID |
| `--min-cpu <N>` | Minimum CPU % threshold |
| `--min-mem <N>` | Minimum memory MB threshold |
| `--sort cpu\|mem` | Sort children by resource |
| `--compact` | Collapse same-name siblings |
| `--interval <N>` | Watch refresh interval (seconds) |
| `--subtree` | Apply kill to whole subtree |
| `--signal <name>` | Signal to send (SIGTERM or SIGKILL) |
| `--yes` | Skip confirmation prompts |
| `--no-color` | Disable ANSI color |

## Environment Variables

| Variable | Default | Description |
|---|---|---|
| `PTREE_NO_COLOR` | `0` | Disable ANSI color (1 to disable) |
| `PTREE_INTERVAL` | `2` | Watch mode refresh interval (seconds) |
| `PTREE_DEBUG` | `0` | Enable debug logging (1 to enable) |

## Exit Codes

| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | No processes matched |
| 2 | Permission denied |
| 3 | Runtime error |

## Platform Support

Supported: macOS, Linux. Not supported: Windows (exits with clear error message).

Related Skills

process-monitor

7
from heldernoid/agentic-build-templates

Monitor system processes for resource usage using process-tree watch mode. Use when tracking CPU or memory usage over time, finding resource hogs, or watching a specific process. Triggers include "monitor processes", "watch cpu usage", "process monitor", "top processes", "resource usage", "ptree watch".

file-tree-diff

7
from heldernoid/agentic-build-templates

Compare two directory trees and show added, removed, and changed files with color output. Use when you need to compare two versions of a directory, find what changed between releases, audit differences between staging and production file sets, or verify a deployment. Triggers include "compare directories", "directory diff", "what changed in", "file differences between", "ftd", "tree diff".

file-processing

7
from heldernoid/agentic-build-templates

Handle file upload, validation, processing pipelines, and temporary file management in Node.js servers. Use when building file processing APIs with Express and multer, managing temporary files with cleanup, or implementing secure file handling patterns. Triggers include "file upload", "multipart form", "temp file cleanup", "multer config", or any server-side file handling task.

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".

poll-builder

7
from heldernoid/agentic-build-templates

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

Skill: personal-finance

7
from heldernoid/agentic-build-templates

## Overview