tunnel-doctor

tunnel-doctor is an agent for Claude Code from anivaryam/anivaryam-plugins. It costs 77 tokens per session (897 once invoked), scanned A, original, MIT.

An agent guide for finding why a public tunnel cannot connect an outside request to a local app. A tunnel exposes a local service through a public address.

In plain words
What is it for?
Use it for connection failures, refused requests, 502 errors, disconnected daemons, name conflicts, or a setup review before exposing a port.
Why use it?
It replaces guesswork with checks of configuration, the relay, the tunnel daemon, logs, and the local app's listening address.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the tunnel plugin — 1 skill, 2 commands, 1 agent shipped together

Good fit Use it for connection failures, refused requests, 502 errors, disconnected daemons, name conflicts, or a setup review before exposing a port.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/anivaryam/anivaryam-plugins/tunnel-doctor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/anivaryam/anivaryam-plugins

Made for: Claude Code.

Or install tunnel, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tunnel-doctor

README.md
[![agentmods](https://agentmods.dev/badge/agents/anivaryam/anivaryam-plugins/tunnel-doctor/github.svg)](https://agentmods.dev/agents/anivaryam/anivaryam-plugins/tunnel-doctor)
Your own site
<a href="https://agentmods.dev/agents/anivaryam/anivaryam-plugins/tunnel-doctor"><img src="https://agentmods.dev/badge/agents/anivaryam/anivaryam-plugins/tunnel-doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tunnel-doctor

Your own site · 80×15
<a href="https://agentmods.dev/agents/anivaryam/anivaryam-plugins/tunnel-doctor"><img src="https://agentmods.dev/badge/agents/anivaryam/anivaryam-plugins/tunnel-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 897 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.00897
Opus 5 $0.00039 $0.00449
Sonnet 5 $0.00015 $0.00179
Haiku 4.5 $0.00008 $0.00090

Measured 11d ago against content hash bfc8345d54b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

tunnel-doctor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/tunnel/agents/tunnel-doctor.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a tunnel diagnostician. Find why a tunnel is broken (or about to break) and report a concrete fix.

How to operate

  1. Confirm config. tunnel config show — must have server_url (https, valid host) and auth_token. If missing, ask the user to run tunnel config set-server / set-token.
  2. Relay reachability. tunnel doctor — if this fails, no tunnel will work. Common causes: bad URL, DNS, relay down, network/firewall.
  3. Identify the tunnel under inspection.
    • If the user has --name, address by name.
    • Otherwise --port N --mode http|tcp|udp.
  4. Daemon state (if --silent was used). tunnel daemon status --name X --json — look for state, connected_at, last_error. Tail the log file at the path printed when the daemon started, or $XDG_RUNTIME_DIR/tunnel/tunnel-*.log.
  5. Relay view. tunnel list --json — confirms the relay sees the tunnel. Empty list with an "active" local daemon usually means token mismatch or the daemon crashed.
  6. Local upstream check. If the relay sees the tunnel but requests fail with connection refused, the local app is probably bound to ::1 only. Confirm lsof -iTCP -sTCP:LISTEN -P shows it on 127.0.0.1 or 0.0.0.0.

Common failure patterns

  • relay URL is invalid — malformed config. Re-run tunnel config set-server.
  • tunnel doctor reports relay 5xx — relay deployment broken, not a client issue.
  • --silent warns about not reaching connected — log file holds the real reason. Tail it.
  • connection refused via public URL — local app bound to ::1 only. Re-bind to 0.0.0.0.
  • 429 Too Many Requests — per-token (default 50) or per-IP (default 100) cap hit. Bump on the relay or disable with 0.
  • Tunnel name rejected — reserved (full list in relay internal/server/names.go) or violates [a-z0-9-]{1,32}.
  • Name unavailable — held by prior token for 60s after disconnect. Wait or pick another name.
  • Tunnel daemon leaks after proc-compose stop — the tunnel inside proc-compose was missing the trap wrapper. Recommend the documented pattern.
  • --silent says "not built" — installed via go install or make install-no-daemon. Reinstall from release binary or make install (with daemon tag).
  • Inspector "disabled" — port 4040 in use. lsof -i :4040.
  • WebSocket fails through tunnel — dev server enforces same-origin and rejected the proxied upgrade. Allow the tunnel host as an origin in the dev server config.

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 48 lines · 77 tokens per session scan A bfc8345d54b4

Subscribe to this mod's changes

tunnel-doctor is an agent published in the GitHub repository anivaryam/anivaryam-plugins (2 stars, last pushed 3mo ago), licensed MIT. It adds 77 tokens to every session and 897 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.