{
  "schemaVersion": "1.0",
  "item": {
    "slug": "clawdscan",
    "name": "Clawdscan",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/cheenu1092-oss/clawdscan",
    "canonicalUrl": "https://clawhub.ai/cheenu1092-oss/clawdscan",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/clawdscan",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawdscan",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "ROADMAP.md",
      "SKILL.md",
      "TASK.md",
      "clawdscan.py",
      "heartbeat-integration.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/clawdscan"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/clawdscan",
    "agentPageUrl": "https://openagent3.xyz/skills/clawdscan/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawdscan/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawdscan/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "ClawdScan — Session Health Analyzer",
        "body": "🔍 Diagnose bloat, find zombies, reclaim disk space\n\nClawdScan is a zero-dependency Python CLI that analyzes Clawdbot/OpenClaw session JSONL files to identify bloated sessions, zombies, stale files, and provides actionable cleanup recommendations."
      },
      {
        "title": "Features",
        "body": "Session Health Analysis - Detect bloated sessions, high message counts, disk usage patterns\nZombie Detection - Find sessions created but never used\nStale Session Identification - Identify sessions inactive for configurable periods\nTool Usage Analytics - Track which tools are being used and how frequently\nModel Usage Patterns - Monitor model switching and usage trends\nDisk Space Management - Breakdown of storage usage by agent and session\nAutomatic Cleanup - Safe archive and deletion of problematic sessions\nTrend Tracking - Historical analysis of session health over time\nHeartbeat Integration - Automated monitoring and alerts"
      },
      {
        "title": "As Clawdbot Skill",
        "body": "clawdbot skill install clawdscan"
      },
      {
        "title": "Standalone",
        "body": "chmod +x clawdscan.py\n./clawdscan.py --help"
      },
      {
        "title": "Quick Start",
        "body": "# Full health scan\nclawdscan scan\n\n# Top 10 largest sessions\nclawdscan top -n 10\n\n# Clean up zombie sessions\nclawdscan clean --zombies --execute\n\n# View recent trends\nclawdscan history --days 7"
      },
      {
        "title": "scan - Full Health Scan",
        "body": "Comprehensive analysis of all Clawdbot sessions.\n\nclawdscan scan [--json output.json]\n\n# Examples\nclawdscan scan                    # Console output\nclawdscan scan --json report.json # Save as JSON\n\nOutput includes:\n\nTotal sessions and disk usage\nBloated sessions (>1MB or >300 messages)\nZombie sessions (created but unused)\nStale sessions (inactive >7 days)\nTop sessions by size and messages\nCleanup recommendations"
      },
      {
        "title": "top - Top Sessions",
        "body": "Show largest sessions by size or message count.\n\nclawdscan top [-n COUNT] [--sort {size|messages}]\n\n# Examples\nclawdscan top                     # Top 15 by size\nclawdscan top -n 20               # Top 20 by size\nclawdscan top --sort messages     # Top 15 by message count\nclawdscan top -n 10 --sort messages # Top 10 by messages"
      },
      {
        "title": "inspect - Deep Session Analysis",
        "body": "Detailed analysis of a specific session.\n\nclawdscan inspect <session-id>\n\n# Example\nclawdscan inspect chhotu-agent-20240109\n\nShows:\n\nSession metadata (created, last activity, size)\nMessage count breakdown by type\nTool usage within the session\nModel usage patterns\nLarge messages or potential issues"
      },
      {
        "title": "tools - Tool Usage Analytics",
        "body": "Aggregate statistics across all sessions.\n\nclawdscan tools\n\nAnalysis includes:\n\nMost frequently used tools\nTool usage by agent\nAverage tool call frequency\nTools that may be causing bloat"
      },
      {
        "title": "models - Model Usage Patterns",
        "body": "Track model usage and switching patterns.\n\nclawdscan models\n\nShows:\n\nModel usage distribution\nModel switching frequency\nCost implications (if token data available)\nModel preference by agent"
      },
      {
        "title": "disk - Storage Analysis",
        "body": "Breakdown of disk usage by agent and session type.\n\nclawdscan disk\n\nProvides:\n\nTotal storage usage\nUsage by agent\nLargest directories\nGrowth trends\nCleanup potential"
      },
      {
        "title": "clean - Session Cleanup",
        "body": "Safe cleanup of problematic sessions with preview mode.\n\nclawdscan clean [--zombies] [--stale-days N] [--execute]\n\n# Examples\nclawdscan clean --zombies           # Preview zombie cleanup\nclawdscan clean --zombies --execute # Execute zombie cleanup\nclawdscan clean --stale-days 28     # Preview cleanup of 28+ day old sessions\nclawdscan clean --stale-days 28 --execute # Execute stale cleanup\n\nSafety features:\n\nPreview mode by default (no destructive actions)\nBackup creation before deletion\nConfirmation prompts for large cleanups\nDetailed logs of all actions"
      },
      {
        "title": "history - Trend Analysis (New)",
        "body": "View session health trends over time.\n\nclawdscan history [--days N]\n\n# Examples\nclawdscan history               # Last 30 days\nclawdscan history --days 7     # Last week\nclawdscan history --days 90    # Last 3 months\n\nTracks:\n\nSession count over time\nStorage growth trends\nBloat accumulation patterns\nCleanup effectiveness"
      },
      {
        "title": "Environment Variables",
        "body": "CLAWDBOT_DIR - Override default Clawdbot directory\nNO_COLOR - Disable colored output"
      },
      {
        "title": "Thresholds (customizable in skill.json)",
        "body": "Bloat Size: 1 MB (sessions larger than this)\nBloat Messages: 300 messages\nStale Threshold: 7 days without activity\nZombie Threshold: 48 hours created but unused"
      },
      {
        "title": "Heartbeat Integration",
        "body": "ClawdScan can run automatically as part of Clawdbot's heartbeat system:\n\n### In HEARTBEAT.md\n- Check session health every 6 hours\n- Alert if >5 bloated sessions found\n- Alert if total usage >100MB\n- Auto-cleanup zombies (if enabled)"
      },
      {
        "title": "Heartbeat Configuration",
        "body": "{\n  \"heartbeat\": {\n    \"enabled\": true,\n    \"interval\": \"6h\",\n    \"auto_cleanup\": false,\n    \"alert_thresholds\": {\n      \"bloated_sessions\": 5,\n      \"total_size\": \"100MB\"\n    }\n  }\n}"
      },
      {
        "title": "Scan Output",
        "body": "🔍 ClawdScan v0.1.0 — Clawdbot Session Health Analysis\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📊 Overview\n  Total Sessions: 42\n  Total Size: 23.4 MB\n  Agents: main(38), dj(4)\n\n⚠️  Issues Found\n  🔥 Bloated: 3 sessions (>1MB or >300 msgs)\n  💀 Zombies: 2 sessions (created but unused)  \n  🗓️  Stale: 7 sessions (inactive >7 days)\n\n🔝 Top Sessions by Size\n  1. main-20240108-143022  4.2 MB  (1,247 msgs)\n  2. main-20240107-091534  2.8 MB  (892 msgs)\n  3. dj-20240105-220145    1.9 MB  (734 msgs)\n\n💡 Recommendations\n  • Archive 2 zombie sessions → save 145 KB\n  • Clean 7 stale sessions → save 3.2 MB\n  • Consider shorter session lifetimes"
      },
      {
        "title": "History Output",
        "body": "📈 Session Health Trends (Last 30 Days)\n\nWeek 1 (Jan 1-7):   12 sessions,  8.4 MB\nWeek 2 (Jan 8-14):  18 sessions, 15.7 MB  📈 +87% growth\nWeek 3 (Jan 15-21): 22 sessions, 19.3 MB  📈 +23% growth  \nWeek 4 (Jan 22-28): 28 sessions, 23.4 MB  📈 +21% growth\n\n🔥 Bloat Trend: 0 → 1 → 2 → 3 sessions\n💀 Zombie Trend: 1 → 1 → 2 → 2 sessions\n\n💡 Growth Rate: +38% sessions/week, +44% storage/week"
      },
      {
        "title": "Common Issues",
        "body": "\"No sessions found\"\n\nCheck --dir parameter points to correct Clawdbot directory\nVerify sessions exist in agents/*/sessions/\n\n\"Permission denied\"\n\nEnsure read access to ~/.clawdbot directory\nCheck file ownership and permissions\n\n\"JSON parsing error\"\n\nSome session files may be corrupted\nUse --verbose flag for detailed error info"
      },
      {
        "title": "Debug Mode",
        "body": "clawdscan scan --verbose --debug"
      },
      {
        "title": "Cron Job",
        "body": "# Daily health check at 2 AM\n0 2 * * * /usr/local/bin/clawdscan scan --json /var/log/clawdscan.json"
      },
      {
        "title": "Shell Script",
        "body": "#!/bin/bash\n# Weekly cleanup script\nclawdscan clean --zombies --execute\nclawdscan clean --stale-days 14 --execute\nclawdscan scan --json /var/log/weekly-scan.json"
      },
      {
        "title": "Python Integration",
        "body": "import subprocess\nimport json\n\n# Run scan and get JSON output\nresult = subprocess.run(['clawdscan', 'scan', '--json', '/tmp/scan.json'])\nwith open('/tmp/scan.json') as f:\n    data = json.load(f)\n    \n# Process results\nif data['bloated_sessions'] > 5:\n    notify_admin(\"ClawdBot cleanup needed\")"
      },
      {
        "title": "Adding New Commands",
        "body": "Add command handler to clawdscan.py\nUpdate skill.json tools array\nAdd documentation to SKILL.md\nUpdate --help text"
      },
      {
        "title": "Contributing",
        "body": "Follow existing code style\nAdd tests for new features\nUpdate documentation\nEnsure backward compatibility"
      },
      {
        "title": "License",
        "body": "MIT License - see LICENSE file for details."
      },
      {
        "title": "Support",
        "body": "GitHub Issues: Report bugs or request features\nDocumentation: This file and clawdscan.py --help"
      }
    ],
    "body": "ClawdScan — Session Health Analyzer\n\n🔍 Diagnose bloat, find zombies, reclaim disk space\n\nClawdScan is a zero-dependency Python CLI that analyzes Clawdbot/OpenClaw session JSONL files to identify bloated sessions, zombies, stale files, and provides actionable cleanup recommendations.\n\nFeatures\nSession Health Analysis - Detect bloated sessions, high message counts, disk usage patterns\nZombie Detection - Find sessions created but never used\nStale Session Identification - Identify sessions inactive for configurable periods\nTool Usage Analytics - Track which tools are being used and how frequently\nModel Usage Patterns - Monitor model switching and usage trends\nDisk Space Management - Breakdown of storage usage by agent and session\nAutomatic Cleanup - Safe archive and deletion of problematic sessions\nTrend Tracking - Historical analysis of session health over time\nHeartbeat Integration - Automated monitoring and alerts\nInstallation\nAs Clawdbot Skill\nclawdbot skill install clawdscan\n\nStandalone\nchmod +x clawdscan.py\n./clawdscan.py --help\n\nQuick Start\n# Full health scan\nclawdscan scan\n\n# Top 10 largest sessions\nclawdscan top -n 10\n\n# Clean up zombie sessions\nclawdscan clean --zombies --execute\n\n# View recent trends\nclawdscan history --days 7\n\nCommands\nscan - Full Health Scan\n\nComprehensive analysis of all Clawdbot sessions.\n\nclawdscan scan [--json output.json]\n\n# Examples\nclawdscan scan                    # Console output\nclawdscan scan --json report.json # Save as JSON\n\n\nOutput includes:\n\nTotal sessions and disk usage\nBloated sessions (>1MB or >300 messages)\nZombie sessions (created but unused)\nStale sessions (inactive >7 days)\nTop sessions by size and messages\nCleanup recommendations\ntop - Top Sessions\n\nShow largest sessions by size or message count.\n\nclawdscan top [-n COUNT] [--sort {size|messages}]\n\n# Examples\nclawdscan top                     # Top 15 by size\nclawdscan top -n 20               # Top 20 by size\nclawdscan top --sort messages     # Top 15 by message count\nclawdscan top -n 10 --sort messages # Top 10 by messages\n\ninspect - Deep Session Analysis\n\nDetailed analysis of a specific session.\n\nclawdscan inspect <session-id>\n\n# Example\nclawdscan inspect chhotu-agent-20240109\n\n\nShows:\n\nSession metadata (created, last activity, size)\nMessage count breakdown by type\nTool usage within the session\nModel usage patterns\nLarge messages or potential issues\ntools - Tool Usage Analytics\n\nAggregate statistics across all sessions.\n\nclawdscan tools\n\n\nAnalysis includes:\n\nMost frequently used tools\nTool usage by agent\nAverage tool call frequency\nTools that may be causing bloat\nmodels - Model Usage Patterns\n\nTrack model usage and switching patterns.\n\nclawdscan models\n\n\nShows:\n\nModel usage distribution\nModel switching frequency\nCost implications (if token data available)\nModel preference by agent\ndisk - Storage Analysis\n\nBreakdown of disk usage by agent and session type.\n\nclawdscan disk\n\n\nProvides:\n\nTotal storage usage\nUsage by agent\nLargest directories\nGrowth trends\nCleanup potential\nclean - Session Cleanup\n\nSafe cleanup of problematic sessions with preview mode.\n\nclawdscan clean [--zombies] [--stale-days N] [--execute]\n\n# Examples\nclawdscan clean --zombies           # Preview zombie cleanup\nclawdscan clean --zombies --execute # Execute zombie cleanup\nclawdscan clean --stale-days 28     # Preview cleanup of 28+ day old sessions\nclawdscan clean --stale-days 28 --execute # Execute stale cleanup\n\n\nSafety features:\n\nPreview mode by default (no destructive actions)\nBackup creation before deletion\nConfirmation prompts for large cleanups\nDetailed logs of all actions\nhistory - Trend Analysis (New)\n\nView session health trends over time.\n\nclawdscan history [--days N]\n\n# Examples\nclawdscan history               # Last 30 days\nclawdscan history --days 7     # Last week\nclawdscan history --days 90    # Last 3 months\n\n\nTracks:\n\nSession count over time\nStorage growth trends\nBloat accumulation patterns\nCleanup effectiveness\nConfiguration\nEnvironment Variables\nCLAWDBOT_DIR - Override default Clawdbot directory\nNO_COLOR - Disable colored output\nThresholds (customizable in skill.json)\nBloat Size: 1 MB (sessions larger than this)\nBloat Messages: 300 messages\nStale Threshold: 7 days without activity\nZombie Threshold: 48 hours created but unused\nHeartbeat Integration\n\nClawdScan can run automatically as part of Clawdbot's heartbeat system:\n\n### In HEARTBEAT.md\n- Check session health every 6 hours\n- Alert if >5 bloated sessions found\n- Alert if total usage >100MB\n- Auto-cleanup zombies (if enabled)\n\nHeartbeat Configuration\n{\n  \"heartbeat\": {\n    \"enabled\": true,\n    \"interval\": \"6h\",\n    \"auto_cleanup\": false,\n    \"alert_thresholds\": {\n      \"bloated_sessions\": 5,\n      \"total_size\": \"100MB\"\n    }\n  }\n}\n\nOutput Examples\nScan Output\n🔍 ClawdScan v0.1.0 — Clawdbot Session Health Analysis\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📊 Overview\n  Total Sessions: 42\n  Total Size: 23.4 MB\n  Agents: main(38), dj(4)\n\n⚠️  Issues Found\n  🔥 Bloated: 3 sessions (>1MB or >300 msgs)\n  💀 Zombies: 2 sessions (created but unused)  \n  🗓️  Stale: 7 sessions (inactive >7 days)\n\n🔝 Top Sessions by Size\n  1. main-20240108-143022  4.2 MB  (1,247 msgs)\n  2. main-20240107-091534  2.8 MB  (892 msgs)\n  3. dj-20240105-220145    1.9 MB  (734 msgs)\n\n💡 Recommendations\n  • Archive 2 zombie sessions → save 145 KB\n  • Clean 7 stale sessions → save 3.2 MB\n  • Consider shorter session lifetimes\n\nHistory Output\n📈 Session Health Trends (Last 30 Days)\n\nWeek 1 (Jan 1-7):   12 sessions,  8.4 MB\nWeek 2 (Jan 8-14):  18 sessions, 15.7 MB  📈 +87% growth\nWeek 3 (Jan 15-21): 22 sessions, 19.3 MB  📈 +23% growth  \nWeek 4 (Jan 22-28): 28 sessions, 23.4 MB  📈 +21% growth\n\n🔥 Bloat Trend: 0 → 1 → 2 → 3 sessions\n💀 Zombie Trend: 1 → 1 → 2 → 2 sessions\n\n💡 Growth Rate: +38% sessions/week, +44% storage/week\n\nTroubleshooting\nCommon Issues\n\n\"No sessions found\"\n\nCheck --dir parameter points to correct Clawdbot directory\nVerify sessions exist in agents/*/sessions/\n\n\"Permission denied\"\n\nEnsure read access to ~/.clawdbot directory\nCheck file ownership and permissions\n\n\"JSON parsing error\"\n\nSome session files may be corrupted\nUse --verbose flag for detailed error info\nDebug Mode\nclawdscan scan --verbose --debug\n\nIntegration Examples\nCron Job\n# Daily health check at 2 AM\n0 2 * * * /usr/local/bin/clawdscan scan --json /var/log/clawdscan.json\n\nShell Script\n#!/bin/bash\n# Weekly cleanup script\nclawdscan clean --zombies --execute\nclawdscan clean --stale-days 14 --execute\nclawdscan scan --json /var/log/weekly-scan.json\n\nPython Integration\nimport subprocess\nimport json\n\n# Run scan and get JSON output\nresult = subprocess.run(['clawdscan', 'scan', '--json', '/tmp/scan.json'])\nwith open('/tmp/scan.json') as f:\n    data = json.load(f)\n    \n# Process results\nif data['bloated_sessions'] > 5:\n    notify_admin(\"ClawdBot cleanup needed\")\n\nDevelopment\nAdding New Commands\nAdd command handler to clawdscan.py\nUpdate skill.json tools array\nAdd documentation to SKILL.md\nUpdate --help text\nContributing\nFollow existing code style\nAdd tests for new features\nUpdate documentation\nEnsure backward compatibility\nLicense\n\nMIT License - see LICENSE file for details.\n\nSupport\nGitHub Issues: Report bugs or request features\nDocumentation: This file and clawdscan.py --help"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/cheenu1092-oss/clawdscan",
    "publisherUrl": "https://clawhub.ai/cheenu1092-oss/clawdscan",
    "owner": "cheenu1092-oss",
    "version": "0.3.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/clawdscan",
    "downloadUrl": "https://openagent3.xyz/downloads/clawdscan",
    "agentUrl": "https://openagent3.xyz/skills/clawdscan/agent",
    "manifestUrl": "https://openagent3.xyz/skills/clawdscan/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/clawdscan/agent.md"
  }
}