langgraphlisted
Install: claude install-skill Claudient/Claudient
# LangGraph Skill
## When to activate
- Building a stateful agent that needs to pause, resume, or branch based on conditions
- Implementing human-in-the-loop workflows (agent pauses for approval before continuing)
- Orchestrating multi-step agents with complex branching logic
- Persisting agent state across failures or sessions (checkpointing)
- Building multi-agent systems where subgraphs collaborate
## When NOT to use
- Simple single-turn AI calls — use the Claude API or Vercel AI SDK skill directly
- Linear pipelines with no branching — overkill, use sequential function calls
- When you need a hosted agent loop — use the Mastra skill instead
- Frontend streaming chat UIs — use the Vercel AI SDK skill
## Instructions
### Installation
```bash
npm install @langchain/langgraph @langchain/anthropic @langchain/core
# Python
pip install langgraph langchain-anthropic
```
### Core concepts
LangGraph models agents as **graphs**:
- **Nodes** — functions that run and update state
- **Edges** — connections between nodes (always run → next node, or conditional)
- **State** — a typed object that flows through the graph and accumulates updates
- **Checkpointer** — persists state between runs (enables resume, human-in-the-loop)
### Basic StateGraph (TypeScript)
```typescript
import { StateGraph, Annotation, END, START } from '@langchain/langgraph'
import { ChatAnthropic } from '@langchain/anthropic'
import { tool } from '@langchain/core/tools'
import { z } from 'zod'
// 1. Define