graph

A command that draws relationships between Git worktrees and branches. It can show branch hierarchy, commit relationships, recent dates, and other worktree information as Mermaid or Graphviz diagrams.

In plain words
What is it for?
Use it to print or save a dependency graph, include commit and date details, limit its depth, or generate a PNG when Graphviz is installed.
Why use it?
Branch relationships can be difficult to understand from a directory listing or Git commands alone. A diagram makes dependencies and stale worktrees easier to inspect.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mirinodev/maestro/graph
Clone the repo
git clone --depth 1 https://github.com/mirinodev/maestro
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00899
Opus 5 $0.00000 $0.00449
Sonnet 5 $0.00000 $0.00180
Haiku 4.5 $0.00000 $0.00090

Measured yesterday against content hash 1f5e5716d680, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

graph scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt-get install graphviz # Ubuntu
docs/commands/graph.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🔸 graph

Command to visualize worktree dependencies and branch relationships in various formats. Provides insights into branch hierarchy, commit relationships, and worktree health through interactive graphs and diagrams.

Overview

mst graph [options]
mst g [options]  # alias

Usage Examples

Basic Usage

# Display Mermaid diagram (default)
mst graph

# Generate Graphviz DOT format
mst graph --format dot

# Save to file
mst graph --output dependencies.md

Advanced Usage

# Detailed view with commit information
mst graph --show-commits --show-dates

# Generate PNG image (requires Graphviz)
mst graph --format dot --output deps.dot
# Automatically generates deps.png if Graphviz is installed

# Complex analysis with depth limit
mst graph --format mermaid --depth 5 --show-dates --output branch-tree.md

Options

Option Short Description Default
--format <type> -f Output format (mermaid, dot) mermaid
--output <file> -o Save to file instead of stdout stdout
--show-commits Display latest commit information false
--show-dates Show last update dates false
--depth <number> -d Maximum hierarchy depth to display 3

Output Formats

Mermaid Format (Default)

Generates Mermaid.js compatible diagrams for documentation:

mst graph --format mermaid

Output:

graph TD
  main[main]
  feature_authentication[feature/authentication<br/>↑3 ↓0]
  main --> feature_authentication

Graphviz DOT Format

Professional graph visualization with automatic image generation:

mst graph --format dot --output dependencies.dot

Automatic PNG generation:

# If Graphviz is installed, automatically generates dependencies.png
brew install graphviz
mst graph --format dot --output deps.dot
# → Creates both deps.dot and deps.png

Branch Relationship Analysis

The graph command analyzes several aspects of branch relationships:

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 151 lines · 0 tokens per session scan B 1f5e5716d680

Subscribe to this mod's changes

graph is a command published in the GitHub repository mirinodev/maestro (9 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 899 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.