n8n nodes for Anthropic Claude AI and PRD Agent - includes session management, PRD generation, and automatic Markdown documentation
npm install n8n-nodes-claudeThis is an n8n community node package that provides two powerful nodes for integrating Anthropic's Claude AI into your n8n workflows:
1. Claude Node: Execute Claude CLI commands with full agentic capabilities
2. PRD Agent Node: Product Requirements Document management with specialized AI agents
n8n is a fair-code licensed workflow automation platform.
Anthropic Claude is a family of large language models developed by Anthropic.
Claude CLI is a command-line interface that provides agentic AI capabilities with file system access and tool usage.
Claude CLI must be installed on the system running n8n:
``bash`
npm install -g @anthropic-ai/claude-code
For detailed installation instructions, see the Claude CLI Installation Guide.
Follow the installation guide in the n8n community nodes documentation.
1. Navigate to your n8n custom nodes directory:
`bash`
cd ~/.n8n/nodes
2. Install dependencies:
`bash`
cd n8n-nodes-claude
npm install
3. Build the node:
`bash`
npm run build
4. Restart n8n to load the custom node
See PRD Node Documentation for detailed information and examples.
This node executes Claude CLI commands with full agentic capabilities including file system access, tool usage, and multi-turn reasoning.
Parameters:
- Prompt (required): The command/query to send to Claude CLI
- CLI Options:
- Output Format: Choose JSON, Text, or Stream JSON (default: json)
- Max Turns: Maximum number of agentic iterations (default: 5)
- Verbose: Enable detailed turn-by-turn logging
- Model Alias: Choose sonnet, opus, or haiku (default: sonnet)
- Additional Directories: Comma-separated paths to make accessible
- Permission Mode: How to handle permissions (ask/allow/deny, default: allow)
- Input Text: Optional text to pipe as input to the CLI
Prompt: "What is 2+2?"
CLI Options:
Output Format: json
Model Alias: sonnet
`$3
`
Prompt: "Review this code and suggest improvements"
CLI Options:
Output Format: json
Max Turns: 10
Additional Directories: /path/to/project
Permission Mode: allow
Input Text: "{{ $json.code }}"
`$3
`
Prompt: "Analyze this log file for errors"
CLI Options:
Output Format: json
Verbose: true
Input Text: "{{ $json.logContent }}"
`$3
`
Prompt: "Refactor all components to use TypeScript strict mode"
CLI Options:
Output Format: json
Max Turns: 20
Additional Directories: /path/to/src/components
Permission Mode: allow
`Output Format
- JSON Output: Returns structured JSON with the CLI response
- Text Output: Returns plain text in
{ text: "...", raw: "..." } formatExample JSON output:
`json
{
"text": "Response from Claude...",
"raw": "Full CLI output..."
}
`Example Workflows
$3
`
GitHub Trigger → Claude CLI → Comment on PR
`
Automatically review code changes with full project context and file system access.$3
`
Schedule Trigger → Claude CLI → Git Commit → Send Notification
`
Refactor code across multiple files with agentic capabilities.$3
`
Read Log Files → Claude CLI → Parse Errors → Send Slack Alert
`
Analyze logs and extract actionable insights with detailed reasoning.$3
`
Cron Trigger → Claude CLI → Save to Repository → Create PR
`
Generate or update documentation based on codebase changes.$3
`
Webhook → Claude CLI → Write Tests → Run Tests → Report Results
`
Automatically generate comprehensive tests for new code.$3
`
Schedule → Claude CLI → Generate Report → Send Email
`
Perform security audits with file access and multi-step analysis.Best Practices
1. Permission Mode: Use
allow for automated workflows to avoid interactive prompts
2. Max Turns: Increase for complex multi-step tasks (e.g., 10-20 for code refactoring)
3. Additional Directories: Grant access to specific project directories for file operations
4. Verbose Mode: Enable for debugging to see detailed execution logs
5. JSON Output: Use JSON format for easier parsing in n8n workflows
6. Security: Be cautious with permission mode allow` - only use in trusted environments- n8n documentation
- Claude CLI documentation
- Claude CLI installation guide
- n8n community forum
- Requires n8n version 0.210.0 or later
- Requires Claude CLI installed on the host system
- Compatible with all n8n deployment types (self-hosted, cloud, desktop)
- Works with Claude CLI version 1.0.0 and above
For issues, questions, or feature requests, please create an issue in the repository.
---
Made with ❤️ for the n8n community