/fixvpn: Creating a new skill with Claude driving

/fixvpn banner: a terminal running the skill, all checks passing

Written by

in

/fixvpn is a Claude Code skill: one command that gets a Mac back onto a work VPN when you are on call and the login keeps failing. We built it over two days in October 2026, and it exists because of three failures. Claude caused one of them and misdiagnosed the other two before getting them right. This post covers each failure, what the skill does now, and what we learned about building skills with Claude driving.

What a skill is

In Claude Code, a skill is a folder with a SKILL.md file in it. The top of the file names the skill and describes when to use it. That description is what Claude reads when it decides whether a request matches the skill, so ours lists the actual words someone types when they’re stuck: “won’t connect”, “timed out”, “BadServerCert”. The rest of the file is instructions: which mode to run, what never to do, and how to read the logs when the quick fix isn’t enough. You can call a skill by name (/fixvpn) or just describe the problem.

Diagram: SKILL.md instructions, the fixvpn script with work, reset, home and status modes, and a lessons file, joined in one loop
The skill is three parts: the instructions Claude reads, a script that does the fixing, and a lessons file that grows after every incident.

Failure 1: “bad server certificate”, which wasn’t about the server

One morning the VPN stopped working. The sign-in window took the password, accepted the two-factor approval, then failed with “Authentication failed due to problem verifying server certificate.” It had worked the night before.

Claude’s first theory was confident and wrong: a recent macOS update had broken the older VPN client. It uninstalled the client, reinstalled it, and tried two other versions. Nothing changed. Then came the correction that fixed the investigation: macOS had been updated weeks earlier, and the VPN worked last night. Stop guessing and find what changed overnight.

An overnight deep dive through the Mac’s logs found it. The VPN server’s certificate checked out every time. The certificate that failed belonged to something else on the sign-in page:

Five-step chain: the sign-in page loads an analytics script, the router's ad-blocking DNS answers 0.0.0.0, macOS treats that as this Mac, a local dev web server answers with its dev certificate, and the VPN sign-in window aborts the login
The error names the VPN, but the cause was one analytics call on the sign-in page.

The uncomfortable part: the ad-blocking DNS on the router was Claude’s own change. Two days earlier, while building our big-button TV remote, it had switched the home router’s DNS to an ad-blocking service to cut down on TV tracking. It worked that evening because the right answers were still cached. The next morning’s reboot cleared the cache. When asked, Claude first said it had never touched the router. That was wrong too: it had searched its own work log for “router”, but the change was logged under the router’s product name. Setting the router’s DNS back to automatic fixed the VPN.

  • Lesson: “bad server certificate” in a VPN sign-in window can mean any resource on the page, not the VPN server. The macOS unified log shows which certificate actually failed.
  • Lesson: a filter that is harmless in a browser can break an app. Chrome silently drops a blocked analytics call; the VPN client’s embedded sign-in window fails the whole login.

Turning the fix into a skill

With the VPN working again, we asked Claude to make sure this never cost an on-call night again. It wrote a small script, fixvpn, in which every check is a failure that really happened, with the date in a comment next to it. It has four modes:

  • work: clears the known blockers, then opens the VPN app. That means closing the other VPN client that can hold traffic, turning off Tailscale (our private network, which fights the work VPN over routes and DNS), checking the router isn’t filtering again, flushing the DNS cache, and checking that the employer’s sign-in server is reachable.
  • reset: un-wedges macOS’s VPN manager without a reboot (see failure 3).
  • home: the reverse, for the end of the shift. Disconnects the work VPN and brings the private network back so remote desktop works again.
  • status: looks at everything and changes nothing. Always safe to run first.

The SKILL.md wraps the script with judgment: which mode to pick from what you said, what to say before running something disruptive, and how to read the logs if the login still fails after the script runs.

Failure 2: “timed out” means two different things

That evening the message was just “connection timed out”. The same phrase comes up with remote desktop, which runs over the private network, and that’s how Claude read it. It turned Tailscale back on and installed an update to it, which broke the VPN even further. It had the wrong problem. The skill now opens with a rule written in plain words: when someone says “timed out”, ask “VPN or remote desktop?” before touching anything. It also treats Tailscale being off as a signal, not a fault: on this Mac, off usually means someone switched it off to use the VPN.

There was a short outage on the employer’s side that night as well: their sign-in server stopped answering from home and from one of our servers in another country, while the rest of the internet worked. Nothing on a laptop fixes that, so the script now tests for it and says so plainly: call the service desk, don’t reinstall anything.

Failure 3: two copies of the VPN app

Even with Tailscale off again, every Connect still “timed out”. A reboot fixed it, and the obvious suspect was the Tailscale update. Claude went back to the logs with exact timestamps instead, and the update turned out to be a bystander: it was installed three minutes after the VPN had already stuck.

Timeline for October 28: 21:55:37 the VPN app starts a handshake, 21:55:40 a second copy launches, 22:09 to 22:20 eight refused connects, 22:24 a reboot clears it, now fixvpn reset does the same without a reboot
The log told the story to the second. The Tailscale update came after the wedge, so it wasn’t the cause.

The VPN app had been left open since the morning. When it started a new connection, a second copy of the app launched within three seconds and made the same request. macOS’s VPN manager (a background service called nesessionmanager) got stuck halfway through the first handshake and refused every later attempt with “already in the process of being established”. The VPN app reports that as a timeout. A reboot restarts the VPN manager, and that was the whole fix. fixvpn reset now does that one step directly: it quits every copy of the app and restarts the VPN manager, and it refuses to run while a VPN is connected, because restarting the manager would drop it.

To test this without waiting for it to break again, the script has a replay switch: point it at a past time window and it reads the logs from that window. Run against the evening of October 28, it found the eight refused connects:

Two terminal panels: fixvpn status tonight shows the VPN connected and healthy; the same check replayed against the October 28 log shows the VPN manager wedged with eight refused connects
Real output, with the employer’s names removed. The bottom panel is the bad night, replayed from the log.

Every wrong turn became a rule

Four wrong turns and the rules they became: blamed the macOS update, ask what changed; said I never touched the router, search the work log by device name; read timed out as a remote-desktop fault, ask VPN or remote desktop; blamed a Tailscale update, check the clock
Claude’s mistakes are in the skill as rules, so the next run starts where this one ended.

How it’s kept safe

  • It only changes this Mac. It never logs in to the employer’s systems, never reinstalls their VPN client, and never tries to get around their device checks. The person at the keyboard does the sign-in and the two-factor approval.
  • DNS changes stay narrow. A DNS change caused failure 1, so the skill touches as little as it can. If the router starts filtering again, it sends only the one analytics domain the sign-in page needs around the filter, on this Mac alone, and says plainly that the real fix belongs on the router.
  • Look before touching. status changes nothing, and the skill runs it first whenever the request is unclear.
  • It says what it’s about to break. Work mode turns the private network off, which ends any remote-desktop session into the Mac. If one might be open, the skill says so before it runs.

If you want to build a skill like this

  • Build it from the incident, not from imagination. Each check in fixvpn traces back to a dated log line. Checks nobody has needed yet only add noise.
  • Write the corrections in as rules, word for word. “Ask VPN or remote desktop?” is more useful to a future run than any paragraph about networking.
  • Give it a mode that changes nothing. It’s the safe first move for both people and Claude.
  • Make it testable against the real failure. A replay window over the logs let us prove the wedge check works without breaking the VPN again.
  • Keep the lessons file next to it. When a new cause turns up, the skill’s last instruction is to add it to the lessons file and to the script.

The VPN has gone wrong three different ways, and the skill handles all three. The next time it goes wrong a fourth way, that case will be added to the skill as well.