n8n + Claude Code = Superpower
45sInstantly showcases a surprising integration that promises to change how people use n8n, sparking curiosity.
▶ Play Clip"Delivers on the promise of a new n8n workflow, but padded with sponsor reads and a long prayer at the end."
Network Chuck demonstrates how to integrate n8n with Claude Code, an AI terminal tool, to create powerful automation workflows. By using an SSH node in n8n, users can remotely execute Claude Code commands, enabling context-aware AI agents, skills, and persistent sessions. The video showcases practical examples, including deploying agents to monitor network performance and using Slack to interact with Claude Code from a phone.
Network Chuck introduces the video, stating that using n8n with Claude Code has changed how he uses n8n. He mentions that Claude Code is more powerful and that he can maintain sessions.
He recommends using Claude Code (requires a pro subscription) or Gemini CLI. He also promotes his VPS hosting service with a discount code 'networkchuck'.
The key to connecting n8n to Claude Code is using the SSH node in n8n to log into a server and run commands. He mentions he tried an HTTP wrapper but SSH was simplest.
He walks through creating an SSH node with the 'execute command' action, setting up credentials (IP, username, password), and testing with 'hostname'.
He tests Claude Code by running 'claude --version' and then 'claude -p' (print mode) to ask a question, showing it works headlessly.
He explains that n8n gains access to Claude Code's context, including local files, making it more powerful. He mentions it's like connecting n8n to ChatGPT but more powerful.
He demonstrates using Claude Code's 'unified skill' to deploy three agents to check WiFi, network performance, and security. n8n acts as the orchestrator.
He shows how to resume a session using a session ID, generated by a JavaScript code node, and using the '-r' flag in Claude Code.
He creates a workflow that allows him to talk to Claude Code via Slack from his phone, using session IDs to maintain conversation context.
He uses the setup to check his NAS and server, discovering an issue and having Claude Code investigate it.
He plans to create an 'IT department' with n8n as the orchestrator and Claude Code, Gemini CLI, and Codex as the workers.
Integrating n8n with Claude Code via SSH unlocks powerful automation, allowing n8n to orchestrate AI agents with context and persistent sessions. This combination enables complex tasks like network monitoring and remote management, making it a game-changer for IT automation.
What is the key method to connect n8n to Claude Code?
Using the SSH node in n8n to execute commands on a remote server.
02:13
What flag is used in Claude Code to run in print mode?
-p
04:42
How can you resume a session in Claude Code?
Use the -r flag with a session ID.
09:31
What is the purpose of the JavaScript code node in the workflow?
To generate a random UUID for the session ID.
08:08
What are the three AI terminal tools mentioned?
Claude Code, Gemini CLI, and Codex.
12:56
Context is key
Explains that n8n gains access to Claude Code's context, making it far more powerful than simple automation.
05:07Skills and agents
Demonstrates deploying multiple agents via a single skill, showcasing the orchestration power of n8n.
06:07Session persistence
Shows how to maintain conversation context across multiple n8n nodes, enabling complex multi-step workflows.
07:53Slack integration
Enables remote control of Claude Code via Slack, making automation accessible from anywhere.
09:49Real-world issue detection
Demonstrates the practical value by discovering a server issue and having Claude Code investigate it.
12:27[00:00] How I use NAN has changed forever because now I'm using NAN with Claude Code. I mean, look at this. NAN is executing Claude agents workflows skills. good, Claude code is more powerful. I talk about it in this video here,
[00:16] I unlocked a superpower. So get your coffee ready, let's go. And by the way, I'm actually able to maintain a session as well,
[00:31] I'll show you that here in a bit. Now here's how I'm making that happen. an AI terminal tool and coffee. That's just the rules network. Chuck Coffee.
[00:43] Now for the AI terminal tool, you can use CLO code. That's what I recommend, Keep in mind that CLO code does require a pro subscription Gemini CLI will be why are we even using AI in the terminal? Watch this video right now,
[00:59] it's amazing. Now real quick, if you don't already have an NAN instance, hosting your VPS. Why? Two reasons. First, it's on sale right now, And with these specs you can run NAN in a lot of other stuff. Two,
[01:15] Seriously watch this. I'll go to hosting.com/and see an eight N put in coupon code network junk and magic will happen. Create a root password
[01:28] and then boom, you're done in eight N right here. Seriously, just do it. before I show you how NAN can connect to cloud code or any other AI terminal, where do we install our AI terminal tool? Where do we put cloud code?
[01:45] And the answer is, wherever you stink in one, it can install anywhere, right? Mac, that includes Windows of WSL, You can install it on a Raspberry Pi if you want. Or for me,
[01:59] I have it installed on a Ubuntu server in my server room here at Network Chuck easy access there next door neighbors. Now here's the secret. Here's how they connect you ready for SSH? That's it.
[02:13] We're going to use the SSH node on N eight N to log into our server and run I tried to make it more complicated. I created my own HTTP wrapper and it worked, but still, SSH was the simplest,
[02:26] this, I'm going to give you the best way and this is the best way. It just is. it does. Let me show you now real quick, we just launched two new courses on Network Chuck Academy.
[02:42] Claude code is coming soon. Link below. So here we go. Let's get your super simple SSH node set up working. We'll start with a basic trigger and then we'll add one node, our SSH node,
[03:01] just search for SSH, there it is, and we'll have the execute command action. That's all we got right there. Why do I have this? This is all we needed. First, And if you've never done this before, you'll first need to set up credentials,
[03:15] click on create new credential and put in your info. My IP address is 10 77 point 14 point 30.
[03:27] If you're hosting cloud code or GEM and ICLI on your hosting your VPS, and password and click on save. It's going to save it, try and connect.
[03:39] Actually, I'm going to rename that so I can know what it is. Now let's try our first command right here in the command box. server works we'll just type in host name just like this.
[03:54] It's going to tell us our server's name, ready, set, execute step. I felt like Steve from Blues Clues. Now we can test our AI terminal command. I'll change host name to Claude and I'll do dash dash version to get the version
[04:09] of Claude. We have installed a good way to test that ready, set, go. You should see something like this in the standard out the version you have There's actually a few reasons why that might happen and it has to do with the
[04:24] I experienced probably every one of those scenarios and I documented everything in a link below. For sake of time, we're just going to move on. So we'll type in CLO and we'll do dash p dash P is for print.
[04:42] And that's what's great about these AI terminal tools that can run in headless So let's say why do pugs look so weird? And let's see if it works. Ready, set,
[04:54] go. So right now we're using NAN to remote into our server and run a cloud code but you might be like, okay Chuck, we just asked AI to do something and it told us what's so special about this.
[05:07] First context, watch this. I'm going to change this command. Actually the directory of this video we're working on right now where I keep my
[05:20] So we can run two commands at once and I'll say, Hey, is this video going to be any good? Let's go. how did it know this video is going to be good because it has the context.
[05:37] my local files. Giving N eight N access to cloud code gives NAN access to a super It's kind of like if you could connect N eight N to your chat g bt like the
[05:52] that's what we're doing here except way more powerful. And guess what? that cost tokens already paid for. This is my subscription. And the third reason, this is amazing skills and agents.
[06:07] I'm going to put cloud in dangerous mode and I'll say use your unified skill, I've got a unified skill that tells Claude everything it needs to know about
[06:21] check the wifi, check the network performance and check my security. Deploy three agents, one for each task. So I created a dashboard with cloud code. Here it is.
[06:36] Now let's watch this magic happen. Ready, set, go there, it came in, working on my network, checking things out. And what I love about this is that N eight N, he's now just the orchestrator.
[06:50] And by complexity I mean it's just marked down files that describe how to access things. It's python scripts. Look, it's running Python right now and it's done. my memory's high on my switch and my UDM pro, I actually didn't know that.
[07:07] I think some smart home stuff all in the same network. A n workflow would've taken me hours and hours to do,
[07:21] but cloud code made that skill and this would've taken a ton of tokens. This is a token heavy process, but it's cloud code. I have a subscription. I hope you're seeing this because any n canal effectively connect to everything
[07:36] I do already. All the workflows I'm building, all the processes I'm designing, What if you want to talk back to it like cool, give me all that wifi info, It seems kind of just like one and done. No, we can resume a session.
[07:53] Watch this. actually most things operate like this. We can actually use our own session id. We can specify one.
[08:08] that's what they call it with a code node. So I'll click on code node here, It's just a little function that'll randomly generate a U Id like this.
[08:22] We won't ask about the wifi or we'll just say, Claude can actually intelligently use the unified skill without me telling it to. I'll just say how many access points are up right now
[08:38] dash id and we'll pull in that UUID that we created. here. Awesome. So we're pulling in that variable from that JavaScript code node.
[08:52] Let's test it out. Ready, set, go. Oh look, it's using my unified skill. Now we're going to add another SSH session. So actually we'll pin this data.
[09:04] We'll copy this SSH node or duplicate it, connect it up we'll change our prompt and we'll just continue the conversation being like,
[09:17] why is one of them down? So that would not make any sense out of context. But if we're resuming the conversation, it'll be fine. We can do that with the dash R switch to do dash R and then we'll specify that
[09:31] same session ID from our JavaScript node, just like that. Try it out. There's a prompt that came in. It's using our unified skill and boom, Are you seeing this? We just gave NAN and freaking pot of coffee.
[09:49] This is so overpowering. We have context. Claude code handles context way better than NAN does. Now,
[10:01] but what could I use this for? And I came up with this idea, centered it around this whole session ID business. I love this so much. So I quickly threw this workflow together and what this enables me to do is use
[10:14] my phone and Slack to talk to Claude code wherever I'm at and not but have a conversation until I'm done. Check this out. You got to see it. I'm so excited about this. Alright,
[10:29] ignore all my testing, but check this out. I'll tag NAN test and simply ask it. Deploy two agents to battle it out Nano or neo VM research
[10:46] Give me a solid answer and I got to keep the response under 2000 characters. And we're going to watch it on the side here. Ready? Set. This is all from Slack. There it goes.
[11:04] Let's ask about something else. So let's respond to it. I'll say, but what about make YouTube videos about hacking and
[11:16] eight N and all kinds of fun things? And I'll say, so keep going. And there it goes. Isn't this amazing?
[11:28] I can make a video about this very battle. I love this so much. I should use both. I love this. Alright, I'm going to respond with true to end that, but just think about that.
[11:41] I want to research this or I have this thought or I need to check on this one And for those of you using Claude code as your digital assistant,
[11:53] which I'm going to make a video on soon, this is a game changer. and we'll look into end real quick to show you what I'm doing here. say if I'm done true or false, that simply goes to an IF node. If I say false,
[12:08] It'll loop through launch another clog command with the dash R with that same It'll end the workflow. Or I can check in with my nas, see how my stuff server is doing.
[12:27] Look at that. Oh my gosh, how cool is this? Oh, oh, yikes. I got some work to do actually, let's have it investigate that.
[12:44] I didn't expect to find an issue during this. Well, that's awesome though, right? Also terrifying,
[12:56] okay, NAN plus clog code or Jim and ICAI or code X, The next video in my N innate N series is going to be about taking it further and deploying an IT department, but I'm like, hold on,
[13:10] I discovered Claude code and now I realize how amazing this is and I want to use So now I'm designing my IT department with NAN as the Orchestrator
[13:22] orchestration and Claude Code and Gemini CLI and Codex as the actual IT It's just SSH and a few clever things with managing session IDs. But man,
[13:34] Now I know what you're thinking like Chuck, well what about NAS AI agents? You can have the AI agents that you have inside N eight N call Claude
[13:46] The killer part about Claude Code is that it can deploy multiple agents on the you're stuck with the agents that you actually put into the workflow. I had to take a walk yesterday and just jot down ideas in my journal.
[14:02] I had so many. I'm curious where you're at. What do you think about this idea? I love being in the terminal. I love having everything, every file on-prem, and now that I have an eight N controlling cloud code as the orchestrator,
[14:19] enabling a n to do what it does best and what Claude code does best. and then come to me with some ideas. I've got a million,
[14:31] Actually, no, that's not all I have. Again, if you do want to learn more about Claude code and skills and then also N eight we'll have two courses coming out on Network Check Academy.
[14:44] I think you're really going to like them. No, I'll catch you guys next time. Hey, you're still here at the end of my videos. I now pray for you. My audience.
[14:58] I know it's kind of weird. If prayer is not your thing, that's okay. Actually, That's why I put this at the end. So let's go ahead and pray. I dunno where you're at with God or anything, but it doesn't matter.
[15:13] I'm going to pray for you. So let's go. God, I thank you for this person on the other side of the screen. I just thank you that they're subscribed to me and they're watching my channel and my videos.
[15:27] Thank you for that. And I thank you that they're passionate about tech, about And I pray that this video would ignite in them a passion to just
[15:41] That ideas would just flow into their mind right now that they would, if there's anything blocking them mentally or spiritually or just anything that this video and the ideas that are coming with it will just open up a new
[15:58] flow and stream of just awesomeness running out of words. Lord, bless them indeed right now. I pray that you'll bless their careers, Let them find joy in what they do,
[16:16] and I pray blessing with their families that they would be grow strong and be healthy and that you would give them time with their families
[16:28] and let that time be sweet. Let that time be rich and help them to balance their life and their time. that they would be empowered to avoid distraction and do the things that are
[16:45] really important. Help them to study and work and do good things. I pray ultimately that they will one day just know the joy of knowing you
[16:57] money and the pursuit of riches or stature, it's fun, but ultimately
[17:09] knowing you is the best thing. It's got to just pray blessing over them, and I thank you for them. It's your name I pray, Jesus. Amen. I'll catch you guys next time.
⚡ Saved you 0h 17m reading this? Transcribe any YouTube video for free — no signup needed.