diag-network-port-unreach

diag-network-port-unreach is a skill for Claude Code, Codex from seed-forge/harness-ai-kit. It costs 54 tokens per session (1,470 once invoked), scanned A, original, Apache-2.0.

A step-by-step runbook for finding why a network service port cannot be reached. It checks name lookup, the connection, firewall rules, listening services, routing and security controls.

In plain words
What is it for?
Use it to diagnose a host and port, inspect TCP connectivity, verify service bindings, review firewall and NAT rules, and produce a connectivity report with repair suggestions.
Why use it?
It replaces guesswork when a connection times out or is refused by narrowing the failure down to a specific network or server layer.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to diagnose a host and port, inspect TCP connectivity, verify service bindings, review firewall and NAT rules, and produce a connectivity report with repair suggestions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/seed-forge/harness-ai-kit/diag-network-port-unreach
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.

Any agent
npx skills add seed-forge/harness-ai-kit --skill diag-network-port-unreach
Clone the repo
git clone --depth 1 https://github.com/seed-forge/harness-ai-kit

Made for: Claude Code, Codex.

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 diag-network-port-unreach

README.md
[![agentmods](https://agentmods.dev/badge/skills/seed-forge/harness-ai-kit/diag-network-port-unreach/github.svg)](https://agentmods.dev/skills/seed-forge/harness-ai-kit/diag-network-port-unreach)
Your own site
<a href="https://agentmods.dev/skills/seed-forge/harness-ai-kit/diag-network-port-unreach"><img src="https://agentmods.dev/badge/skills/seed-forge/harness-ai-kit/diag-network-port-unreach/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 diag-network-port-unreach

Your own site · 80×15
<a href="https://agentmods.dev/skills/seed-forge/harness-ai-kit/diag-network-port-unreach"><img src="https://agentmods.dev/badge/skills/seed-forge/harness-ai-kit/diag-network-port-unreach.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,470 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00054 $0.01470
Opus 5 $0.00027 $0.00735
Sonnet 5 $0.00011 $0.00294
Haiku 4.5 $0.00005 $0.00147

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

Security

Grade A, and why

diag-network-port-unreach 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 12d 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.

skills/diag-network-port-unreach/SKILL.md · 189 lines

How it starts

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

Network Port Unreachable Full-Chain Diagnostics

用途

当用户报告某个端口/服务不可达、连接超时或被拒绝时触发。

输入

  • 目标 host:port
  • 可选:源机器、协议(TCP/UDP)

输出

  • 端口连通性诊断报告 + 修复建议

诊断步骤

Step 1: DNS 解析

# 确认目标地址能解析
dig +short {hostname}
nslookup {hostname}
getent hosts {hostname}
# 如果是 IP 则跳过 DNS

Step 2: TCP 连通性测试

# 基础连通
nc -zv {host} {port} -w 5
# 或
timeout 5 bash -c "echo > /dev/tcp/{host}/{port}" 2>&1

# 多端口批量测试
for p in {port_list}; do nc -zv {host} $p -w 3 2>&1; done

# 路由追踪
traceroute -T -p {port} {host}

Step 3: 目标端服务监听

# 服务是否在监听
ss -tlnp | grep :{port}
# 或
netstat -tlnp | grep :{port}

# 绑定地址(127.0.0.1 vs 0.0.0.0)
ss -tlnp | grep :{port} | awk '{print $4}'

Step 4: 防火墙规则

# iptables
iptables -L INPUT -n --line-numbers | grep {port}
iptables -L FORWARD -n --line-numbers | grep {port}

# firewalld
firewall-cmd --list-all
firewall-cmd --query-port={port}/tcp

# nftables
nft list ruleset | grep {port}

# ufw
ufw status numbered | grep {port}

Step 5: 路由与 NAT

# 路由表
ip route get {target_ip}
ip route show table all | grep {subnet}

# NAT 规则(端口转发场景)
iptables -t nat -L PREROUTING -n --line-numbers
iptables -t nat -L DNAT -n --line-numbers

# Windows portproxy(如果涉及 Windows 转发)
netsh interface portproxy show all

输出模板

Port Connectivity Diagnosis Report
════════════════════════════════════════
Target:    {host}:{port}
Protocol:  {tcp/udp}
Source:    {source_host}
Time:      {timestamp}

DNS Resolution
  {hostname} → {resolved_ip} (or N/A for IP)

TCP Connect Test
  {host}:{port} → {open/closed/timeout/refused}

Service Listening (target side)
  Port {port}: {listening/not_listening}
  Bind Address: {bind_addr} (127.0.0.1 = local only!)
  Process: {process_name} (PID: {pid})

Firewall Rules
  iptables INPUT:  {rule_or_none}
  firewalld:       {port_status}
  nftables:        {rule_or_none}

Routing
  Path: {source} → {next_hop} → ... → {destination}
  NAT:  {nat_rules_or_none}

Root Cause: {root_cause}

Recommendations
  1. {fix_1}
  2. {fix_2}

Read the full file on GitHub · 189 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 189 lines · 54 tokens per session scan A 047d8e5a69c9

Subscribe to this mod's changes

diag-network-port-unreach is a skill published in the GitHub repository seed-forge/harness-ai-kit (22 stars, last pushed 12d ago), licensed Apache-2.0. It adds 54 tokens to every session and 1,470 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

lcx-report-bug

Create a high-signal bug issue or PR in the repo that owns the defect. Use this whenever the user asks to report, file, open, or triage a LazyCodex, lazycodex-ai, omo-codex, Codex plugin, or upstream Codex CLI bug, especially when they need source-backed root cause, reproduction steps, fix guidance, and GitHub routing.

code-yeongyu/oh-my-openagent · 85 tokens

ast-grep

Searches and rewrites code by AST shape across 25 languages. Use when the target is a syntax pattern (every call/class/import shaped like X, a codemod, a YAML rule) rather than literal text; for plain strings, comments, or filenames, use rg.

code-yeongyu/oh-my-openagent · 61 tokens

debugging

Runs a hypothesis-driven debugging loop across any language or binary, escalating to orthogonal oracle angles and locking the fix with a failing test. Use for crashes, silent failures, hangs, wrong responses, memory leaks, async misbehavior, or reverse engineering.

code-yeongyu/oh-my-openagent · 53 tokens

lcx-doctor

Diagnose LazyCodex and Codex CLI installation health against the latest sources. Use whenever the user asks for a doctor or health check, says LazyCodex, lazycodex-ai, omo-codex, or Codex behaves oddly after an install, update, or config change, suspects a stale, drifted, or broken setup, or wants the local install…

code-yeongyu/oh-my-openagent · 93 tokens

remove-deadcode

Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic commits. Triggers: remove dead code, dead code, cleanup, remove unused.

code-yeongyu/oh-my-openagent · 41 tokens

lsp

Use when Codex needs language-server diagnostics, definitions, references, symbols, or rename safety checks in the current workspace.

code-yeongyu/oh-my-openagent · 27 tokens