diag

diag is a command for coding agents from CallMeTechie/fleet-manager. It costs 25 tokens per session (792 once invoked), scanned B, original, MIT.

A diagnostic command for a remote server that checks SSH access, passwordless sudo, Docker, disk usage, and system load. SSH is the secure connection method used to log in to the server.

In plain words
What is it for?
Use it when onboarding a server or troubleshooting access, permissions, Docker installation, storage space, or high system load.
Why use it?
It helps identify whether a server connection or required system setup is preventing other commands from working.

Command

Part of the fleet-manager plugin — 1 skill, 17 commands, 1 agent shipped together

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.

agentmods
npx agentmods add commands/callmetechie/fleet-manager/diag
Clone the repo
git clone --depth 1 https://github.com/CallMeTechie/fleet-manager

Or install fleet-manager, the plugin that ships this one along with the rest of its 1 skill, 17 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 diag

README.md
[![agentmods](https://agentmods.dev/badge/commands/callmetechie/fleet-manager/diag.svg)](https://agentmods.dev/commands/callmetechie/fleet-manager/diag)
Your own site
<a href="https://agentmods.dev/commands/callmetechie/fleet-manager/diag"><img src="https://agentmods.dev/badge/commands/callmetechie/fleet-manager/diag.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 792 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00025 $0.00792
Opus 5 $0.00013 $0.00396
Sonnet 5 $0.00005 $0.00158
Haiku 4.5 $0.00003 $0.00079

Measured 3d ago against content hash d864f806ebaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

diag scanned grade B with 1 finding 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 3d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

# 2. Passwordless sudo if "${FM_SSH[@]}" "sudo -n true 2>/dev/null"; then
plugin/commands/diag.md · 73 lines

What it actually says

Diag

set -euo pipefail
source "${CLAUDE_PLUGIN_ROOT:-plugin}/commands/_fleet-lib.sh"

NAME="$(resolve_server "$(printf '%s' "$ARGUMENTS" | tr -d '[:space:]')")"
build_ssh "$NAME"
echo_target "$NAME"
echo "── Diagnostics ──"

# 1. SSH reachability
if "${FM_SSH[@]}" "echo OK" 2>/dev/null | grep -qx OK; then
  echo "PASS  SSH reachable"
else
  echo "FAIL  SSH unreachable — run /setup-ssh $NAME (key not deployed?), check port/host."
  exit 1
fi

# 2. Passwordless sudo
if "${FM_SSH[@]}" "sudo -n true 2>/dev/null"; then
  echo "PASS  passwordless sudo available"
else
  echo "WARN  no passwordless sudo (privileged ops need a NOPASSWD sudoers drop-in)"
fi

# 3. Docker presence + working invocation (probe order: no-sudo, sudo, abs paths)
DOCKER_CMD=""
for cand in "docker" "sudo -n docker" "sudo -n /usr/local/bin/docker" "/usr/local/bin/docker"; do
  if "${FM_SSH[@]}" "$cand info --format '{{.ServerVersion}}' 2>/dev/null" | grep -q '^[0-9][0-9]*\.[0-9]'; then
    DOCKER_CMD="$cand"; break
  fi
done
if [ -n "$DOCKER_CMD" ]; then
  echo "PASS  docker present (via: $DOCKER_CMD)"
else
  echo "WARN  docker not found (Phase 2 compose features unavailable)"
fi

# 4. Disk usage (root fs) — capture first so a transient SSH error here does NOT
#    abort the whole command under `set -e`/`pipefail` after step 1 passed (C1).
if disk_out="$("${FM_SSH[@]}" "df -h / | tail -1" 2>/dev/null)"; then
  printf '%s\n' "$disk_out" | awk '{print "INFO  disk / used "$5" ("$3"/"$2")"}'
else
  echo "WARN  disk query failed (transient SSH error?)"
fi

# 5. Load
if up_out="$("${FM_SSH[@]}" "uptime" 2>/dev/null)"; then
  printf '%s\n' "$up_out" | sed 's/^/INFO  /'
else
  echo "WARN  uptime query failed"
fi

After printing, update the Discovered State section and the UTC Last Updated line of context/servers/<name>.md (use the lib's sanitize_value on stored values). Also persist the docker probe: set docker_available to yes/no and docker_cmd to $DOCKER_CMD (or _not configured_). Lazy migration for pre-Phase-2 profiles that lack the docker_cmd line — insert it after - docker_available::

if ! grep -q '^- docker_cmd:' "$PROFILE"; then
  TMP_P="$(mktemp)"
  awk '/^- docker_available:/ { print; print "- docker_cmd: _not configured_"; next } { print }' "$PROFILE" > "$TMP_P" && mv "$TMP_P" "$PROFILE"
fi
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. 3d ago First seen · 73 lines · 25 tokens per session scan B d864f806ebaa

Subscribe to this mod's changes

diag is a command published in the GitHub repository CallMeTechie/fleet-manager (1 stars, last pushed 1mo ago), licensed MIT. It adds 25 tokens to every session and 792 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other commands, from other repositories