AI-Powered Workflows

How to Use Claude Code as a Network Engineer: Snapshot, Check, Change

Retro-futuristic comic panel of a network engineer in mission control holding up a checked-off clipboard while a chrome robot sweeps a teal scanner beam across a rack of switches lit with green status lights

Ever get a ticket for a new VLAN across the whole campus? Before you touch anything, you’re logging into switches one by one to see what’s actually configured, because the documentation might be up to date. Maybe.

So I had Claude Code do it in my lab. It added VLAN 40 across six switches, and before every push it showed me the exact commands it was about to send. Nothing went out until I said yes. Before it touched anything, it checked the health of every device, and when I asked it to review the design, it found the problems I’d left in on purpose.

I’ve been in networking for ten years, and I use Claude Code every day. This is how I use it in my lab. How I start every session, how I keep its instructions short, how we turned a repeat job into a skill, and how you can let it make changes safely. All three skills are free on my GitHub.

Why the usual approach falls short

Someone asks for a new VLAN. You open a dozen SSH sessions, paste show output into a notepad and try to work out what the network looks like right now.

  • Your documentation was probably out of date before you finished writing it. What’s always up to date is the devices themselves.
  • Config backups tell you the config changed. They usually don’t save the live state: neighbors, routes, which switch is the active gateway.
  • An AI tool with no context is guessing. If it doesn’t know what’s true on your network right now, its answers are only as good as your memory.

The workflow

Start every session from what’s true right now

Before I start any work in my lab, I always collect the network state first. You could do the same in your enterprise.

I run Claude Code in Windows Terminal for this. The Claude desktop app is basically the same Claude Code with a few small differences. I’d keep one session, or one terminal tab, per task instead of one long session doing a bunch of different things. If a session closes, claude --resume lets you pick it back up.

The skills install with two commands inside Claude Code:

/plugin marketplace add GTalksTech/netops-skills
/plugin install network-ops@netops-skills

If you turn on auto-update for the marketplace, you’ll get new skills as I publish them.

A skill is a set of instructions, and sometimes scripts, that Claude Code pulls in when a job calls for it. The first one is network-snapshot. It logs into every device with a read-only account, runs a fixed list of show commands per vendor and saves the results to git. Then Claude tells you what changed since the last run: failures first, then anything that rebooted, then every real change, device by device.

You can call a skill by name with a slash, like /network-snapshot, or just ask for something that sounds like it:

Take a snapshot of the whole lab.

I ran this one in auto mode, because the account is read-only and I didn’t want to approve every show command. Once we start making changes, that flips to manual.

My lab has twelve devices: the HQ campus switches and routers, a FortiGate firewall, an edge router, a simulated ISP and a branch. The first run is the baseline, so there’s nothing to compare yet. A few commands came back rejected on my routers, most likely because my CML images differ a little from real hardware. That’s the kind of thing the report tells you up front.

Run it again after a change, and it shows you only what’s different. The script strips the lines that change on their own, like clocks, timers and counters, so two runs on a quiet network show no changes. When something shows up, it really changed.

Plan first when the job gets complicated

For a quick question or a quick fix, auto mode is fine. For anything more complex, I’d switch to plan mode first. Shift+Tab cycles through the modes. Claude writes the plan, you read it, and it doesn’t start until you approve.

This one’s a habit I had to change. I had Claude look back through 1,600 of my own prompts, and I’d used plan mode exactly once. Claude can still drift from a plan, but at least you’ve read what it’s going to do. Without one, it works out the approach as it goes, and you can’t really see it.

One more habit: at the end of a session, have Claude write you a handoff file instead of letting it auto-compact. When I compared the two, the handoff came out more detailed. If you’ve never written a skill before, a handoff skill is a good first one.

Instructions that remember your mistakes

Every new session, Claude starts fresh. Your instructions file is how it remembers. It’s called CLAUDE.md, or AGENTS.md, and Claude Code reads either one.

Honestly, I’ve never edited mine by hand. When Claude gets something wrong, I tell it, and I ask it to add a rule so it doesn’t happen again. Every rule gets a date and the mistake behind it, so later you know why it’s there. You can do the same: just tell Claude to add a rule for this to the instructions file.

Here’s what’s in my lab’s file. Read-only by default, using the read-only account and show commands. Changes follow their own instructions file. Ask before resetting or re-importing the lab. Cite the evidence for any claim about a device. And one Cisco rule: plain show running-config needs privilege 15, so the read-only account uses show running-config view full.

When I had Claude audit my own instructions files, they were way too long. Claude Code’s docs suggest keeping this file under 200 lines. Claude reads all of it at the start of every session, so a long file eats context before you’ve asked anything, and every rule gets harder to follow.

So I give each kind of job its own folder, and each folder gets its own AGENTS.md:

lab-workspace/
  AGENTS.md
  changes/
    AGENTS.md
    runbooks/
      add-vlan.md
  reviews/
    AGENTS.md

When Claude works in one of those folders, it follows that folder’s rules on top of the parent file. My changes folder, for example, spells out the pre-check, the post-check and the rollback every change needs. Until Claude works in that folder, those rules don’t load, so the main file stays short.

My lab’s instructions files are in the same GitHub download, runbook included.

Build a health check skill

You just finished a maintenance window, or maybe the power went out overnight. Before anyone else notices, you want to know: did everything come back the way it should?

Your monitoring system will tell you a device is down. Depending on how advanced it is, it might not tell you that the active gateway and the spanning-tree root drifted apart on one VLAN.

So I had Claude build that check once, as a skill. I switched to plan mode and gave it this spec:

I want a new skill in the network-ops plugin: network-health-check. It answers one
question: is the network healthy right now? Whole network, one site, or one device.

Build it on the network-snapshot skill's engine (scripts/snapshot.py --health), so it
stays read-only and works on every vendor that skill supports. The health commands
are already in the vendor files.

It should check: every device reachable, recent reboots, interfaces that should be up
but are down, interface errors, uplinks or the internet link running near capacity,
port-channel members down, OSPF neighbors full, BGP sessions established, HSRP active
and standby where expected and on the same switch as the spanning-tree root,
inconsistent spanning-tree ports (blocked ports on redundant uplinks are normal; don't
flag a change in their count), NTP synced, CPU and memory, and errors in the logs.

The report: findings first, worst first, each with the device, the evidence and the
fix; then one line per thing that checked out healthy. Save it in reviews/.

Plan it first. Don't build until I approve the plan.

During planning, Claude usually asks at least one question. This time it asked what to do about the vendors in the skill that I can’t test in my lab. I kept the build to what my lab could prove. The plan included the check I cared most about: confirm the HSRP active switch is also the spanning-tree root. If those two split, traffic takes the long way around.

I approved it with “yes, and use auto mode”, since the health check only runs read-only commands.

One thing worth knowing about skills: they aren’t loaded into context when a session starts. Claude reads each skill’s short description and decides whether it fits what you asked. So if you ask “is my network stable?”, the description is how Claude knows to reach for the health check.

It runs on the whole network, one site with --site, or one device with --device. If you’ve got 200 devices and one problem switch, you don’t have to touch the other 199.

The first run reached all twelve devices. Everything came back healthy except one high finding, collisions on one of my switches. That’s something I see in my CML lab, so I didn’t chase it. HSRP was active where it should be, OSPF adjacencies were full, NTP was synced and spanning tree looked good. The report landed in reviews/.

Healthy isn’t the same as well designed

With a snapshot and a health check in hand, I asked it a different question:

Now that we have the health check and our snapshot, go ahead and review the design
of my network and let me know any major findings. Give me the top three worst issues.

Number one: the branch is fully trusted, but its link to HQ is unencrypted, and the branch has no firewall. Both are real, and both were left in the lab on purpose. Number two: a single path where one failure takes down all of HQ. It’s a lab, so there’s not much redundancy. Number three: weak VLAN segmentation. Fair.

Let it make changes, safely

For changes on your network, I’d start in plan mode and approve every step while you’re learning. See what Claude Code does before you let it run on its own.

Give your agent its own login for changes, separate from the read-only one. The push skill keeps that password in your operating system’s credential store (Windows Credential Manager, macOS Keychain or Linux Secret Service), so it never shows up in a file or in the chat.

I gave it two changes on the HQ campus in one prompt:

Two changes on the HQ campus.

First a warm-up: interface descriptions. Anything up/up with no description gets one
(loopbacks and SVIs mostly).

Then the main one: add VLAN 40, name CAMERAS, 10.40.0.0/24, gateway 10.40.0.1,
across the HQ campus.

Run the health check first as the pre-check, then write the change plan in changes/.
Don't push anything. Stop for my approval.

That VLAN touches both distribution switches, which are the gateway pair, every trunk to the access switches, and the routing.

Claude checked the changes folder first. There’s a runbook in there for adding a VLAN, changes/runbooks/add-vlan.md, and the plan says it followed it.

Think of your AI like a new engineer you’re onboarding. You’d point them at the docs: here’s how we add a VLAN, here’s how we fail over an ISP. Why not give the same docs to your AI? Every standard change gets its own runbook file, and Claude reads only the one it needs. If you don’t have one for a change, ask Claude to draft it from your snapshot and health check, then review it. These aren’t Ansible templates, though. It’s guidance, not a lock. Claude still writes the commands, and you still review them.

The plan has four parts, all written before anything gets pushed: a pre-check, the change, a post-check and a rollback. Every trunk change uses switchport trunk allowed vlan add 40, and the push skill refuses an allowed-VLAN line without add. We’ve all seen what happens when someone forgets that word.

The pre-check and the plan were read-only, so Claude ran that part in auto mode. Before approving the plan, I switched to manual.

Here’s the part I care about most. Usually Claude Code just tells you it’s going to run a script, and you can’t see what’s in it. So I built the push skill to put every switch command in the approval prompt. The interface descriptions went out as one batch, one approval across four devices, since a description won’t break anything. VLAN 40 went one switch at a time, each with its own commands on screen and its own “yes”. In a real environment, read every one of those before you approve it.

When you approve a push, pick plain “Yes” rather than “don’t ask again”, because that one saves a permanent allow rule.

After the last switch, I switched back to auto for the post-check, since it’s read-only again. VLAN 40 was on all six switches, the health check passed, and then Claude saved the config.

Then I checked one switch myself, distribution switch one, from my own SSH session:

show vlan brief
show standby brief

VLAN 40 was there, and the standby output looked right. I only showed one switch on camera, but you get the idea.

Then I tested the rollback. I told Claude the requirements had changed and asked it to roll everything back. I watched the first pushes in manual mode, the trunks dropping VLAN 40 and no vlan 40, then switched to auto and let it finish. The health check afterward matched the pre-check, and the network was back exactly where it started.

A pre-check, a change, a post-check and a rollback. That’s what you’d do on a real network anyway, and you can watch every step.

Adapting for your network

  • Vendors. network-snapshot and network-health-check are tested on Cisco IOS/IOS-XE and FortiGate. Eleven more profiles, from Cisco NX-OS and ASA to Arista, Juniper, Aruba and Palo Alto, are written from vendor docs and marked untested. Adding a vendor is one settings file, no Python changes. If a command gets rejected on your gear, I’d love a pull request.
  • network-push is Cisco only for now. It’s tested on Cisco IOS switches in my lab, and it only runs on tested profiles.
  • Read-only accounts. I’d set one up on every device before the first run. The plugin README has the setup for Cisco and FortiGate, including the Cisco privilege 5 user that can still read the full config, and the built-in read-only role to use on the other vendors.
  • Your data goes to the cloud. The skills reach your devices over SSH from your machine, but the show output goes to the model. Before you point this at a work network, check your company’s AI policy, even on an enterprise plan with data protections turned on.
  • Guardrails belong on the devices. In my opinion, one of the best guardrails is your TACACS server. Give your agent its own account and use command authorization to limit what it can run. That’s the kind of control you’ll want as you build more trust with it.
  • The snapshot repo holds full device configs. I’d keep it private and never push it anywhere public.

Honest limitations

In my lab, the guardrail is me approving every push. That’s fine for a lab, and it’s exactly why production needs more, like that TACACS account. The credential store keeps the password out of files and the chat, but it doesn’t stop Claude from using it.

And to be clear about the demo: I approved every VLAN push one switch at a time, and the descriptions as one batch. The rollback was different. I watched the first switches, then let it finish in auto mode. I was comfortable with that in a lab, with a tested rollback. On a real network, I’d watch the whole thing.

The health check is read-only, but it isn’t monitoring. It answers “did everything come back?” It compares error counters with the last run, but it only knows what it saw when it ran, so it won’t catch slowness that comes and goes. That’s still a job for your monitoring tools.

AI output varies from run to run. Your plan won’t read exactly like mine, and Claude can miss things. So I’d still read the plan, and read the report.

And when your network is down, your AI is usually down with it, unless you’re running local models on a pretty beefy machine. So I’d keep your own skills sharp: the show commands, the troubleshooting, all of it. You don’t want the AI to be the only one who knows how your network works. When the internet is up, though, letting it gather and compare the show output can save you a lot of time. Use it to get faster, not to stop knowing your network.

Get the skills

All three skills (network-snapshot, network-health-check and network-push) are in one Claude Code plugin, free on GitHub: netops-skills/plugins/network-ops. My lab’s instructions files and the VLAN runbook are in netops-skills/lab-workspace.

If you want the next skills when they ship, you can join the mailing list.

What’s the first repetitive networking task you’d turn into a skill? Let me know in the comments on the video.