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
.cursor/rules/langgraph.mdcWhat 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.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/langgraph.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/langgraph.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/langgraph.mdManually: put the files in place
.clinerules/langgraph.mdStep 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.