n8n-claude-code-guide  by theNetworkChuck

Automate AI workflows by connecting n8n to Claude Code via SSH

Created 2 months ago
267 stars

Top 96.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a method to integrate n8n automation workflows with Claude Code (or similar AI terminal tools) via SSH. It enables users to leverage powerful AI capabilities, such as code generation, analysis, and agent deployment, directly within their n8n automations, targeting users who need to extend their automation logic with advanced AI features. The primary benefit is enabling sophisticated AI-driven tasks within a familiar automation framework.

How It Works

The core architecture relies on n8n's SSH node to remotely execute Claude Code commands on a Linux server. n8n sends prompts and commands over SSH, and Claude Code processes them, returning results. This approach allows Claude Code to access local files, run installed skills, and deploy agents directly from the n8n workflow, using the SSH connection as the sole integration point.

Quick Start & Requirements

  • Prerequisites: An n8n instance (self-hosted or cloud), Claude Code installed on a Linux machine (Ubuntu example provided), and an Anthropic Pro subscription or API access for Claude Code.
  • Installation: Claude Code is installed via npm (npm install -g @anthropic-ai/claude-code). Authentication is handled via claude auth.
  • n8n Setup: Configure the n8n SSH node with server IP, port (22), username, and authentication (password or private key).
  • Testing: Verify connection with hostname and claude --version commands via the SSH node.
  • Resources: Links to NetworkChuck Academy courses, Claude Code Docs, and n8n Docs are provided.

Highlighted Details

  • AI Execution: Utilizes claude -p for headless prompt execution and --dangerously-skip-permissions to enable tool use and agent deployment.
  • Contextual Awareness: Allows Claude Code to access project files by cd-ing into a specified directory before executing commands.
  • Session Management: Enables persistent conversations across multiple n8n executions using --session-id and the -r (resume) flag, facilitating multi-turn interactions.
  • Slack Integration: Demonstrates a workflow for mobile access, allowing users to interact with Claude Code via Slack commands and receive responses.

Maintenance & Community

The project is created by NetworkChuck, with links to their YouTube channel and Discord server provided for community engagement and support. Further videos on advanced automation are planned.

Licensing & Compatibility

The README does not explicitly state a software license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

Potential issues include Claude Command Not Found if the shell profile isn't loaded (requiring full paths or sourcing profiles), Permission Denied Errors for file/tool access, and session resumption failures if session IDs are inconsistent or sessions expire. Slack's 4000-character limit necessitates prompt constraints (e.g., "Keep response under 2000 characters"), and long-running Claude operations may require increasing SSH timeout settings in n8n.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
45 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.