langchain — Claude Code skill: LangChain and LangGraph
Hands Claude runnable patterns for LangChain and LangGraph: LCEL pipes, retrieval over Chroma, tool-using agent graphs, typed output and per-session memory.
no license ★ 301 updated 2026-10-23
npx skills add hoodini/ai-agents-skills --skill langchain -a claude-codeWhat langchain does
The skill gives Claude short code samples for LLM apps. It walks through LCEL pipes, a retrieval chain backed by Chroma, a LangGraph state machine with tool nodes and conditional edges, output shaped by a pydantic model, chat history keyed by session, and token streaming. A resources list at the end points to the LangChain, LangGraph and LangSmith docs.
Install with npx skills add hoodini/ai-agents-skills --skill langchain -a claude-code, and the file lands at ~/.claude/skills/langchain/SKILL.md. Python packages come separately: pip install langchain langchain-openai langchain-anthropic langgraph.
LangSmith tracing needs LANGCHAIN_TRACING_V2, LANGCHAIN_API_KEY and LANGCHAIN_PROJECT set in the environment; no key means nothing gets reported. Two spots in the samples age badly: the model is pinned to claude-3-sonnet-20240229, and structured output imports from langchain_core.pydantic_v1 instead of pydantic. Check that import against the version you run.
What it helps with
- wire a retrieval chain over Chroma with a retriever
- model an agent as a LangGraph state machine with tools
- get typed fields back from a model using a pydantic schema
- keep chat history per
session_id - trace chain runs in LangSmith
Example prompts for the agent
- Build a LangChain RAG chain over Chroma that answers only from the retrieved context
- Turn this into a LangGraph agent with
searchandcalculatortools and a stop condition - Switch this call to streaming with
astreamand turn on LangSmith tracing
How to install langchain
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill langchain -a claude-code2Manually: put the files in place
~/.claude/skills/langchain/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/langchain/
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill langchain -a codex2Manually: put the files in place
.agents/skills/langchain/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill langchain -a cursor2Manually: put the files in place
.cursor/skills/langchain/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoodini/ai-agents-skills skills/langchain2Manually: put the files in place
.github/skills/langchain/SKILL.md1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill langchain -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoodini/ai-agents-skills --path skills/langchainManually: put the files in place
.devin/skills/langchain/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about langchain
How do I install langchain in Claude Code?
Run npx skills add hoodini/ai-agents-skills --skill langchain -a claude-code. The skill file then sits at ~/.claude/skills/langchain/SKILL.md.
What does the langchain skill do?
It feeds Claude code samples for LangChain and LangGraph work: LCEL chains, Chroma retrieval, agent graphs with tools, structured output and session memory.
Does it install the Python packages too?
No, they are a separate step: pip install langchain langchain-openai langchain-anthropic langgraph. The samples import from those packages.