Agent skill

Langgraph Error Handling

by soba-labs in soba-labs/langchain-agent-skills

Implement LangGraph error handling with current v1 patterns.

MITAuto-check passedAI & LLM Engineering

Install Langgraph Error Handling

skills CLI
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install soba-labs/langchain-agent-skills langgraph-error-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/soba-labs/langchain-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/langgraph-error-handling .claude/skills/langgraph-error-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
langgraph-error-handling
GitHub stars
107
Token cost
~1.5k tokens
SKILL.md length
387 words
Files
16 (incl. scripts, references, assets)
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Implement LangGraph error handling with current v1 patterns.

  • Works in 3 steps: Retry Transient Failures → LLM Recovery Loop → Human-In-The-Loop Escalation
  • Users need to classify failures
  • SKILL.md covers Use This Skill For, Strategy Selection, Minimal Patterns and ToolNode Error Handling, plus 4 more sections
  • Runs JavaScript and Python scripts from its folder; calls uv

What it does

Langgraph Error Handling is an agent skill from soba-labs/langchain-agent-skills. Implement LangGraph error handling with current v1 patterns. Use when users need to classify failures, add RetryPolicy for transient issues, build LLM recovery loops with Command routing, add human-in-the-loop with interrupt()/resume, handle ToolNode errors, or choose a safe strategy between retry, recovery, and escalation.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 24 other files, including scripts, reference files and assets (for example `assets/examples/human-loop-example/js/index.js`, `assets/examples/human-loop-example/js/package.json` and `assets/examples/human-loop-example/python/graph.py`).

It sits in AI & LLM Engineering, covering Building AI agents, Error handling and Human-in-the-loop approvals. It works with LangGraph. The repository describes itself as: A collection of agent-optimized LangChain, LangGraph and LangSmith skills for AI coding assistants. The licence is MIT.

When your agent uses it

  • Users need to classify failures
  • Add RetryPolicy for transient issues
  • Build LLM recovery loops with Command routing
  • Add human-in-the-loop with interrupt()/resume

Example prompts

  • “/langgraph-error-handling”

Requirements

  • Python 3
  • Node.js

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Retry Transient Failures
  2. LLM Recovery Loop
  3. Human-In-The-Loop Escalation

What it can do on your machine

Read from SKILL.md and the folder at commit a2d4a10. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript and Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Langgraph Error Handling loads about 1.5k tokens when it runs, and up to ~18k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 387 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~18k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from soba-labs/langchain-agent-skills at commit a2d4a10, republished under its MIT licence (© soba-labs). 387 words, ~1,488 tokens.

Download SKILL.mdSave it as .claude/skills/langgraph-error-handling/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
name
langgraph-error-handling
description
Implement LangGraph error handling with current v1 patterns. Use when users need to classify failures, add RetryPolicy for transient issues, build LLM recovery loops with Command routing, add human-in-the-loop with interrupt()/resume, handle ToolNode errors, or choose a safe strategy between retry, recovery, and escalation.

LangGraph Error Handling

Use This Skill For

  • Adding RetryPolicy to flaky nodes (API, DB, model/tool calls)
  • Designing LLM recovery loops (Command + error state + retry counters)
  • Adding human approval/escalation with interrupt() and resume
  • Handling prebuilt ToolNode failures
  • Debugging transactional failure behavior in parallel supersteps

Strategy Selection

Use this order:

  1. Transient/infrastructure issue (429, timeout, 5xx, temporary DB lock) -> RetryPolicy
  2. Recoverable by model/tool args correction -> store error in state and route back with Command
  3. Needs user approval or missing info -> interrupt() + resume
  4. Unknown/programming bug -> let it bubble up and debug
Error TypeOwnerPrimary Mechanism
TransientSystemRetryPolicy
LLM-recoverableLLMState update + Command(goto=...)
User-fixableHumaninterrupt() + Command(resume=...)
UnexpectedDeveloperRaise/log/debug

For full taxonomy, load references/error-types.md.

Minimal Patterns

1) Retry Transient Failures
python
from langgraph.types import RetryPolicy

builder.add_node(
    "call_api",
    call_api,
    retry_policy=RetryPolicy(max_attempts=3, initial_interval=1.0),
)
ts
builder.addNode("callApi", callApi, {
  retryPolicy: { maxAttempts: 3, initialInterval: 1.0 },
});

Notes:

  • Python and JS default retry behavior differs by exception type.
  • Prefer targeted retry_on/retryOn for non-transient domains.
2) LLM Recovery Loop

Use MessagesState in Python for message state.

python
from typing import Literal
from typing_extensions import NotRequired
from langgraph.graph import MessagesState
from langgraph.types import Command

class State(MessagesState):
    error: NotRequired[str]
    retry_count: NotRequired[int]

def agent(state: State) -> Command[Literal["tool", "__end__"]]:
    if state.get("retry_count", 0) >= 3:
        return Command(goto="__end__")
    if state.get("error"):
        return Command(goto="tool")
    return Command(goto="tool")
ts
import { StateGraph, Command, END } from "@langchain/langgraph";

// If a node returns Command in JS, add `ends` on addNode.
builder.addNode("agent", agentNode, { ends: ["tool", END] });
3) Human-In-The-Loop Escalation
python
from langgraph.types import interrupt, Command

def human_review(state):
    approved = interrupt({
        "question": "Proceed?",
        "payload": state["pending_action"],
    })
    return Command(goto="execute" if approved else "cancel")

# resume
graph.invoke(Command(resume=True), config={"configurable": {"thread_id": "t-1"}})
ts
import { Command, interrupt } from "@langchain/langgraph";

const approved = interrupt({ question: "Proceed?" });
// later
await graph.invoke(new Command({ resume: true }), {
  configurable: { thread_id: "t-1" },
});

Requirements:

  • Compile with a checkpointer for interrupt flows.
  • Reuse the same thread_id on resume.

For deep HITL patterns, load references/human-escalation.md.

ToolNode Error Handling

python
from langgraph.prebuilt import ToolNode

tool_node = ToolNode(tools, handle_tool_errors=True)
tool_node = ToolNode(tools, handle_tool_errors="Please try again.")
tool_node = ToolNode(tools, handle_tool_errors=(ValueError, TypeError))

Use custom handlers when you need deterministic error shaping for model recovery. For broader tool-recovery design, load references/llm-recovery.md.

Critical Behavior (Do Not Skip)

  1. Supersteps are transactional: one failing parallel branch fails the whole superstep state update.
  2. RetryPolicy retries failing branches, not successful siblings.
  3. interrupt() re-runs the node on resume: side effects before interrupt must be idempotent, or moved after interrupt / separate node.
  4. JS Command routing requires ends metadata on addNode(...).
  5. Use explicit retry limits (max_attempts, plus state counters for recovery loops).
Show full SKILL.md (125 more words)Show less

Local Assets In This Skill

Scripts
  • scripts/classify_error.py: classify exception category and recommended handling
  • scripts/wrap_with_retry.py: generate boilerplate node wrappers with retry/recovery/escalation options

Run from repo root:

bash
uv run skills/langgraph-error-handling/scripts/classify_error.py TimeoutError --verbose
uv run skills/langgraph-error-handling/scripts/wrap_with_retry.py call_llm --with-llm-recovery
Examples
  • assets/examples/retry-example/: retry + recovery loop (Python and JS)
  • assets/examples/human-loop-example/: interrupt/resume approval flow (Python and JS)

Load References On Demand

  • references/error-types.md: error taxonomy and classification rules
  • references/retry-strategies.md: retry tuning, backoff, circuit-breaker-style patterns
  • references/llm-recovery.md: recovery-loop and ToolNode strategies
  • references/human-escalation.md: human approval, interrupts, and escalation patterns

Common Failure Modes

SymptomRoot CauseFix
interrupt() fails at runtimeno checkpointercompile with checkpointer
Resume starts new rundifferent thread_idreuse same thread_id
JS Command route not takenmissing endsadd ends to addNode
Infinite loopno termination counter/conditionadd retry counter + terminal branch
Retry never triggersexception excluded by retry filterset explicit retry_on/retryOn

© soba-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 15 other files (scripts, references, assets) in skills/langgraph-error-handling of soba-labs/langchain-agent-skills.

  • SKILL.md
  • assets/examples/human-loop-example/js/index.js
  • assets/examples/human-loop-example/js/package.json
  • assets/examples/human-loop-example/python/graph.py
  • assets/examples/human-loop-example/python/requirements.txt
  • assets/examples/retry-example/js/index.js
  • assets/examples/retry-example/js/package.json
  • assets/examples/retry-example/python/graph.py
  • assets/examples/retry-example/python/requirements.txt
  • references/error-types.md
  • references/human-escalation.md
  • references/llm-recovery.md
  • … and 4 more

Open the folder on GitHubat commit a2d4a10

Compare with similar skills

Langgraph Error Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Langgraph Error Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Langgraph Error Handling this skillsoba-labs/langchain-agent-skills107—~1.5kAutomated safety check: PassMIT
LangChain Agent Fundamentalslangchain-ai/langchain-skills1.3k—~3.1kAutomated safety check: PassMIT
Langgraphkid-sid/claude-spellbook189—~3.4kAutomated safety check: PassMIT
Dive Into LangGraphluochang212/dive-into-langgraph457—~837Automated safety check: NotesCustom licence
Langgraph Human In The Looplangchain-ai/langchain-skills1.3k2 repos~4.1kAutomated safety check: PassMIT
Deep Agents Corelangchain-ai/langchain-skills1.3k1 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • LangChain Agent Fundamentals

    langchain-ai/langchain-skills

    Official

    Shows how to build LangChain agents with create_agent, define tools, add a checkpointer and use middleware for human approval and error handling, in Python and TypeScript.

    1.3k GitHub stars~3.1k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Langgraph

    kid-sid/claude-spellbook

    A skill your agent uses when building or debugging LangGraph workflows — designing state graphs, adding conditional routing, wiring checkpointers, streaming tokens, implementing human-in-the-loop…

    189 GitHub stars~3.4k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Dive Into LangGraph

    luochang212/dive-into-langgraph

    A Chinese-language guide and reference for building agents with LangGraph 1.0, from a first ReAct agent through middleware, memory, MCP, RAG and web search.

    457 GitHub stars~837 tokensUpdated 27 days ago
    AI & LLM EngineeringAuto-check: notes
  • Langgraph Human In The Loop

    langchain-ai/langchain-skills

    Official

    INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph.

    1.3k GitHub starsUsed in 2 repos~4.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Deep Agents Core

    langchain-ai/langchain-skills

    Official

    Explains how to build agents with the Deep Agents framework: create_deep_agent, the built-in middleware, the harness, SKILL.md format and configuration options.

    1.3k GitHub starsUsed in 1 repo~3.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Langgraph

    langchain-ai/docs

    Official

    Build stateful, durable agent workflows with LangGraph. An agent skill from langchain-ai/docs.

    425 GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from soba-labs/langchain-agent-skills

All 9 skills in this repo
  • Deepagents Planning Todos

    soba-labs/langchain-agent-skills

    Use the writetodos tool effectively for task planning and decomposition in Deep Agents.

    107 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Deepagents Setup Configuration

    soba-labs/langchain-agent-skills

    Initialize, validate, and troubleshoot Deep Agents projects in Python or JavaScript using the deepagents package.

    107 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Langgraph Agent Patterns

    soba-labs/langchain-agent-skills

    Implement multi-agent coordination patterns (supervisor-subagent, router, orchestrator-worker, handoffs) for LangGraph applications.

    107 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Langgraph Project Setup

    soba-labs/langchain-agent-skills

    Initialize and configure LangGraph projects with proper structure, langgraph.json configuration, environment variables, and dependency management.

    107 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check: notes
  • Langgraph State Management

    soba-labs/langchain-agent-skills

    Design state schemas, implement reducers, configure persistence, and debug state issues for LangGraph applications.

    107 GitHub stars~3.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Langgraph Testing Evaluation

    soba-labs/langchain-agent-skills

    A skill your agent uses when you need to test or evaluate LangGraph/LangChain agents: writing unit or integration tests, generating test scaffolds, mocking LLM/tool behavior, running trajectory…

    107 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Langgraph Error Handling

What does Langgraph Error Handling do?

Implement LangGraph error handling with current v1 patterns. Langgraph Error Handling is an agent skill from soba-labs/langchain-agent-skills. Implement LangGraph error handling with current v1 patterns.

When should I use Langgraph Error Handling?

Langgraph Error Handling fits situations like: users need to classify failures; add RetryPolicy for transient issues; build LLM recovery loops with Command routing; add human-in-the-loop with interrupt()/resume.

How do I install Langgraph Error Handling in Claude Code?

Run `npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a claude-code`. Or copy the skill folder (skills/langgraph-error-handling in soba-labs/langchain-agent-skills) into .claude/skills/langgraph-error-handling in your project. Claude Code loads it when a task matches its description.

How do I install Langgraph Error Handling in Codex?

Run `npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a codex`. Or copy the skill folder (skills/langgraph-error-handling in soba-labs/langchain-agent-skills) into .agents/skills/langgraph-error-handling in your project. Codex loads it when a task matches its description.

Can I use Langgraph Error Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langgraph-error-handling, .gemini/skills/langgraph-error-handling, .github/skills/langgraph-error-handling and .opencode/skills/langgraph-error-handling in your project.

What does Langgraph Error Handling need to run?

Going by SKILL.md and its folder, Langgraph Error Handling needs JavaScript and Python for the scripts in its folder and the command-line tools its instructions call (uv). Our summary lists: Python 3; Node.js.

Does Langgraph Error Handling access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Langgraph Error Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Langgraph Error Handling use?

Langgraph Error Handling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Langgraph Error Handling use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 16k tokens, read only when the agent opens those files.

What are the alternatives to Langgraph Error Handling?

Skills that share tags, products or a category with Langgraph Error Handling: LangChain Agent Fundamentals (langchain-ai/langchain-skills, 1.3k stars), Langgraph (kid-sid/claude-spellbook, 189 stars), Dive Into LangGraph (luochang212/dive-into-langgraph, 457 stars) and Langgraph Human In The Loop (langchain-ai/langchain-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Langgraph Error Handling?

soba-labs (a GitHub organization) maintains it in soba-labs/langchain-agent-skills, which has 107 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 17, 2026.

Source: soba-labs/langchain-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.