{"id":"a47cc05c-08e0-4dbb-aa9a-e26731c9caab","entityType":"agent","slug":"clawhub-voronindenis5-tool-economy","name":"tool-economy","canonicalUrl":"https://www.xpersona.co/agent/clawhub-voronindenis5-tool-economy","canonicalPath":"/agent/clawhub-voronindenis5-tool-economy","generatedAt":"2026-10-10T02:45:18.799Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":null},"description":"Minimize tool call overhead. Every tool call costs tokens and latency. This skill teaches agents to batch independent calls, avoid redundant reads, cache results within a session, prefer single powerful commands over multiple weak ones, and track a 'tool budget'.","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.5K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17b6amkd3wzqgg640v03a9r1n83gxs1:tool-economy","sourceUrl":"https://clawhub.ai/voronindenis5/tool-economy","homepage":"https://clawhub.ai/voronindenis5/skills/tool-economy","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/voronindenis5/tool-economy","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/voronindenis5/skills/tool-economy","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":68,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"tool-economy technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":null},"stars":null,"forks":null,"downloads":2505,"packageName":null,"latestVersion":"0.1.1","tractionLabel":"2.5K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:13:07.310Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T14:13:07.346Z","lastCrawledAt":"2026-10-09T14:13:07.310Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T14:13:07.310Z","lastVerifiedAt":null,"highlights":[{"version":"0.1.1","createdAt":"2026-08-11T11:58:47.623Z","changelog":"- Removed the file: skill-card.md. - No other changes to core functionality or documentation.","fileCount":12,"zipByteSize":15869},{"version":"0.1.0","createdAt":"2026-08-05T19:49:34.527Z","changelog":"Initial release of the Tool Economy skill. - Introduces principles for minimizing tool call overhead by batching, caching, and consolidating actions. - Provides guidelines to agents on reducing redundant calls and tracking a “tool budget” for efficiency. - Includes quick-reference tables, checklists, and anti-patterns to encourage best practices in tool usage. - Supplies scripts and documentation for analyzing session efficiency and maximizing economy. - Suitable for any agent handling multiple tool invocations to optimize cost and latency.","fileCount":12,"zipByteSize":15752}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17b6amkd3wzqgg640v03a9r1n83gxs1:tool-economy","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17b6amkd3wzqgg640v03a9r1n83gxs1:tool-economy` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/voronindenis5/tool-economy before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T02:45:18.798Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-voronindenis5-tool-economy/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":null},"readme":"Skill: tool-economy\n\nOwner: voronindenis5\n\nSummary: Minimize tool call overhead. Every tool call costs tokens and latency. This skill teaches agents to batch independent calls, avoid redundant reads, cache results within a session, prefer single powerful commands over multiple weak ones, and track a 'tool budget'.\n\nTags: latest:0.1.1\n\nVersion history:\n\nv0.1.1 | 2026-08-11T11:58:47.623Z | auto\n\n- Removed the file: skill-card.md.  \n- No other changes to core functionality or documentation.\n\nv0.1.0 | 2026-08-05T19:49:34.527Z | auto\n\nInitial release of the Tool Economy skill.\n\n- Introduces principles for minimizing tool call overhead by batching, caching, and consolidating actions.\n- Provides guidelines to agents on reducing redundant calls and tracking a “tool budget” for efficiency.\n- Includes quick-reference tables, checklists, and anti-patterns to encourage best practices in tool usage.\n- Supplies scripts and documentation for analyzing session efficiency and maximizing economy.\n- Suitable for any agent handling multiple tool invocations to optimize cost and latency.\n\nArchive index:\n\nArchive v0.1.1: 12 files, 15869 bytes\n\nFiles: LICENSE (1070b), README.md (2858b), references (0b), references/antipatterns.md (3182b), references/batching.md (2360b), references/budgeting.md (2533b), scripts (0b), scripts/analyze_session.py (14003b), scripts/sample_session.json (1446b), skill-card.md (2348b), SKILL.md (4927b), _meta.json (131b)\n\nFile v0.1.1:SKILL.md\n\n---\nname: tool-economy\ndescription: >\n  Minimize tool call overhead. Every tool call costs tokens and latency.\n  This skill teaches agents to batch independent calls, avoid redundant\n  reads, cache results within a session, prefer single powerful commands\n  over multiple weak ones, and track a 'tool budget'.\nversion: 1.0.0\nauthor: Denis Voronin\nlicense: MIT\ntags:\n  - efficiency\n  - optimization\n  - tool-use\n  - cost\n  - latency\n  - agent\n---\n\n# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\n`Tool Economy` is a discipline for AI agents: treat each tool invocation as a\ncosted operation (tokens + latency) and minimize total overhead while preserving\ncorrectness. The goal is not to avoid tool use — it is to make every call count.\n\n## When to Use\n\nActivate this skill whenever you are:\n\n- About to issue multiple tool calls in a single turn\n- Reading files or data you may have already read this session\n- Considering whether to call a tool at all\n- Planning a multi-step workflow where calls can be parallelized\n- Reviewing your own agent behavior for efficiency\n\n## Core Principles\n\n### 1. Batch Independent Calls\n\nIf two or more tool calls do not depend on each other's output, issue them in the\n**same turn** (parallel). Do not serialize calls that could run concurrently.\n\n**Bad** (3 serial round-trips, 3x latency):\n```\nread_file(A)  -> wait\nread_file(B)  -> wait\nread_file(C)  -> wait\n```\n\n**Good** (1 round-trip, 1x latency):\n```\n[ read_file(A), read_file(B), read_file(C) ]   # one turn\n```\n\nSee `references/batching.md`.\n\n### 2. Avoid Redundant Reads\n\nIf you already read a file this session and it has not changed, **do not read it\nagain**. Track what you have seen. Prefer `session_search` or in-context memory\nover a fresh fetch. If a file was modified by your own action, you already know\nits new state — patch in place, don't re-read.\n\n### 3. Cache Within Session\n\nTreat the current session as a short-lived cache. The first expensive query\n(search, web fetch, build) populates it; subsequent identical needs reuse it.\nThis does not mean stale data — invalidate when the underlying source changes\n(e.g. you edited the file you previously read).\n\n### 4. Prefer One Powerful Command Over Many Weak Ones\n\n- `read_file` over a chain of `cat`, `head`, `tail`\n- `search_files` (content mode) over manual `grep` + `find` + `wc`\n- A single `patch` over `sed` + `awk` + redirect\n- One `web_extract` with 5 URLs over 5 separate fetches\n- `gh repo clone` over manually `git init` + `git remote add` + `git pull`\n\nEach \"weak\" command adds a full round-trip of tokens + latency for a sub-result\nyou could have gotten in one call.\n\n### 5. Track a Tool Budget\n\nBefore a multi-step task, estimate how many calls it *should* take, and compare\nagainst reality during and after. The companion script\n`scripts/analyze_session.py` computes:\n\n- **Total calls** and **redundant calls** (duplicates within a window)\n- **Serializable-but-parallel calls** (independent calls you issued serially)\n- **Estimated overhead**: extra round-trips × per-call latency cost\n- A **tool economy score** from 0 (worst) to 100 (best)\n\nRun it on any session log to see where you leaked budget.\n\n## Quick Reference\n\n| Situation                  | Anti-pattern                  | Economy pattern                          |\n|----------------------------|-------------------------------|------------------------------------------|\n| Need N independent reads   | N serial calls                | 1 batched turn                           |\n| Re-reading a static file   | Fresh `read_file`             | Reuse what's in context                  |\n| Searching then counting    | `grep` + `find` + `wc`        | `search_files(output_mode='count')`      |\n| Editing 3 spots in a file  | 3 terminal `sed` calls        | 1 `patch` (or `replace_all`)             |\n| Fetching 5 pages           | 5 `web_extract` calls         | 1 call, `urls=[...]`                     |\n| Unsure if data changed     | Re-read \"just in case\"        | Check mtime/hash, else reuse cache       |\n\n## How to Apply (Checklist)\n\nBefore issuing a turn's tool calls, ask:\n\n1. **Can these be batched?** If none depend on another's output → yes, combine.\n2. **Have I read this before?** If yes and unchanged → reuse, don't re-fetch.\n3. **Is there a single stronger command?** Replace a chain with one call.\n4. **Is this call necessary at all?** Can the answer be derived from context?\n5. **Am I within budget?** If calls >> estimate, stop and replan.\n\n## Files\n\n- `references/batching.md` — deep dive on parallelizing tool calls\n- `references/budgeting.md` — how to estimate and track a tool budget\n- `references/antipatterns.md` — catalog of wasteful patterns and fixes\n- `scripts/analyze_session.py` — analyze a session log, report efficiency metrics\n- `scripts/sample_session.json` — example input for the analyzer\n\n## License\n\nMIT © Denis Voronin\n\nFile v0.1.1:README.md\n\n# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\nA [Hermes Agent](https://hermes-agent.nousresearch.com/docs) / OpenClaw skill that\nteaches AI agents to **minimize tool-call overhead** — tokens and latency —\nwithout sacrificing correctness.\n\n## Why\n\nEvery tool invocation costs:\n\n- **Tokens** — the call's arguments and its full result travel through context.\n- **Latency** — each call is at least one network/compute round-trip.\n- **Reasoning overhead** — serial calls force extra planning turns between them.\n\nWasteful patterns (re-reading files, serializing independent calls, chaining weak\ncommands) compound quickly. `Tool Economy` gives the agent a discipline and a\nmeasurable score so it can self-correct.\n\n## What's Included\n\n- **`SKILL.md`** — the core skill: principles, checklist, quick-reference table.\n- **`references/`**\n  - `batching.md` — how and when to parallelize independent tool calls.\n  - `budgeting.md` — estimating, tracking, and reconciling a tool budget.\n  - `antipatterns.md` — catalog of 10 wasteful patterns and their fixes.\n- **`scripts/analyze_session.py`** — analyze a session log and report:\n  - total / redundant calls\n  - serializable-but-parallel (missed batching) calls\n  - estimated overhead (extra round-trips × latency)\n  - a **tool economy score** (0–100)\n- **`scripts/sample_session.json`** — example input for the analyzer.\n\n## Quick Start\n\n```bash\n# Analyze a session log\npython3 scripts/analyze_session.py scripts/sample_session.json\n```\n\nExample output:\n\n```\nTool Economy Report\n===================\nTotal tool calls              : 12\nRedundant calls               : 2\nMissed parallel opportunities : 3\nEstimated extra round-trips   : 5\nEstimated overhead            : 1500 ms\nTool economy score            : 58/100  [Fair]\n\nTop waste sources:\n  1. redundant_read        x2   (~600 ms)\n  2. missed_batching       x3   (~900 ms)\n```\n\n## Session Log Format\n\nThe analyzer accepts a JSON array of tool-call records:\n\n```json\n[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  ...\n]\n```\n\nOnly `tool` and `args` are required; `turn` and `calls_in_turn` are used for\nmissed-batching detection (see `scripts/analyze_session.py --help`).\n\n## Installation (Hermes Agent)\n\nCopy or symlink this directory into your skills folder:\n\n```bash\ncp -r tool-economy ~/.hermes/skills/\n```\n\nHermes auto-discovers skills with a valid `SKILL.md`. See the\n[skills docs](https://hermes-agent.nousresearch.com/docs) for details.\n\n## Principles (TL;DR)\n\n1. **Batch** independent calls into one turn.\n2. **Don't re-read** what's already in context.\n3. **Cache** expensive results for the session.\n4. **Prefer one strong command** over a chain of weak ones.\n5. **Track a tool budget** and replan when over.\n\n## License\n\nMIT © Denis Voronin\n\nFile v0.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn75wwn4x6djaf28jbykeamazd81gtdp\",\n  \"slug\": \"tool-economy\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1786449527623\n}\n\nFile v0.1.1:references/antipatterns.md\n\n# Anti-Patterns Catalog\n\nCommon ways agents waste tool budget, and the economy pattern that replaces each.\n\n---\n\n## AP-1: Serial Cascade of Independent Reads\n\n**Symptom:** Three `read_file` calls in three separate turns.\n\n**Cost:** 2 extra round-trips of latency + 2 extra reasoning passes.\n\n**Fix:** Batch into one turn. See `batching.md`.\n\n---\n\n## AP-2: Re-Reading a Static File\n\n**Symptom:** `read_file(config.yaml)` in turn 3, again in turn 7, with no edit\nin between.\n\n**Cost:** 1 redundant call (tokens + latency) for stale-identical data.\n\n**Fix:** Reuse the content already in context. Re-read only after the file is\nknown to have changed (e.g. you patched it, or an external mtime check differs).\n\n---\n\n## AP-3: Weak Command Chains\n\n**Symptom:**\n```\nterminal(\"grep -rn foo .\")\nterminal(\"grep -rn foo . | wc -l\")\nterminal(\"find . -name '*.py'\")\n```\n\n**Cost:** 3 calls for what one `search_files` call returns.\n\n**Fix:** Use the powerful built-in:\n```\nsearch_files(\"foo\", target=content, output_mode=count)\n```\n\n---\n\n## AP-4: Read-Then-Patch-Then-Read\n\n**Symptom:** Read a file, patch one line, then read the whole file again to\n\"verify.\"\n\n**Cost:** 1 redundant full-file read. The patch result already tells you the new\ncontent.\n\n**Fix:** Trust the patch output (or diff). Re-read only a *specific* region if\nyou must confirm layout, not the whole file.\n\n---\n\n## AP-5: Exploratory Ping-Pong\n\n**Symptom:** Alternating `search_files` → `read_file` → `search_files` →\n`read_file` across many turns without a plan.\n\n**Cost:** Many small calls, high latency, low signal.\n\n**Fix:** Do a single broad search (or a batched set of searches) up front, then\nbatch-read the relevant files, then act. Plan the exploration before executing.\n\n---\n\n## AP-6: Re-Fetching External Data\n\n**Symptom:** `web_extract(url)` called twice for the same URL in one session.\n\n**Cost:** Network latency + tokens for identical content.\n\n**Fix:** Cache the result in context. Re-fetch only if the source is\ntime-sensitive (news, prices, live status) and enough time has passed.\n\n---\n\n## AP-7: Confirm-Then-Do\n\n**Symptom:**\n```\nT1: terminal(\"ls\")           # \"is the file there?\"\nT2: terminal(\"cat file\")     # \"ok read it\"\n```\n\n**Cost:** 1 extra call to confirm something the actual operation would have\nreported anyway.\n\n**Fix:** Just attempt the real operation; handle the error if it fails. Most\ntools return clear errors for missing files/paths.\n\n---\n\n## AP-8: Forgetting `replace_all`\n\n**Symptom:** Five separate `patch` calls to rename one identifier in five spots.\n\n**Cost:** 4 extra calls.\n\n**Fix:** One `patch(..., replace_all=true)` or a single targeted sed via\n`terminal`.\n\n---\n\n## AP-9: Human-Style Click-Through\n\n**Symptom:** Navigating a browser one click at a time when a direct URL or API\ncall would do.\n\n**Cost:** Many slow browser round-trips.\n\n**Fix:** Prefer `web_extract` / direct API / direct URL navigation over\nincremental UI clicks.\n\n---\n\n## AP-10: No Budget, No Awareness\n\n**Symptom:** Agent never estimates or counts calls; \"just keeps going.\"\n\n**Cost:** Unbounded waste; no trigger to replan.\n\n**Fix:** Set a budget (see `budgeting.md`), tally as you go, stop when over.\n\nFile v0.1.1:references/batching.md\n\n# Batching Independent Tool Calls\n\nThe single highest-impact economy technique: **issue independent calls in the\nsame turn.** Most agent runtimes execute independent tool calls concurrently, so\nbatching collapses N round-trips into one.\n\n## What \"Independent\" Means\n\nCall B is *independent* of call A if B does not need A's output to be formed.\nYou can write out all N calls before seeing any result.\n\n| Independent (batch)             | Dependent (serial)                          |\n|---------------------------------|---------------------------------------------|\n| Read 3 unrelated files          | Read file → patch line found in it          |\n| Fetch 5 URLs                    | Search web → extract top result             |\n| Run tests + lint + typecheck    | Read config → run build with that config    |\n| `git status` + `git log` + `git diff` | `git add` → `git commit` → `git push` |\n\n## How to Batch\n\n1. Scan your planned next steps.\n2. Partition into \"rounds\": each round contains calls whose inputs are already\n   known.\n3. Issue each round as a single assistant turn with multiple tool calls.\n\n### Example: Inspecting a Repo Before a Change\n\n**Wasteful (5 serial turns):**\n```\nT1: read_file(package.json)\nT2: read_file(tsconfig.json)\nT3: search_files(\"TODO\", target=content)\nT4: terminal(\"git log --oneline -5\")\nT5: search_files(\"*.test.ts\", target=files)\n```\n\n**Economical (1 turn, 5 parallel calls):**\n```\nT1: [ read_file(package.json),\n      read_file(tsconfig.json),\n      search_files(\"TODO\"),\n      terminal(\"git log --oneline -5\"),\n      search_files(\"*.test.ts\", target=files) ]\n```\n\nSame information, ~5× lower wall-clock latency, same token cost for the calls\nthemselves (but far fewer reasoning tokens between turns).\n\n## Pitfalls\n\n- **False independence:** if call B's *arguments* depend on call A's result, you\n  cannot batch them. Re-check each pair.\n- **Resource contention:** two heavy `terminal` builds may fight for CPU. Stagger\n  if needed, but most read-only calls (file reads, searches, web fetches) are\n  safe to parallelize freely.\n- **Token budget per turn:** batching more calls grows the single response. If a\n  batch would be enormous, split into a few medium rounds rather than one huge\n  turn.\n\n## Rule of Thumb\n\n> If you can write all the calls before any of them returns, they belong in the\n> same turn.\n\nFile v0.1.1:references/budgeting.md\n\n# Tool Budgeting\n\nA *tool budget* is a soft estimate of how many tool calls a task should cost.\nYou set it before starting, compare against it while working, and reconcile at\nthe end.\n\n## Estimating a Budget\n\nBreak the task into sub-goals and count expected calls per sub-goal:\n\n| Sub-goal                  | Typical cost |\n|---------------------------|--------------|\n| Read N files (batched)    | 1 call       |\n| Search codebase           | 1 call       |\n| Edit a file               | 1 call       |\n| Run tests / build         | 1 call       |\n| Create a file             | 1 call       |\n| Verify result             | 1 call       |\n\nAdd them up. That is your budget. Example: \"refactor function X and update tests\"\nmight budget as:\n\n```\nread file(s)      : 1   (batched)\npatch source      : 1\npatch tests       : 1\nrun tests         : 1\nverify            : 1\n--------------------\ntotal             : 5 calls\n```\n\nIf you find yourself at call 8 and not done, **stop and replan** — something is\nwrong (you're re-reading, serializing, or using weak commands).\n\n## Tracking During the Task\n\nKeep a mental or explicit tally:\n\n- **Under budget** → proceed normally.\n- **At budget, not done** → audit for waste before continuing.\n- **Over budget** → stop; run `analyze_session.py` on the log so far, find the\n  leak, then replan the remaining work.\n\n## Reconciling After the Task\n\nRun the analyzer on the full session:\n\n```bash\npython3 scripts/analyze_session.py scripts/sample_session.json\n```\n\nKey metrics:\n\n- **Redundant calls** — exact duplicates within a window (default 10 calls).\n  Each is pure waste.\n- **Serializable-but-parallel** — independent calls issued in separate turns.\n  Each adds ~1 extra round-trip of latency.\n- **Overhead** — estimated extra round-trips × a per-call latency constant\n  (default 300ms, configurable).\n- **Score** — 100 minus penalties, clamped to [0, 100].\n\n### Score Bands\n\n| Score | Meaning                                    |\n|-------|--------------------------------------------|\n| 90+   | Excellent — nearly zero waste              |\n| 70–89 | Good — minor batching/caching gaps         |\n| 50–69 | Fair — several wasteful patterns present   |\n| <50   | Poor — re-architect the workflow           |\n\n## Adjusting the Budget Over Time\n\nKeep a note of *actual* vs *budgeted* calls for recurring task types. If a kind\nof task consistently runs 2× over, either the budget was naive or the workflow\nhas a structural inefficiency. Fix the workflow, not the budget.\n\nFile v0.1.1:scripts/sample_session.json\n\n[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 2,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/utils.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 3,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/config.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 4,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"TODO\", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 5,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 6,\n    \"tool\": \"patch\",\n    \"args\": {\"path\": \"src/main.py\", \"old_string\": \"def old():\", \"new_string\": \"def new():\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 7,\n    \"tool\": \"cat\",\n    \"args\": {\"command\": \"cat src/utils.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 8,\n    \"tool\": \"grep\",\n    \"args\": {\"command\": \"grep -rn import src/\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 9,\n    \"tool\": \"terminal\",\n    \"args\": {\"command\": \"python3 -m pytest\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 10,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 11,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"def \", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 12,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"def \", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  }\n]\n\nFile v0.1.1:skill-card.md\n\n## Description:\n\nTool Economy helps agents reduce tool-call overhead by batching independent calls, avoiding redundant reads, caching session results, preferring stronger commands, and tracking a tool budget.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[voronindenis5](https://clawhub.ai/user/voronindenis5)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers and agent builders use this skill to guide agents toward fewer, more deliberate tool calls while preserving correctness. It also includes a local analyzer for reviewing session logs and identifying redundant calls or missed batching opportunities.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Caching or avoiding re-reads can leave an agent with stale context during high-impact work.\n\nMitigation: Invalidate cached context after edits or external changes and keep normal verification checks for high-impact workflows.\n\nRisk: A tool-efficiency focus can discourage necessary verification when correctness is more important than latency.\n\nMitigation: Use the skill as optimization guidance, not as a reason to skip tests, targeted rechecks, or human review for risky changes.\n\n## Reference(s):\n\n- [Tool Economy on ClawHub](https://clawhub.ai/voronindenis5/skills/tool-economy)\n- [Server-resolved source repository](https://github.com/voronindenis5/tool-economy)\n- [Publisher profile](https://clawhub.ai/user/voronindenis5)\n- [Batching Independent Tool Calls](references/batching.md)\n- [Tool Budgeting](references/budgeting.md)\n- [Anti-Patterns Catalog](references/antipatterns.md)\n- [Hermes Agent documentation](https://hermes-agent.nousresearch.com/docs)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, code, shell commands]\n\n**Output Format:** [Markdown guidance with inline examples, shell commands, and text analyzer reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes optional JSON session-log input for the local analyzer script.]\n\n## Skill Version(s):\n\n0.1.1 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.1.1:LICENSE\n\nMIT License\n\nCopyright (c) 2026 Denis Voronin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v0.1.0: 12 files, 15752 bytes\n\nFiles: LICENSE (1070b), README.md (2858b), references (0b), references/antipatterns.md (3182b), references/batching.md (2360b), references/budgeting.md (2533b), scripts (0b), scripts/analyze_session.py (14003b), scripts/sample_session.json (1446b), skill-card.md (2074b), SKILL.md (4927b), _meta.json (131b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: tool-economy\ndescription: >\n  Minimize tool call overhead. Every tool call costs tokens and latency.\n  This skill teaches agents to batch independent calls, avoid redundant\n  reads, cache results within a session, prefer single powerful commands\n  over multiple weak ones, and track a 'tool budget'.\nversion: 1.0.0\nauthor: Denis Voronin\nlicense: MIT\ntags:\n  - efficiency\n  - optimization\n  - tool-use\n  - cost\n  - latency\n  - agent\n---\n\n# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\n`Tool Economy` is a discipline for AI agents: treat each tool invocation as a\ncosted operation (tokens + latency) and minimize total overhead while preserving\ncorrectness. The goal is not to avoid tool use — it is to make every call count.\n\n## When to Use\n\nActivate this skill whenever you are:\n\n- About to issue multiple tool calls in a single turn\n- Reading files or data you may have already read this session\n- Considering whether to call a tool at all\n- Planning a multi-step workflow where calls can be parallelized\n- Reviewing your own agent behavior for efficiency\n\n## Core Principles\n\n### 1. Batch Independent Calls\n\nIf two or more tool calls do not depend on each other's output, issue them in the\n**same turn** (parallel). Do not serialize calls that could run concurrently.\n\n**Bad** (3 serial round-trips, 3x latency):\n```\nread_file(A)  -> wait\nread_file(B)  -> wait\nread_file(C)  -> wait\n```\n\n**Good** (1 round-trip, 1x latency):\n```\n[ read_file(A), read_file(B), read_file(C) ]   # one turn\n```\n\nSee `references/batching.md`.\n\n### 2. Avoid Redundant Reads\n\nIf you already read a file this session and it has not changed, **do not read it\nagain**. Track what you have seen. Prefer `session_search` or in-context memory\nover a fresh fetch. If a file was modified by your own action, you already know\nits new state — patch in place, don't re-read.\n\n### 3. Cache Within Session\n\nTreat the current session as a short-lived cache. The first expensive query\n(search, web fetch, build) populates it; subsequent identical needs reuse it.\nThis does not mean stale data — invalidate when the underlying source changes\n(e.g. you edited the file you previously read).\n\n### 4. Prefer One Powerful Command Over Many Weak Ones\n\n- `read_file` over a chain of `cat`, `head`, `tail`\n- `search_files` (content mode) over manual `grep` + `find` + `wc`\n- A single `patch` over `sed` + `awk` + redirect\n- One `web_extract` with 5 URLs over 5 separate fetches\n- `gh repo clone` over manually `git init` + `git remote add` + `git pull`\n\nEach \"weak\" command adds a full round-trip of tokens + latency for a sub-result\nyou could have gotten in one call.\n\n### 5. Track a Tool Budget\n\nBefore a multi-step task, estimate how many calls it *should* take, and compare\nagainst reality during and after. The companion script\n`scripts/analyze_session.py` computes:\n\n- **Total calls** and **redundant calls** (duplicates within a window)\n- **Serializable-but-parallel calls** (independent calls you issued serially)\n- **Estimated overhead**: extra round-trips × per-call latency cost\n- A **tool economy score** from 0 (worst) to 100 (best)\n\nRun it on any session log to see where you leaked budget.\n\n## Quick Reference\n\n| Situation                  | Anti-pattern                  | Economy pattern                          |\n|----------------------------|-------------------------------|------------------------------------------|\n| Need N independent reads   | N serial calls                | 1 batched turn                           |\n| Re-reading a static file   | Fresh `read_file`             | Reuse what's in context                  |\n| Searching then counting    | `grep` + `find` + `wc`        | `search_files(output_mode='count')`      |\n| Editing 3 spots in a file  | 3 terminal `sed` calls        | 1 `patch` (or `replace_all`)             |\n| Fetching 5 pages           | 5 `web_extract` calls         | 1 call, `urls=[...]`                     |\n| Unsure if data changed     | Re-read \"just in case\"        | Check mtime/hash, else reuse cache       |\n\n## How to Apply (Checklist)\n\nBefore issuing a turn's tool calls, ask:\n\n1. **Can these be batched?** If none depend on another's output → yes, combine.\n2. **Have I read this before?** If yes and unchanged → reuse, don't re-fetch.\n3. **Is there a single stronger command?** Replace a chain with one call.\n4. **Is this call necessary at all?** Can the answer be derived from context?\n5. **Am I within budget?** If calls >> estimate, stop and replan.\n\n## Files\n\n- `references/batching.md` — deep dive on parallelizing tool calls\n- `references/budgeting.md` — how to estimate and track a tool budget\n- `references/antipatterns.md` — catalog of wasteful patterns and fixes\n- `scripts/analyze_session.py` — analyze a session log, report efficiency metrics\n- `scripts/sample_session.json` — example input for the analyzer\n\n## License\n\nMIT © Denis Voronin\n\nFile v0.1.0:README.md\n\n# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\nA [Hermes Agent](https://hermes-agent.nousresearch.com/docs) / OpenClaw skill that\nteaches AI agents to **minimize tool-call overhead** — tokens and latency —\nwithout sacrificing correctness.\n\n## Why\n\nEvery tool invocation costs:\n\n- **Tokens** — the call's arguments and its full result travel through context.\n- **Latency** — each call is at least one network/compute round-trip.\n- **Reasoning overhead** — serial calls force extra planning turns between them.\n\nWasteful patterns (re-reading files, serializing independent calls, chaining weak\ncommands) compound quickly. `Tool Economy` gives the agent a discipline and a\nmeasurable score so it can self-correct.\n\n## What's Included\n\n- **`SKILL.md`** — the core skill: principles, checklist, quick-reference table.\n- **`references/`**\n  - `batching.md` — how and when to parallelize independent tool calls.\n  - `budgeting.md` — estimating, tracking, and reconciling a tool budget.\n  - `antipatterns.md` — catalog of 10 wasteful patterns and their fixes.\n- **`scripts/analyze_session.py`** — analyze a session log and report:\n  - total / redundant calls\n  - serializable-but-parallel (missed batching) calls\n  - estimated overhead (extra round-trips × latency)\n  - a **tool economy score** (0–100)\n- **`scripts/sample_session.json`** — example input for the analyzer.\n\n## Quick Start\n\n```bash\n# Analyze a session log\npython3 scripts/analyze_session.py scripts/sample_session.json\n```\n\nExample output:\n\n```\nTool Economy Report\n===================\nTotal tool calls              : 12\nRedundant calls               : 2\nMissed parallel opportunities : 3\nEstimated extra round-trips   : 5\nEstimated overhead            : 1500 ms\nTool economy score            : 58/100  [Fair]\n\nTop waste sources:\n  1. redundant_read        x2   (~600 ms)\n  2. missed_batching       x3   (~900 ms)\n```\n\n## Session Log Format\n\nThe analyzer accepts a JSON array of tool-call records:\n\n```json\n[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  ...\n]\n```\n\nOnly `tool` and `args` are required; `turn` and `calls_in_turn` are used for\nmissed-batching detection (see `scripts/analyze_session.py --help`).\n\n## Installation (Hermes Agent)\n\nCopy or symlink this directory into your skills folder:\n\n```bash\ncp -r tool-economy ~/.hermes/skills/\n```\n\nHermes auto-discovers skills with a valid `SKILL.md`. See the\n[skills docs](https://hermes-agent.nousresearch.com/docs) for details.\n\n## Principles (TL;DR)\n\n1. **Batch** independent calls into one turn.\n2. **Don't re-read** what's already in context.\n3. **Cache** expensive results for the session.\n4. **Prefer one strong command** over a chain of weak ones.\n5. **Track a tool budget** and replan when over.\n\n## License\n\nMIT © Denis Voronin\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn75wwn4x6djaf28jbykeamazd81gtdp\",\n  \"slug\": \"tool-economy\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1785959374527\n}\n\nFile v0.1.0:references/antipatterns.md\n\n# Anti-Patterns Catalog\n\nCommon ways agents waste tool budget, and the economy pattern that replaces each.\n\n---\n\n## AP-1: Serial Cascade of Independent Reads\n\n**Symptom:** Three `read_file` calls in three separate turns.\n\n**Cost:** 2 extra round-trips of latency + 2 extra reasoning passes.\n\n**Fix:** Batch into one turn. See `batching.md`.\n\n---\n\n## AP-2: Re-Reading a Static File\n\n**Symptom:** `read_file(config.yaml)` in turn 3, again in turn 7, with no edit\nin between.\n\n**Cost:** 1 redundant call (tokens + latency) for stale-identical data.\n\n**Fix:** Reuse the content already in context. Re-read only after the file is\nknown to have changed (e.g. you patched it, or an external mtime check differs).\n\n---\n\n## AP-3: Weak Command Chains\n\n**Symptom:**\n```\nterminal(\"grep -rn foo .\")\nterminal(\"grep -rn foo . | wc -l\")\nterminal(\"find . -name '*.py'\")\n```\n\n**Cost:** 3 calls for what one `search_files` call returns.\n\n**Fix:** Use the powerful built-in:\n```\nsearch_files(\"foo\", target=content, output_mode=count)\n```\n\n---\n\n## AP-4: Read-Then-Patch-Then-Read\n\n**Symptom:** Read a file, patch one line, then read the whole file again to\n\"verify.\"\n\n**Cost:** 1 redundant full-file read. The patch result already tells you the new\ncontent.\n\n**Fix:** Trust the patch output (or diff). Re-read only a *specific* region if\nyou must confirm layout, not the whole file.\n\n---\n\n## AP-5: Exploratory Ping-Pong\n\n**Symptom:** Alternating `search_files` → `read_file` → `search_files` →\n`read_file` across many turns without a plan.\n\n**Cost:** Many small calls, high latency, low signal.\n\n**Fix:** Do a single broad search (or a batched set of searches) up front, then\nbatch-read the relevant files, then act. Plan the exploration before executing.\n\n---\n\n## AP-6: Re-Fetching External Data\n\n**Symptom:** `web_extract(url)` called twice for the same URL in one session.\n\n**Cost:** Network latency + tokens for identical content.\n\n**Fix:** Cache the result in context. Re-fetch only if the source is\ntime-sensitive (news, prices, live status) and enough time has passed.\n\n---\n\n## AP-7: Confirm-Then-Do\n\n**Symptom:**\n```\nT1: terminal(\"ls\")           # \"is the file there?\"\nT2: terminal(\"cat file\")     # \"ok read it\"\n```\n\n**Cost:** 1 extra call to confirm something the actual operation would have\nreported anyway.\n\n**Fix:** Just attempt the real operation; handle the error if it fails. Most\ntools return clear errors for missing files/paths.\n\n---\n\n## AP-8: Forgetting `replace_all`\n\n**Symptom:** Five separate `patch` calls to rename one identifier in five spots.\n\n**Cost:** 4 extra calls.\n\n**Fix:** One `patch(..., replace_all=true)` or a single targeted sed via\n`terminal`.\n\n---\n\n## AP-9: Human-Style Click-Through\n\n**Symptom:** Navigating a browser one click at a time when a direct URL or API\ncall would do.\n\n**Cost:** Many slow browser round-trips.\n\n**Fix:** Prefer `web_extract` / direct API / direct URL navigation over\nincremental UI clicks.\n\n---\n\n## AP-10: No Budget, No Awareness\n\n**Symptom:** Agent never estimates or counts calls; \"just keeps going.\"\n\n**Cost:** Unbounded waste; no trigger to replan.\n\n**Fix:** Set a budget (see `budgeting.md`), tally as you go, stop when over.\n\nFile v0.1.0:references/batching.md\n\n# Batching Independent Tool Calls\n\nThe single highest-impact economy technique: **issue independent calls in the\nsame turn.** Most agent runtimes execute independent tool calls concurrently, so\nbatching collapses N round-trips into one.\n\n## What \"Independent\" Means\n\nCall B is *independent* of call A if B does not need A's output to be formed.\nYou can write out all N calls before seeing any result.\n\n| Independent (batch)             | Dependent (serial)                          |\n|---------------------------------|---------------------------------------------|\n| Read 3 unrelated files          | Read file → patch line found in it          |\n| Fetch 5 URLs                    | Search web → extract top result             |\n| Run tests + lint + typecheck    | Read config → run build with that config    |\n| `git status` + `git log` + `git diff` | `git add` → `git commit` → `git push` |\n\n## How to Batch\n\n1. Scan your planned next steps.\n2. Partition into \"rounds\": each round contains calls whose inputs are already\n   known.\n3. Issue each round as a single assistant turn with multiple tool calls.\n\n### Example: Inspecting a Repo Before a Change\n\n**Wasteful (5 serial turns):**\n```\nT1: read_file(package.json)\nT2: read_file(tsconfig.json)\nT3: search_files(\"TODO\", target=content)\nT4: terminal(\"git log --oneline -5\")\nT5: search_files(\"*.test.ts\", target=files)\n```\n\n**Economical (1 turn, 5 parallel calls):**\n```\nT1: [ read_file(package.json),\n      read_file(tsconfig.json),\n      search_files(\"TODO\"),\n      terminal(\"git log --oneline -5\"),\n      search_files(\"*.test.ts\", target=files) ]\n```\n\nSame information, ~5× lower wall-clock latency, same token cost for the calls\nthemselves (but far fewer reasoning tokens between turns).\n\n## Pitfalls\n\n- **False independence:** if call B's *arguments* depend on call A's result, you\n  cannot batch them. Re-check each pair.\n- **Resource contention:** two heavy `terminal` builds may fight for CPU. Stagger\n  if needed, but most read-only calls (file reads, searches, web fetches) are\n  safe to parallelize freely.\n- **Token budget per turn:** batching more calls grows the single response. If a\n  batch would be enormous, split into a few medium rounds rather than one huge\n  turn.\n\n## Rule of Thumb\n\n> If you can write all the calls before any of them returns, they belong in the\n> same turn.\n\nFile v0.1.0:references/budgeting.md\n\n# Tool Budgeting\n\nA *tool budget* is a soft estimate of how many tool calls a task should cost.\nYou set it before starting, compare against it while working, and reconcile at\nthe end.\n\n## Estimating a Budget\n\nBreak the task into sub-goals and count expected calls per sub-goal:\n\n| Sub-goal                  | Typical cost |\n|---------------------------|--------------|\n| Read N files (batched)    | 1 call       |\n| Search codebase           | 1 call       |\n| Edit a file               | 1 call       |\n| Run tests / build         | 1 call       |\n| Create a file             | 1 call       |\n| Verify result             | 1 call       |\n\nAdd them up. That is your budget. Example: \"refactor function X and update tests\"\nmight budget as:\n\n```\nread file(s)      : 1   (batched)\npatch source      : 1\npatch tests       : 1\nrun tests         : 1\nverify            : 1\n--------------------\ntotal             : 5 calls\n```\n\nIf you find yourself at call 8 and not done, **stop and replan** — something is\nwrong (you're re-reading, serializing, or using weak commands).\n\n## Tracking During the Task\n\nKeep a mental or explicit tally:\n\n- **Under budget** → proceed normally.\n- **At budget, not done** → audit for waste before continuing.\n- **Over budget** → stop; run `analyze_session.py` on the log so far, find the\n  leak, then replan the remaining work.\n\n## Reconciling After the Task\n\nRun the analyzer on the full session:\n\n```bash\npython3 scripts/analyze_session.py scripts/sample_session.json\n```\n\nKey metrics:\n\n- **Redundant calls** — exact duplicates within a window (default 10 calls).\n  Each is pure waste.\n- **Serializable-but-parallel** — independent calls issued in separate turns.\n  Each adds ~1 extra round-trip of latency.\n- **Overhead** — estimated extra round-trips × a per-call latency constant\n  (default 300ms, configurable).\n- **Score** — 100 minus penalties, clamped to [0, 100].\n\n### Score Bands\n\n| Score | Meaning                                    |\n|-------|--------------------------------------------|\n| 90+   | Excellent — nearly zero waste              |\n| 70–89 | Good — minor batching/caching gaps         |\n| 50–69 | Fair — several wasteful patterns present   |\n| <50   | Poor — re-architect the workflow           |\n\n## Adjusting the Budget Over Time\n\nKeep a note of *actual* vs *budgeted* calls for recurring task types. If a kind\nof task consistently runs 2× over, either the budget was naive or the workflow\nhas a structural inefficiency. Fix the workflow, not the budget.\n\nFile v0.1.0:scripts/sample_session.json\n\n[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 2,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/utils.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 3,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/config.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 4,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"TODO\", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 5,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 6,\n    \"tool\": \"patch\",\n    \"args\": {\"path\": \"src/main.py\", \"old_string\": \"def old():\", \"new_string\": \"def new():\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 7,\n    \"tool\": \"cat\",\n    \"args\": {\"command\": \"cat src/utils.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 8,\n    \"tool\": \"grep\",\n    \"args\": {\"command\": \"grep -rn import src/\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 9,\n    \"tool\": \"terminal\",\n    \"args\": {\"command\": \"python3 -m pytest\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 10,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 11,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"def \", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  },\n  {\n    \"turn\": 12,\n    \"tool\": \"search_files\",\n    \"args\": {\"pattern\": \"def \", \"target\": \"content\"},\n    \"calls_in_turn\": 1\n  }\n]\n\nFile v0.1.0:skill-card.md\n\n## Description:\n\nMinimize tool call overhead by teaching agents to batch independent calls, avoid redundant reads, cache session results, prefer stronger commands, and track a tool budget.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[voronindenis5](https://clawhub.ai/user/voronindenis5)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers and agent operators use this skill to reduce token and latency overhead in multi-step agent workflows while preserving correctness. It provides checklists, anti-patterns, and an optional session analyzer for evaluating tool-call efficiency.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Agents may over-optimize for fewer tool calls and skip a needed freshness, correctness, or safety check.\n\nMitigation: Require re-checks when information may have changed or when correctness, safety, or user impact depends on verification.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/voronindenis5/skills/tool-economy)\n- [Server-Resolved GitHub Repository](https://github.com/voronindenis5/tool-economy)\n- [Publisher Profile](https://clawhub.ai/user/voronindenis5)\n- [Hermes Agent Documentation](https://hermes-agent.nousresearch.com/docs)\n- [Batching Independent Tool Calls](references/batching.md)\n- [Tool Budgeting](references/budgeting.md)\n- [Anti-Patterns Catalog](references/antipatterns.md)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, markdown, shell commands, code]\n\n**Output Format:** [Markdown guidance with inline shell commands and an optional Python analyzer script]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes optional JSON session-log input for local efficiency analysis.]\n\n## Skill Version(s):\n\n0.1.0 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.1.0:LICENSE\n\nMIT License\n\nCopyright (c) 2026 Denis Voronin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","readmeExcerpt":"Skill: tool-economy Owner: voronindenis5 Summary: Minimize tool call overhead. Every tool call costs tokens and latency. This skill teaches agents to batch independent calls, avoid redundant reads, cache results within a session, prefer single powerful commands over multiple weak ones, and track a 'tool budget'. Tags: latest:0.1.1 Version history: v0.1.1 | 2026-08-11T11:58:47.623Z | auto - Removed the file: skill-car","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"read_file(A)  -> wait\nread_file(B)  -> wait\nread_file(C)  -> wait"},{"language":"text","snippet":"[ read_file(A), read_file(B), read_file(C) ]   # one turn"},{"language":"bash","snippet":"# Analyze a session log\npython3 scripts/analyze_session.py scripts/sample_session.json"},{"language":"text","snippet":"Tool Economy Report\n===================\nTotal tool calls              : 12\nRedundant calls               : 2\nMissed parallel opportunities : 3\nEstimated extra round-trips   : 5\nEstimated overhead            : 1500 ms\nTool economy score            : 58/100  [Fair]\n\nTop waste sources:\n  1. redundant_read        x2   (~600 ms)\n  2. missed_batching       x3   (~900 ms)"},{"language":"json","snippet":"[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  ...\n]"},{"language":"bash","snippet":"cp -r tool-economy ~/.hermes/skills/"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: tool-economy\ndescription: >\n  Minimize tool call overhead. Every tool call costs tokens and latency.\n  This skill teaches agents to batch independent calls, avoid redundant\n  reads, cache results within a session, prefer single powerful commands\n  over multiple weak ones, and track a 'tool budget'.\nversion: 1.0.0\nauthor: Denis Voronin\nlicense: MIT\ntags:\n  - efficiency\n  - optimization\n  - tool-use\n  - cost\n  - latency\n  - agent\n---\n\n# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\n`Tool Economy` is a discipline for AI agents: treat each tool invocation as a\ncosted operation (tokens + latency) and minimize total overhead while preserving\ncorrectness. The goal is not to avoid tool use — it is to make every call count.\n\n## When to Use\n\nActivate this skill whenever you are:\n\n- About to issue multiple tool calls in a single turn\n- Reading files or data you may have already read this session\n- Considering whether to call a tool at all\n- Planning a multi-step workflow where calls can be parallelized\n- Reviewing your own agent behavior for efficiency\n\n## Core Principles\n\n### 1. Batch Independent Calls\n\nIf two or more tool calls do not depend on each other's output, issue them in the\n**same turn** (parallel). Do not serialize calls that could run concurrently.\n\n**Bad** (3 serial round-trips, 3x latency):\n```\nread_file(A)  -> wait\nread_file(B)  -> wait\nread_file(C)  -> wait\n```\n\n**Good** (1 round-trip, 1x latency):\n```\n[ read_file(A), read_file(B), read_file(C) ]   # one turn\n```\n\nSee `references/batching.md`.\n\n### 2. Avoid Redundant Reads\n\nIf you already read a file this session and it has not changed, **do not read it\nagain**. Track what you have seen. Prefer `session_search` or in-context memory\nover a fresh fetch. If a file was modified by your own action, you already know\nits new state — patch in place, don't re-read.\n\n### 3. Cache Within Session\n\nTreat the current session as a short-lived cache. The first expensive query\n(search, web fetch, build) populates it; subsequent identical needs reuse it.\nThis does not mean stale data — invalidate when the underlying source changes\n(e.g. you edited the file you previously read).\n\n### 4. Prefer One Powerful Command Over Many Weak Ones\n\n- `read_file` over a chain of `cat`, `head`, `tail`\n- `search_files` (content mode) over manual `grep` + `find` + `wc`\n- A single `patch` over `sed` + `awk` + redirect\n- One `web_extract` with 5 URLs over 5 separate fetches\n- `gh repo clone` over manually `git init` + `git remote add` + `git pull`\n\nEach \"weak\" command adds a full round-trip of tokens + latency for a sub-result\nyou could have gotten in one call.\n\n### 5. Track a Tool Budget\n\nBefore a multi-step task, estimate how many calls it *should* take, and compare\nagainst reality during and after. The companion script\n`scripts/analyze_session.py` computes:\n\n- **Total calls** and **redundant calls** (duplicates within a window)\n- **Serializable-but-parallel calls** (independent calls you issued seria"},{"path":"README.md","content":"# Tool Economy\n\n> Every tool call is an expense. Spend wisely.\n\nA [Hermes Agent](https://hermes-agent.nousresearch.com/docs) / OpenClaw skill that\nteaches AI agents to **minimize tool-call overhead** — tokens and latency —\nwithout sacrificing correctness.\n\n## Why\n\nEvery tool invocation costs:\n\n- **Tokens** — the call's arguments and its full result travel through context.\n- **Latency** — each call is at least one network/compute round-trip.\n- **Reasoning overhead** — serial calls force extra planning turns between them.\n\nWasteful patterns (re-reading files, serializing independent calls, chaining weak\ncommands) compound quickly. `Tool Economy` gives the agent a discipline and a\nmeasurable score so it can self-correct.\n\n## What's Included\n\n- **`SKILL.md`** — the core skill: principles, checklist, quick-reference table.\n- **`references/`**\n  - `batching.md` — how and when to parallelize independent tool calls.\n  - `budgeting.md` — estimating, tracking, and reconciling a tool budget.\n  - `antipatterns.md` — catalog of 10 wasteful patterns and their fixes.\n- **`scripts/analyze_session.py`** — analyze a session log and report:\n  - total / redundant calls\n  - serializable-but-parallel (missed batching) calls\n  - estimated overhead (extra round-trips × latency)\n  - a **tool economy score** (0–100)\n- **`scripts/sample_session.json`** — example input for the analyzer.\n\n## Quick Start\n\n```bash\n# Analyze a session log\npython3 scripts/analyze_session.py scripts/sample_session.json\n```\n\nExample output:\n\n```\nTool Economy Report\n===================\nTotal tool calls              : 12\nRedundant calls               : 2\nMissed parallel opportunities : 3\nEstimated extra round-trips   : 5\nEstimated overhead            : 1500 ms\nTool economy score            : 58/100  [Fair]\n\nTop waste sources:\n  1. redundant_read        x2   (~600 ms)\n  2. missed_batching       x3   (~900 ms)\n```\n\n## Session Log Format\n\nThe analyzer accepts a JSON array of tool-call records:\n\n```json\n[\n  {\n    \"turn\": 1,\n    \"tool\": \"read_file\",\n    \"args\": {\"path\": \"src/main.py\"},\n    \"calls_in_turn\": 1\n  },\n  ...\n]\n```\n\nOnly `tool` and `args` are required; `turn` and `calls_in_turn` are used for\nmissed-batching detection (see `scripts/analyze_session.py --help`).\n\n## Installation (Hermes Agent)\n\nCopy or symlink this directory into your skills folder:\n\n```bash\ncp -r tool-economy ~/.hermes/skills/\n```\n\nHermes auto-discovers skills with a valid `SKILL.md`. See the\n[skills docs](https://hermes-agent.nousresearch.com/docs) for details.\n\n## Principles (TL;DR)\n\n1. **Batch** independent calls into one turn.\n2. **Don't re-read** what's already in context.\n3. **Cache** expensive results for the session.\n4. **Prefer one strong command** over a chain of weak ones.\n5. **Track a tool budget** and replan when over.\n\n## License\n\nMIT © Denis Voronin"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75wwn4x6djaf28jbykeamazd81gtdp\",\n  \"slug\": \"tool-economy\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1786449527623\n}"},{"path":"references/antipatterns.md","content":"# Anti-Patterns Catalog\n\nCommon ways agents waste tool budget, and the economy pattern that replaces each.\n\n---\n\n## AP-1: Serial Cascade of Independent Reads\n\n**Symptom:** Three `read_file` calls in three separate turns.\n\n**Cost:** 2 extra round-trips of latency + 2 extra reasoning passes.\n\n**Fix:** Batch into one turn. See `batching.md`.\n\n---\n\n## AP-2: Re-Reading a Static File\n\n**Symptom:** `read_file(config.yaml)` in turn 3, again in turn 7, with no edit\nin between.\n\n**Cost:** 1 redundant call (tokens + latency) for stale-identical data.\n\n**Fix:** Reuse the content already in context. Re-read only after the file is\nknown to have changed (e.g. you patched it, or an external mtime check differs).\n\n---\n\n## AP-3: Weak Command Chains\n\n**Symptom:**\n```\nterminal(\"grep -rn foo .\")\nterminal(\"grep -rn foo . | wc -l\")\nterminal(\"find . -name '*.py'\")\n```\n\n**Cost:** 3 calls for what one `search_files` call returns.\n\n**Fix:** Use the powerful built-in:\n```\nsearch_files(\"foo\", target=content, output_mode=count)\n```\n\n---\n\n## AP-4: Read-Then-Patch-Then-Read\n\n**Symptom:** Read a file, patch one line, then read the whole file again to\n\"verify.\"\n\n**Cost:** 1 redundant full-file read. The patch result already tells you the new\ncontent.\n\n**Fix:** Trust the patch output (or diff). Re-read only a *specific* region if\nyou must confirm layout, not the whole file.\n\n---\n\n## AP-5: Exploratory Ping-Pong\n\n**Symptom:** Alternating `search_files` → `read_file` → `search_files` →\n`read_file` across many turns without a plan.\n\n**Cost:** Many small calls, high latency, low signal.\n\n**Fix:** Do a single broad search (or a batched set of searches) up front, then\nbatch-read the relevant files, then act. Plan the exploration before executing.\n\n---\n\n## AP-6: Re-Fetching External Data\n\n**Symptom:** `web_extract(url)` called twice for the same URL in one session.\n\n**Cost:** Network latency + tokens for identical content.\n\n**Fix:** Cache the result in context. Re-fetch only if the source is\ntime-sensitive (news, prices, live status) and enough time has passed.\n\n---\n\n## AP-7: Confirm-Then-Do\n\n**Symptom:**\n```\nT1: terminal(\"ls\")           # \"is the file there?\"\nT2: terminal(\"cat file\")     # \"ok read it\"\n```\n\n**Cost:** 1 extra call to confirm something the actual operation would have\nreported anyway.\n\n**Fix:** Just attempt the real operation; handle the error if it fails. Most\ntools return clear errors for missing files/paths.\n\n---\n\n## AP-8: Forgetting `replace_all`\n\n**Symptom:** Five separate `patch` calls to rename one identifier in five spots.\n\n**Cost:** 4 extra calls.\n\n**Fix:** One `patch(..., replace_all=true)` or a single targeted sed via\n`terminal`.\n\n---\n\n## AP-9: Human-Style Click-Through\n\n**Symptom:** Navigating a browser one click at a time when a direct URL or API\ncall would do.\n\n**Cost:** Many slow browser round-trips.\n\n**Fix:** Prefer `web_extract` / direct API / direct URL navigation over\nincremental UI clicks.\n\n---\n\n## AP-10: No Budget, No Awareness\n\n**Symptom:** Agent never"},{"path":"references/batching.md","content":"# Batching Independent Tool Calls\n\nThe single highest-impact economy technique: **issue independent calls in the\nsame turn.** Most agent runtimes execute independent tool calls concurrently, so\nbatching collapses N round-trips into one.\n\n## What \"Independent\" Means\n\nCall B is *independent* of call A if B does not need A's output to be formed.\nYou can write out all N calls before seeing any result.\n\n| Independent (batch)             | Dependent (serial)                          |\n|---------------------------------|---------------------------------------------|\n| Read 3 unrelated files          | Read file → patch line found in it          |\n| Fetch 5 URLs                    | Search web → extract top result             |\n| Run tests + lint + typecheck    | Read config → run build with that config    |\n| `git status` + `git log` + `git diff` | `git add` → `git commit` → `git push` |\n\n## How to Batch\n\n1. Scan your planned next steps.\n2. Partition into \"rounds\": each round contains calls whose inputs are already\n   known.\n3. Issue each round as a single assistant turn with multiple tool calls.\n\n### Example: Inspecting a Repo Before a Change\n\n**Wasteful (5 serial turns):**\n```\nT1: read_file(package.json)\nT2: read_file(tsconfig.json)\nT3: search_files(\"TODO\", target=content)\nT4: terminal(\"git log --oneline -5\")\nT5: search_files(\"*.test.ts\", target=files)\n```\n\n**Economical (1 turn, 5 parallel calls):**\n```\nT1: [ read_file(package.json),\n      read_file(tsconfig.json),\n      search_files(\"TODO\"),\n      terminal(\"git log --oneline -5\"),\n      search_files(\"*.test.ts\", target=files) ]\n```\n\nSame information, ~5× lower wall-clock latency, same token cost for the calls\nthemselves (but far fewer reasoning tokens between turns).\n\n## Pitfalls\n\n- **False independence:** if call B's *arguments* depend on call A's result, you\n  cannot batch them. Re-check each pair.\n- **Resource contention:** two heavy `terminal` builds may fight for CPU. Stagger\n  if needed, but most read-only calls (file reads, searches, web fetches) are\n  safe to parallelize freely.\n- **Token budget per turn:** batching more calls grows the single response. If a\n  batch would be enormous, split into a few medium rounds rather than one huge\n  turn.\n\n## Rule of Thumb\n\n> If you can write all the calls before any of them returns, they belong in the\n> same turn."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1853,"uniquenessScore":42,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T14:13:07.346Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T02:45:18.799Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}