← Back to Skills Marketplace
sharbelayy

Agent Audit

by sharbel · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
1753
Downloads
0
Stars
19
Active Installs
1
Versions
Install in OpenClaw
/install agent-audit
Description
Audit your AI agent setup for performance, cost, and ROI. Scans OpenClaw config, cron jobs, session history, and model usage to find waste and recommend opti...
README (SKILL.md)

Agent Audit

Scan your entire OpenClaw setup and get actionable cost/performance recommendations.

What This Skill Does

  1. Scans config — reads OpenClaw config to map models to agents/tasks
  2. Analyzes cron history — checks every cron job's model, token usage, runtime, success rate
  3. Classifies tasks — determines complexity level of each task
  4. Calculates costs — per agent, per cron, per task type using provider pricing
  5. Recommends changes — with confidence levels and risk warnings
  6. Generates report — markdown report with specific savings estimates

Running the Audit

python3 {baseDir}/scripts/audit.py

Options:

python3 {baseDir}/scripts/audit.py --format markdown    # Full report (default)
python3 {baseDir}/scripts/audit.py --format summary     # Quick summary only
python3 {baseDir}/scripts/audit.py --dry-run             # Show what would be analyzed
python3 {baseDir}/scripts/audit.py --output /path/to/report.md  # Save to file

How It Works

Phase 1: Discovery

  • Read OpenClaw config (~/.openclaw/openclaw.json or similar)
  • List all cron jobs and their configurations
  • List all agents and their default models
  • Detect provider (Anthropic, OpenAI, Google, xAI) from model names

Phase 2: History Analysis

  • Pull cron job run history (last 7 days by default)
  • Calculate per-job: avg tokens, avg runtime, success rate, model used
  • Pull session history where available
  • Calculate total token spend by model tier

Phase 3: Task Classification

Classify each task into complexity tiers:

Tier Examples Recommended Models
Simple Health checks, status reports, reminders, notifications Cheapest tier (Haiku, GPT-4o-mini, Flash, Grok-mini)
Medium Content drafts, research, summarization, data analysis Mid tier (Sonnet, GPT-4o, Pro, Grok)
Complex Coding, architecture, security review, nuanced writing Top tier (Opus, GPT-4.5, Ultra, Grok-2)

Classification signals:

  • Simple: Short output (\x3C500 tokens), low thinking requirement, repetitive pattern, status/health tasks
  • Medium: Medium output, some reasoning needed, creative but templated, research tasks
  • Complex: Long output, multi-step reasoning, code generation, security-critical, tasks that previously failed on weaker models

Phase 4: Recommendations

For each task where the model tier doesn't match complexity:

⚠️ RECOMMENDATION: Downgrade "Knox Bot Health Check" from opus to haiku
   Current: anthropic/claude-opus-4 ($15/M input, $75/M output)
   Suggested: anthropic/claude-haiku ($0.25/M input, $1.25/M output)
   Reason: Simple status check averaging 300 output tokens
   Estimated savings: $X.XX/month
   Risk: LOW — task is simple pattern matching
   Confidence: HIGH

Safety Rules — NEVER Recommend Downgrading:

  • Coding/development tasks
  • Security reviews or audits
  • Tasks that have previously failed on weaker models
  • Tasks where the user explicitly chose a higher model
  • Complex multi-step reasoning tasks
  • Anything the user flagged as critical

Phase 5: Report Generation

Output a clean markdown report with:

  1. Overview — total agents, crons, monthly spend estimate
  2. Per-agent breakdown — model, usage, cost
  3. Per-cron breakdown — model, frequency, avg tokens, cost
  4. Recommendations — sorted by savings potential
  5. Total potential savings — monthly estimate
  6. One-liner config changes — exact model strings to swap

Model Pricing Reference

See references/model-pricing.md for current pricing across all providers. Update this file when prices change.

Task Classification Details

See references/task-classification.md for detailed heuristics on how tasks are classified into complexity tiers.

Important Notes

  • This skill is read-only — it never changes your config automatically
  • All recommendations include risk levels and confidence scores
  • When unsure about a task's complexity, it defaults to keeping the current model
  • The audit should be re-run periodically (monthly) as usage patterns change
  • Token counts are estimates based on cron history — actual costs depend on your provider's billing
Usage Guidance
This skill appears to be what it says: a read-only audit that reads your OpenClaw config and (when available) cron/session history to estimate token usage and recommend model tier changes. Before running: (1) review scripts/audit.py yourself (it runs locally and will read files under ~/.openclaw and related config locations); (2) run with --dry-run and --output to inspect results without making changes (the tool claims it never writes config automatically); (3) be aware that the tool estimates costs using the included pricing table — it does not access provider billing APIs or require API keys, so its cost estimates are approximate unless you supply cron/session histories that include accurate token counts; (4) if you plan to grant it access to an OpenClaw cron API or other telemetry, understand what those endpoints expose (session contents, logs, or tokens may contain sensitive data). If you want absolute assurance, run the script in a safe environment or audit the code line-by-line; otherwise the skill is coherent and proportionate for its purpose.
Capability Analysis
Type: OpenClaw Skill Name: agent-audit Version: 1.0.0 The OpenClaw Agent Audit skill is designed to analyze agent configurations and usage for cost optimization. It reads OpenClaw configuration files (e.g., `~/.openclaw/openclaw.json`) to identify models and agent setups, which is necessary for its stated purpose. The `scripts/audit.py` code does not perform any network requests, execute arbitrary system commands, or modify any files other than optionally writing a markdown report to a user-specified path. The `SKILL.md` instructions are clear, align with the script's functionality, and contain no evidence of prompt injection attempts to subvert the agent's behavior for malicious purposes. The skill explicitly states it is 'read-only' and the code confirms this, focusing solely on analysis and reporting without making changes or exfiltrating sensitive data.
Capability Assessment
Purpose & Capability
Name and description match the code and SKILL.md: the skill reads OpenClaw config, enumerates agents/crons, classifies tasks, and estimates cost using an embedded pricing table. It does not request unexpected credentials or binaries.
Instruction Scope
SKILL.md and the script instruct the agent to read OpenClaw config files (e.g. ~/.openclaw/openclaw.json) and cron run history/session history. The shipped script reads local config and contains placeholders for cron API calls; pulling remote provider billing would require extra permissions not requested here. This is within scope for an audit tool, but 'pull session history' and 'cron API access' are ambiguous and may require additional explicit permissions when fully enabled.
Install Mechanism
Instruction-only skill with no install spec and one readable Python script. No downloads, no package installs, and no extract/run of remote code are present.
Credentials
The skill declares no environment variables, no credentials, and no config paths beyond OpenClaw locations. The required access (reading OpenClaw config and local cron history) is proportionate to the stated purpose. It does not request cloud provider credentials (note: that would be needed for billing-level accuracy, but the skill does not claim to use them).
Persistence & Privilege
The skill is not always-enabled and does not modify system or other skills' configs. SKILL.md states it is read-only and the code does not persist changes.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-audit
  3. After installation, invoke the skill by name or use /agent-audit
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of agent-audit skill. - Audits AI agent setups for performance, cost, and ROI across all major model providers. - Scans OpenClaw config, cron jobs, session history, and model usage to detect inefficiencies and overspending. - Classifies tasks by complexity and matches them to appropriate model tiers. - Generates actionable recommendations with risk and confidence ratings, as well as potential cost savings. - Produces a detailed markdown report with per-agent and per-cron breakdowns and suggested config changes. - Read-only tool—no automatic changes to your setup.
Metadata
Slug agent-audit
Version 1.0.0
License
All-time Installs 22
Active Installs 19
Total Versions 1
Frequently Asked Questions

What is Agent Audit?

Audit your AI agent setup for performance, cost, and ROI. Scans OpenClaw config, cron jobs, session history, and model usage to find waste and recommend opti... It is an AI Agent Skill for Claude Code / OpenClaw, with 1753 downloads so far.

How do I install Agent Audit?

Run "/install agent-audit" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Audit free?

Yes, Agent Audit is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Agent Audit support?

Agent Audit is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Audit?

It is built and maintained by sharbel (@sharbelayy); the current version is v1.0.0.

💬 Comments