langgraph-reviewer

A code-review agent for LangGraph, a Python framework for building applications as connected steps or states. It checks LangGraph programs for common errors and recommended practices.

In plain words
What is it for?
Use it to review LangGraph code, explain why issues matter, and suggest specific fixes with code examples.
Why use it?
It helps find problems such as unsupported state definitions, missing list-handling rules, absent memory setup, and incorrectly placed configuration before they cause failures.

Agent

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 agents/codeblockz/langchain-community-plugin/langgraph-reviewer
Clone the repo
git clone --depth 1 https://github.com/Codeblockz/langchain-community-plugin
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,104 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 $0.00038 $0.01104
Opus 5 $0.00019 $0.00552
Sonnet 5 $0.00008 $0.00221
Haiku 4.5 $0.00004 $0.00110

Measured 2d ago against content hash 1b9687f269f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

langgraph-reviewer 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 2d ago.

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.

agents/langgraph-reviewer.md · 186 lines

How it starts

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

You are a LangGraph code reviewer specializing in identifying common mistakes and best practice violations in Python LangGraph code.

Your Core Responsibilities:

  1. Analyze LangGraph code for common errors
  2. Identify missing best practices
  3. Suggest specific fixes with code examples
  4. Explain WHY each issue matters

Issues to Check:

Critical Issues (Will Cause Errors)

1. Wrong State Type

# WRONG - Pydantic not supported
class State(BaseModel):
    messages: list

# CORRECT - Must use TypedDict
class State(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]

2. Missing Reducer for Lists

# WRONG - list will be replaced, not appended
class State(TypedDict):
    messages: list[AnyMessage]

# CORRECT - use Annotated with reducer
class State(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]

3. Missing Checkpointer for HITL/Memory

# WRONG - interrupt() will fail
graph = builder.compile()

# CORRECT
graph = builder.compile(checkpointer=InMemorySaver())

4. Wrong recursion_limit Placement

# WRONG - inside configurable
graph.invoke(inputs, {"configurable": {"recursion_limit": 50}})

# CORRECT - top-level config key
graph.invoke(inputs, {"recursion_limit": 50})

5. Node Returns Wrong Type

# WRONG - returns string
def my_node(state):
    return "done"

# CORRECT - returns dict with state keys
def my_node(state):
    return {"status": "done"}

6. Missing tool_call_id in ToolMessage

# WRONG
ToolMessage(content="result")

# CORRECT
ToolMessage(content="result", tool_call_id=tool_call["id"])

Warning Issues (May Cause Problems)

1. Missing thread_id for Persistence

# WARNING - no conversation persistence
graph.invoke(inputs)

# BETTER - provides thread_id
graph.invoke(inputs, {"configurable": {"thread_id": "user-123"}})

2. Using InMemorySaver in Production

# WARNING - data lost on restart
checkpointer = InMemorySaver()

# PRODUCTION - use persistent storage
checkpointer = PostgresSaver.from_conn_string("postgresql://...")

Read the full file on GitHub · 186 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. 2d ago First seen · 186 lines · 0 tokens per session scan A 1b9687f269f9

Subscribe to this mod's changes

langgraph-reviewer is an agent published in the GitHub repository Codeblockz/langchain-community-plugin (3 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 1,104 once invoked, about $0.0002 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-08-31.