Skip to main content
rule CX Codex

langgraph · bhartendu-kumar — Claude Code rule: what it does, how to install

Architecture guidelines and coding conventions for Python projects built on LangGraph, focusing on state schemas and graph structure.

no license ★ 1,054 updated 2025-07-17

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/langgraph.mdc
Open on GitHub

What langgraph does

This rule establishes conventions for LangGraph workflows. It organizes Python repositories into dedicated modules, keeping custom tools in src/components and definitions in src/schemas. File and function names stay in snake_case, while classes follow PascalCase.

The guidelines detail key patterns like StateGraph transitions and retry mechanisms with exponential backoff. The rule advises against monolithic graphs and hardcoded parameters. Without disciplined state schemas, multi-step agent workflows break quickly.

What it helps with

  • Organize LangGraph nodes and schemas into modular directories
  • Define structured agent states with immutable models
  • Prevent infinite loops across conditional graph edges
  • Add exponential backoff retries to network-dependent nodes

Example prompts for the agent

  • Generate a LangGraph repository layout following the standard directory pattern
  • Implement a tool selection node with a dedicated state schema
  • Refactor this monolithic graph into separate subgraphs

How to install langgraph

Manually: put the files in place

.cursor/rules/langgraph.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about langgraph

How to install the langgraph rule in Claude Code?

Save the rule file to .claude/rules/langgraph.md. Claude Code reads this file whenever you work on Python code.

What does the langgraph rule do?

It provides development standards for Python-based LangGraph pipelines, covering repository layout, naming conventions, and state transitions.

Which anti-patterns does this rule help prevent?

It steers developers away from sprawling monolithic graphs, hardcoded parameters, and loops on conditional edges.

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

langgraph by other authors comes first.

langgraph sanjeed5 A Cursor rule with LangGraph practices: how to split nodes, state and subgraphs in a Python project. CX Codex +1 ★ 3,589repo stars langgraph-fundamentals langchain-ai langgraph-fundamentals — a skill for writing LangGraph code across platforms. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling. CX Codex +1 19,300installs langgraph-python-quickstart langchain-ai langgraph-python-quickstart scaffolds a minimal local LangGraph Python agent using the official quickstart. Useful when you need to test a Graph API agent in an isolated folder. CX Codex +1 6,100installs options-analytics-agent-langgraph reason-machines options-analytics-agent-langgraph builds a LangGraph agent that pulls options data from Polygon.io, caches it in ChromaDB and keeps memory across sessions. Useful when you want your own trading assistant. CX Codex +1 2,100installs langgraph-code-review existential-birds LangGraph code review skill for Claude Code and coding agents. It flags state mutations, missing reducers, and broken graph topologies. CX Codex +1 890installs langgraph-implementation existential-birds The langgraph-implementation skill guides LangGraph work with state schemas, graph routing, persistence, and human-in-the-loop pauses for agent applications. CX Codex +1 161installs langgraph-testing-evaluation soba-labs langgraph-testing-evaluation — a skill for Claude Code tests and evaluates LangGraph and LangChain agents. It supports test scaffolds, trajectory scoring, dataset runs, and version comparisons. CX Codex +1 ★ 106repo stars

From the same set11

The whole set →

Project sponsors

Companies that keep this analytics open