lg:edge

lg:edge is a command for Claude Code from TheLobbi/claude. It costs 21 tokens per session (4,903 once invoked), scanned A, original, MIT.

A command for managing edges in LangGraph, where an edge is the connection that determines which graph step runs next. It supports direct connections, conditional choices, and dynamic routing.

In plain words
What is it for?
Use it to add, change, or remove direct and conditional connections, define routing conditions, handle default routes, and test the possible paths.
Why use it?
It reduces mistakes when changing workflow routes by checking that nodes and conditions exist, then updating tests and flow documentation.

Command for Claude Code

Written for Claude Code: arguments in frontmatter. Also seen: mentions Claude Code.

Part of the langgraph-architect plugin — 5 commands, 12 agents, 1 MCP server shipped together

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/thelobbi/claude/edge
Clone the repo
git clone --depth 1 https://github.com/TheLobbi/claude

Made for: Claude Code.

Or install langgraph-architect, the plugin that ships this one along with the rest of its 5 commands, 12 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lg:edge

README.md
[![agentmods](https://agentmods.dev/badge/commands/thelobbi/claude/edge.svg)](https://agentmods.dev/commands/thelobbi/claude/edge)
Your own site
<a href="https://agentmods.dev/commands/thelobbi/claude/edge"><img src="https://agentmods.dev/badge/commands/thelobbi/claude/edge.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,903 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00021 $0.04903
Opus 5 $0.00010 $0.02452
Sonnet 5 $0.00004 $0.00981
Haiku 4.5 $0.00002 $0.00490

Measured yesterday against content hash c1311707e4b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

lg:edge scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/plugins/langgraph-architect/commands/edge.md · 877 lines

How it starts

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

lg:edge - Edge Management

Manage edges (connections) between nodes in LangGraph graphs including regular edges, conditional edges, and dynamic routing.

Workflow Steps

Add Regular Edge

  1. Validate Nodes

    • Check source node exists
    • Check target node exists
    • Verify compatible state schemas
  2. Create Edge

    • Add edge to graph definition
    • Update routing logic
    • Add to graph compilation
  3. Update Tests

    • Add edge test
    • Update integration tests
  4. Update Documentation

    • Update graph diagram
    • Document flow

Add Conditional Edge

  1. Validate Configuration

    • Check source node exists
    • Check target nodes exist
    • Validate condition function
  2. Generate Condition Function

    • Create routing logic
    • Add condition checks
    • Handle default case
  3. Add Conditional Edge

    • Add to graph definition
    • Configure routing map
    • Add error handling
  4. Update Tests

    • Test all routing paths
    • Test edge cases
    • Test default routing
  5. Update Documentation

    • Document routing logic
    • Add decision tree diagram

Remove Edge

  1. Identify Edge

    • Find edge in graph
    • Check for dependencies
  2. Remove Edge

    • Remove from graph definition
    • Clean up routing logic
    • Remove condition function (if orphaned)
  3. Update Tests

    • Remove edge tests
    • Update integration tests
  4. Update Documentation

    • Update graph diagram

Edge Types

Regular Edge

Simple one-way connection.

graph.add_edge("node_a", "node_b")

Flow:

node_a → node_b

Conditional Edge

Branch based on condition.

def route_condition(state: State) -> str:
    """Determine next node based on state."""
    if state["score"] > 0.8:
        return "high_score_path"
    elif state["score"] > 0.5:
        return "medium_score_path"
    else:
        return "low_score_path"

graph.add_conditional_edges(
    "node_a",
    route_condition,
    {
        "high_score_path": "node_b",
        "medium_score_path": "node_c",
        "low_score_path": "node_d"
    }
)

Read the full file on GitHub · 877 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 · 877 lines · 21 tokens per session scan A c1311707e4b8

Subscribe to this mod's changes

lg:edge is a command published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 4,903 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.