claude-chat

n8n community node for Claude Chat - Conversational AI powered by Claude Agent SDK with skills support

Package Information

Released: 9 mo ago
Downloads: 315 weeklyĀ /Ā 536 monthly
Latest Version: 0.2.5
Author: infograb

Documentation

n8n-nodes-claude-chat

šŸ¤– n8n community node for Claude Chat - Conversational AI powered by Claude Agent SDK

This node enables conversational AI interactions in n8n workflows using Anthropic's Claude models via the official Claude Agent SDK. It supports multi-turn conversations, skill-based personalities (like humorous chat), and advanced features like tool usage and budget management.

Features

  • šŸŽÆ Claude Agent SDK Integration - Native SDK support for advanced agentic capabilities
  • šŸ˜„ Humorous Chat Mode - Built-in skill for witty, fun, and entertaining responses
  • šŸ’¬ Multi-turn Conversations - Maintain conversation history across workflow executions
  • šŸ› ļø Skills Support - Extensible skill system for custom AI behaviors
  • šŸ’° Budget Management - Set maximum spending limits per execution
  • šŸ”’ Permission Controls - Fine-grained control over AI tool usage

Installation

Via n8n Community Nodes (Recommended)

  1. Go to Settings > Community Nodes
  2. Click Install a community node
  3. Enter n8n-nodes-claude-chat
  4. Click Install

Manual Installation

cd ~/.n8n/custom
npm install n8n-nodes-claude-chat

Local Development

# Build the package
npm run build

# Link to global
npm link

# In n8n directory, link the package
cd ~/.n8n
npm link n8n-nodes-claude-chat

# Restart n8n

Setup

1. Create Anthropic API Credentials

  1. Go to Anthropic Console
  2. Create an API key
  3. In n8n, go to Credentials > New Credential
  4. Select Anthropic API
  5. Enter your API key

2. Add the Node to Your Workflow

  1. Search for "Claude Chat" in the nodes panel
  2. Drag it into your workflow
  3. Connect your credentials
  4. Configure the node settings

Node Configuration

Chat Mode

Mode Description
Standard Normal helpful AI assistant
šŸ˜„ Humorous Fun, witty responses with jokes, puns, and emojis

Model Selection

Model Best For Cost
Haiku Fast responses, simple tasks $
Sonnet 4.5 Balanced performance (default) $$
Opus 4.5 Complex reasoning, best quality $$$

Options

Option Description Default
System Prompt Custom instructions for Claude Auto based on mode
Temperature Response creativity (0-1) 0.7
Max Tokens Maximum response length 1024
Max Budget (USD) Cost limit per execution $1.00
Conversation Mode Maintain chat history Off
Enable Skills Load Claude Agent SDK skills On
Permission Mode Tool access control Default

Example Usage

Basic Chat

{
  "chatMode": "standard",
  "prompt": "What is the capital of France?",
  "model": "sonnet"
}

Output:

{
  "response": "The capital of France is Paris...",
  "success": true,
  "model": "claude-sonnet-4-5-20250514",
  "usage": {
    "inputTokens": 15,
    "outputTokens": 42,
    "totalTokens": 57,
    "estimatedCostUsd": 0.0007
  }
}

Humorous Chat

{
  "chatMode": "humorous",
  "prompt": "Tell me about JavaScript",
  "model": "sonnet"
}

Output:

{
  "response": "Ah, JavaScript! šŸŽ­ The language that decided 'undefined' and 'null' should both exist, just to keep developers on their toes! ...",
  "chatMode": "humorous",
  "metadata": {
    "skillsEnabled": true,
    "availableSkills": ["humorous-chat"]
  }
}

Multi-turn Conversation

Enable Conversation Mode to maintain context:

Turn 1: "My name is Alice"
Turn 2: "What is my name?"
→ "Your name is Alice!"

Skills System

This node leverages the Claude Agent SDK's skill system. Skills are loaded from .claude/skills/ directory.

Included Skills

humorous-chat

Enables witty, playful conversation style with:

  • Puns and wordplay
  • Emoji usage šŸ˜„šŸŽ‰šŸ’”
  • Lighthearted self-aware AI humor
  • Balanced humor (helpful first, funny second)

Creating Custom Skills

Create a skill in .claude/skills/my-skill/SKILL.md:

---
name: my-skill
description: Brief description of what this skill does and when to use it.
---

# My Skill

Instructions and examples for the skill...

API Response

interface ClaudeChatOutput {
  response: string;           // AI response text
  success: boolean;           // Whether the request succeeded
  chatMode: string;           // 'standard' | 'humorous'
  model: string;              // Full model ID
  usage: {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
    estimatedCostUsd: number;
  };
  metadata: {
    duration: number;         // Execution time (ms)
    sessionId: string;        // Conversation session ID
    skillsEnabled: boolean;
    availableSkills: string[];
    conversationMode: boolean;
    turnCount: number;        // Number of conversation turns
  };
}

Error Handling

The node handles various error scenarios:

Error Handling
Rate Limit Automatic retry with backoff
Authentication Clear error message with guidance
Budget Exceeded Stops execution, reports cost
SDK Unavailable Falls back to direct API

Enable Continue On Fail to handle errors gracefully in workflows.

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Run tests
npm test

# Create package
npm pack

Publishing

See NPM_PUBLISHING.md for detailed instructions on publishing to npm registry.

Requirements

  • n8n >= 1.0.0
  • Node.js >= 18.0.0
  • Anthropic API key

License

MIT

Links

Discussion