Skip to main content

Overview

The ironclaw doctor command runs comprehensive diagnostic checks to validate your IronClaw installation. It actively probes external dependencies, tests database connectivity, and verifies configuration to surface issues before they cause problems during operation.
Unlike ironclaw status which provides passive status information, doctor performs active tests including network calls and binary checks.

Usage

No options or arguments required.

Output

Diagnostic Checks

NEAR AI Session

Validates authentication with NEAR AI:
  • Pass: Session file exists and is readable
  • Fail: Session file missing or empty
Pass output:
Fail output:
API key mode:

Database Backend

Tests database connectivity:
  • PostgreSQL: Attempts connection and executes SELECT 1
  • libSQL: Checks if database file exists or can be created
Pass output:
or
Fail output:

Workspace Directory

Verifies the workspace directory exists or can be created: Pass output:
or
Fail output:

Docker

Checks if Docker is installed and running: Pass output:
Skip output:
Fail output:
Docker is required for sandboxed code execution. If you don’t need code execution, it’s safe to skip this check.

cloudflared

Checks for Cloudflare Tunnel CLI: Pass output:
Skip output:
cloudflared is only needed if you want to expose your agent to the internet via Cloudflare Tunnels.

ngrok

Checks for ngrok tunnel client: Pass output:
Skip output:

tailscale

Checks for Tailscale VPN client: Pass output:
Skip output:

Exit Codes

The doctor command always exits with code 0, even if some checks fail. This is intentional — not all checks are required for every use case.
  • Missing tunnel tools (cloudflared, ngrok, tailscale) are expected if you don’t need remote access
  • Missing Docker is acceptable if you don’t use code execution
Critical failures (database, session) should be addressed before running the agent.

Check Results

Three possible outcomes for each check:

Pass

The check succeeded. Everything is working as expected.

Fail

The check failed. This may indicate a problem that needs attention.

Skip

The check was skipped (usually because the tool isn’t installed). This is often expected and not a problem.

Examples

First-time setup validation

After running ironclaw onboard, verify everything is configured:

Troubleshooting

If the agent isn’t starting:
Look for [FAIL] results and address them.

Pre-deployment check

Before deploying to production:
Verify all critical checks pass.

CI/CD pipeline

Add to your CI/CD pipeline:

Common Issues and Solutions

Problem:
Solution:
This will authenticate with NEAR AI and create the session file.
Problem:
Solution:
  1. Check that PostgreSQL is running:
  2. Verify DATABASE_URL is correct:
  3. Test connection manually:
Or switch to libSQL:
Problem:
Solution (if you need Docker):macOS:
Linux:
Skip this check if you don’t need code execution features.
Problem:
Solution: The workspace path is occupied by a file. Remove it:
Or choose a different path:

What Gets Checked

Configuration Checks

  • NEAR AI authentication (session file or API key)
  • Database backend (PostgreSQL or libSQL)
  • Workspace directory

External Binary Checks

  • Docker (for code execution)
  • cloudflared (for Cloudflare Tunnels)
  • ngrok (for ngrok tunnels)
  • tailscale (for Tailscale VPN)

Not Checked

  • WASM tools (use ironclaw tool list)
  • MCP servers (use ironclaw mcp list)
  • Settings values (use ironclaw config list)
  • Service status (use ironclaw service status)

Status vs Doctor

Two commands provide health information:
Use status for quick checks. Use doctor for thorough diagnostics.

ironclaw status

Quick health check

ironclaw onboard

Fix configuration issues

ironclaw config list

View all settings