Bring the power of Claude Code directly into your n8n automation workflows - Enhanced version with AI Agent Tool support!
🆕 Enhanced Version: This is an enhanced fork that includes AI Agent Tool support, allowing Claude Code to be used by LangChain agents and other AI systems. Install this alongside the base version for additional capabilities.
Imagine having an AI coding assistant that can analyze your codebase, fix bugs, write new features, manage databases, interact with APIs, and automate your entire development workflow - all within n8n. That's exactly what this enhanced node enables.
This enhanced package provides two nodes that you can install alongside any existing Claude Code community node:
- All standard Claude Code SDK functionality
- Manual workflow control and execution
- Full MCP server support
- Perfect for scheduled tasks and user-triggered workflows
- NEW: LangChain-compatible tool for AI agents
- Autonomous code assistance for intelligent agents
- Automatic tool selection by AI agents
- Enables complex multi-step development workflows
Create workflows that automatically review pull requests, suggest improvements, and even fix issues before merging.
Connect error monitoring tools to Claude Code - automatically diagnose and fix production issues in real-time.
Let Claude Code write complex SQL queries, optimize database schemas, and generate migration scripts based on your requirements.
Build n8n workflows that can modify and improve themselves using Claude Code's capabilities.
Automatically generate and update documentation for your entire codebase, APIs, or databases.
Automate the migration of legacy codebases to modern frameworks with intelligent refactoring.
Transform support tickets into code fixes automatically:
- Analyze customer bug reports and reproduce issues
- Generate fixes for reported problems
- Create test cases to prevent regression
- Update documentation based on common questions
- Auto-respond with workarounds while fixes are deployed
Empower AI agents with coding capabilities:
- LangChain agents can automatically call Claude Code for development tasks
- Multi-step reasoning with code execution, file operations, and web research
- Autonomous debugging where agents identify and fix issues independently
- Natural language to code with intelligent tool selection
- Claude Code CLI (required on your n8n server):
npm install -g @anthropic-ai/claude-code claude # Authenticate (requires Claude Pro/Team subscription)
- Open your n8n instance
- Go to Settings → Community Nodes
- Click Install a community node
- Enter:
@holtweb/n8n-nodes-claudecode-enhanced - Click Install
- Restart n8n when prompted
cd ~/.n8n/nodes
npm install @holtweb/n8n-nodes-claudecode-enhanced
# Restart n8ndocker run -it --rm \
-p 5678:5678 \
-e N8N_COMMUNITY_NODE_PACKAGES=@holtweb/n8n-nodes-claudecode-enhanced \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8nNote: For Docker, you'll need to ensure Claude Code CLI is installed inside the container. Consider creating a custom Dockerfile.
📦 NPM Package: @holtweb/n8n-nodes-claudecode-enhanced
Webhook (GitHub Issue) → Claude Code → Create PR → Notify Slack
Automatically implement features or fix bugs when issues are created.
Form Trigger → Claude Code → Execute Query → Send Results
Natural language to SQL - let non-technical users query databases safely.
Git Push → Claude Code → Analyze Code → Block/Approve → Notify
Enforce coding standards and catch issues before they reach production.
HTTP Request → Claude Code → Generate Integration → Test → Deploy
Automatically create integrations with third-party APIs.
Error Logs → Claude Code → Diagnose → Create Fix → Open PR
Turn error logs into actionable fixes automatically.
Support Ticket → Claude Code → Reproduce Issue → Generate Fix → Test → Deploy → Auto-Reply
Transform customer complaints into deployed fixes in minutes, not days.
Set a project path and Claude Code understands your entire codebase context:
- Analyzes existing code patterns
- Follows your coding standards
- Understands your architecture
- Respects your dependencies
Claude Code comes equipped with powerful tools:
- 📁 File Operations: Read, write, edit multiple files
- 💻 Bash Commands: Execute any command
- 🔍 Smart Search: Find patterns across your codebase
- 🌐 Web Access: Fetch documentation and resources
- 📊 Database Access: Via MCP servers
- 🔗 API Integration: GitHub, Slack, and more via MCP
Extend Claude Code with specialized capabilities:
- PostgreSQL/MySQL database access
- GitHub repository management
- Slack workspace integration
- Custom tool development
{
"operation": "query",
"prompt": "Analyze this codebase and suggest performance improvements",
"projectPath": "/path/to/your/project",
"model": "sonnet"
}{
"operation": "query",
"prompt": "Create an optimized query to find users who haven't logged in for 30 days",
"projectPath": "/path/to/project",
"model": "opus"
}{
"operation": "query",
"prompt": "Customer reports: 'Login button not working on mobile devices'\n\nAnalyze this issue, find the root cause, and create a fix",
"projectPath": "/path/to/web-app",
"model": "opus",
"allowedTools": ["Read", "Write", "Edit", "Bash", "Grep"],
"additionalOptions": {
"systemPrompt": "Focus on mobile compatibility issues. Check responsive CSS and JavaScript event handlers."
}
}With MCP configuration (.mcp.json):
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
}
}
}NEW! Claude Code can now be used as a tool by AI agents in n8n, not just as a regular workflow node.
- Regular Node: You add Claude Code to your workflow and control when it executes
- AI Agent Tool: AI agents (like LangChain agents) can automatically call Claude Code when they need coding assistance
- Add the "Claude Code Enhanced Tool" node to your workflow (separate from the regular "Claude Code Enhanced" node)
- Configure the tool's name, description, and parameters
- Connect it to your AI agent (LangChain Agent, etc.)
- The agent will automatically use Claude Code when it needs to:
- Analyze or write code
- Fix bugs
- Read/write files
- Execute bash commands
- And more!
Manual Chat Trigger
↓
LangChain Agent
↓ (tools)
Claude Code Tool ← The agent calls this automatically when needed
User: "Please analyze my Python project and suggest improvements"
Agent: Automatically calls Claude Code Tool to examine the codebase and provide detailed recommendations
This makes Claude Code available to any AI agent in your n8n workflows, enabling more autonomous and intelligent automation!
Schedule Trigger (Daily)
↓
Claude Code (Analyze codebase for improvements)
↓
Create GitHub Issues
↓
Assign to Team
Slack Command
↓
Claude Code (Generate code from description)
↓
Create Pull Request
↓
Run Tests
↓
Notify Results
Error Webhook
↓
Claude Code (Diagnose issue)
↓
If (Can fix automatically)
├─ Yes: Create Fix PR
└─ No: Create Detailed Issue
Make sure Claude Code CLI is installed and authenticated on your n8n server:
claude --version # Should show the versionIf not installed, see the Quick Start section above.
- In n8n, create a new workflow
- Add a Manual Trigger node (for testing)
- Add the Claude Code Enhanced node
- Configure:
- Operation: Query
- Prompt: "Analyze the code in this directory and suggest improvements"
- Project Path:
/path/to/your/project - Model: Sonnet (faster) or Opus (more powerful)
- Click Execute Workflow
- Watch Claude Code analyze your project!
- Check out the workflow templates for ready-to-use examples
- See the examples directory for configuration options
- Read about MCP servers for database and API access
Always set a project path for better context and results:
/home/user/projects/my-app
Control what Claude Code can do in .claude/settings.json:
{
"permissions": {
"allow": ["Read(*)", "Write(*)", "Bash(npm test)"],
"deny": ["Bash(rm -rf *)"]
}
}Use "Continue" operation to build complex multi-step workflows while maintaining context.
- Structured: Full details with metrics
- Messages: For debugging
- Text: Simple results for chaining
We're constantly improving! Upcoming features:
- Visual workflow builder for Claude Code operations
- Pre-built workflow templates
- Enhanced debugging tools
- More MCP server integrations
MIT - Build amazing things!
Ready to revolutionize your development workflow? Install Claude Code for n8n today and join the future of automated software development!
Made with ❤️ by Adam Holt