{"id":"30552a4c-d1b2-4d68-86e7-ea44d08efcdd","entityType":"agent","slug":"clawhub-raydatalab-tokensave","name":"Tokensave Publish","canonicalUrl":"https://www.xpersona.co/agent/clawhub-raydatalab-tokensave","canonicalPath":"/agent/clawhub-raydatalab-tokensave","generatedAt":"2026-10-11T08:41:45.204Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:52:05.536Z","emptyReason":null},"description":"Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s179gmr84mj3szjyrksyq2zv058a61mt:tokensave","sourceUrl":"https://clawhub.ai/raydatalab/tokensave","homepage":"https://clawhub.ai/raydatalab/skills/tokensave","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/raydatalab/tokensave","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/raydatalab/skills/tokensave","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Tokensave Publish 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-11T05:52:05.536Z","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-11T05:52:05.536Z","emptyReason":null},"stars":null,"forks":null,"downloads":1141,"packageName":null,"latestVersion":"0.4.5","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:52:05.469Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T05:52:05.536Z","lastCrawledAt":"2026-10-11T05:52:05.469Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T05:52:05.469Z","lastVerifiedAt":null,"highlights":[{"version":"0.4.5","createdAt":"2026-07-11T10:18:01.087Z","changelog":"tokensave 0.4.5 - Tightened usage policy: analysis now runs only when the user explicitly requests it (e.g., \"run tokensave\", \"analyze my session\"). - Updated trigger phrases to require specific, intentional analysis commands. - Added clear guidance not to auto-analyze for general cost complaints or without user confirmation. - Updated documentation to clarify boundaries between analyze mode (local, no network) and pipeline mode (requires API key, makes network calls). - Removed the sample skill-card.md file.","fileCount":3,"zipByteSize":4466},{"version":"0.4.4","createdAt":"2026-07-11T01:43:42.552Z","changelog":"- Refreshed example outputs and statistics in documentation to better reflect real test data. - Updated session analysis descriptions to clarify typical waste and savings, improving clarity for users. - Enhanced overview with a new, more concise example session report format. - No code or functionality changes; documentation only.","fileCount":3,"zipByteSize":4106},{"version":"0.4.3","createdAt":"2026-07-11T01:40:04.179Z","changelog":"- Improved overview with a real test case example and detailed sample output. - Clarified that reported data comes from actual test fixtures (not synthetic). - Enhanced readability and conciseness in the introduction. - No code or logic changes; documentation update only.","fileCount":3,"zipByteSize":3995},{"version":"0.4.2","createdAt":"2026-07-11T01:36:09.882Z","changelog":"- Expanded trigger list for improved detection of cost-related queries. - Enhanced documentation with a new \"Common Pitfalls\" section to clarify troubleshooting and usage. - Streamlined SKILL.md overview and structure for better readability; duplicated introductory content was condensed. - Removed the obsolete skill-card.md file.","fileCount":3,"zipByteSize":3826},{"version":"0.4.1-1","createdAt":"2026-07-11T00:42:03.899Z","changelog":"- Expanded trigger phrases to cover more ways users ask about cost and spending (e.g., \"reduce cost\", \"api spending\", \"how much did this cost\", \"lower my bill\"). - Removed the sample skill-card.md file.","fileCount":3,"zipByteSize":3392},{"version":"0.4.1","createdAt":"2026-07-11T00:24:09.509Z","changelog":"Expanded session source support and improved waste detector info. - Analyze now auto-detects the latest session from the main SQLite database (`~/.hermes/state.db`), with new options to target specific sessions, files, or directories. - Added command examples for targeted analysis and custom detector selection. - Now lists and explains the four waste detectors (duplicate tool calls, context bloat, model mismatch, heartbeat waste) in a new detection guide. - Documents both supported data sources (SQLite and JSON), describing their function and auto-detect fallback. - Updated requirements: Python 3.10+ is now specified.","fileCount":3,"zipByteSize":3447},{"version":"0.4.0-1","createdAt":"2026-07-11T00:22:15.483Z","changelog":"Expanded data source and detector documentation, and clarified usage instructions: - \"How it works\" now reflects automatic session detection via `state.db`, with examples for advanced usage. - Added a new \"What It Detects\" section detailing the four waste detectors. - Added a \"Data Sources\" section explaining where and how sessions are read (SQLite and JSON). - Requirements updated for Python 3.10+. - Minor clarifications and structure improvements throughout for easier onboarding.","fileCount":3,"zipByteSize":3376},{"version":"0.4.0","createdAt":"2026-07-11T00:15:15.335Z","changelog":"- Adds detailed analysis of Hermes agent's token waste, including identification of duplicate tool calls, context bloat, model mismatch, and heartbeat waste. - Provides ready-to-use, one-click fix prompts for reducing unnecessary token usage. - Operates 100% locally with zero configuration required. - Expands trigger phrases to cover both English and Chinese cost/waste questions. - Introduces a bonus \"pipeline mode\" for transparent, automatic token savings as an OpenAI wrapper.","fileCount":3,"zipByteSize":2732}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s179gmr84mj3szjyrksyq2zv058a61mt:tokensave","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s179gmr84mj3szjyrksyq2zv058a61mt:tokensave` 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/raydatalab/tokensave 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-raydatalab-tokensave/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/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-11T08:41:45.203Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-raydatalab-tokensave/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-11T05:52:05.536Z","emptyReason":null},"readme":"Skill: Tokensave Publish\n\nOwner: raydatalab\n\nSummary: Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste...\n\nTags: latest:0.4.5\n\nVersion history:\n\nv0.4.5 | 2026-07-11T10:18:01.087Z | auto\n\ntokensave 0.4.5\n\n- Tightened usage policy: analysis now runs only when the user explicitly requests it (e.g., \"run tokensave\", \"analyze my session\").\n- Updated trigger phrases to require specific, intentional analysis commands.\n- Added clear guidance not to auto-analyze for general cost complaints or without user confirmation.\n- Updated documentation to clarify boundaries between analyze mode (local, no network) and pipeline mode (requires API key, makes network calls).\n- Removed the sample skill-card.md file.\n\nv0.4.4 | 2026-07-11T01:43:42.552Z | auto\n\n- Refreshed example outputs and statistics in documentation to better reflect real test data.\n- Updated session analysis descriptions to clarify typical waste and savings, improving clarity for users.\n- Enhanced overview with a new, more concise example session report format.\n- No code or functionality changes; documentation only.\n\nv0.4.3 | 2026-07-11T01:40:04.179Z | auto\n\n- Improved overview with a real test case example and detailed sample output.\n- Clarified that reported data comes from actual test fixtures (not synthetic).\n- Enhanced readability and conciseness in the introduction.\n- No code or logic changes; documentation update only.\n\nv0.4.2 | 2026-07-11T01:36:09.882Z | auto\n\n- Expanded trigger list for improved detection of cost-related queries.\n- Enhanced documentation with a new \"Common Pitfalls\" section to clarify troubleshooting and usage.\n- Streamlined SKILL.md overview and structure for better readability; duplicated introductory content was condensed.\n- Removed the obsolete skill-card.md file.\n\nv0.4.1-1 | 2026-07-11T00:42:03.899Z | auto\n\n- Expanded trigger phrases to cover more ways users ask about cost and spending (e.g., \"reduce cost\", \"api spending\", \"how much did this cost\", \"lower my bill\").\n- Removed the sample skill-card.md file.\n\nv0.4.1 | 2026-07-11T00:24:09.509Z | auto\n\nExpanded session source support and improved waste detector info.\n\n- Analyze now auto-detects the latest session from the main SQLite database (`~/.hermes/state.db`), with new options to target specific sessions, files, or directories.\n- Added command examples for targeted analysis and custom detector selection.\n- Now lists and explains the four waste detectors (duplicate tool calls, context bloat, model mismatch, heartbeat waste) in a new detection guide.\n- Documents both supported data sources (SQLite and JSON), describing their function and auto-detect fallback.\n- Updated requirements: Python 3.10+ is now specified.\n\nv0.4.0-1 | 2026-07-11T00:22:15.483Z | auto\n\nExpanded data source and detector documentation, and clarified usage instructions:\n\n- \"How it works\" now reflects automatic session detection via `state.db`, with examples for advanced usage.\n- Added a new \"What It Detects\" section detailing the four waste detectors.\n- Added a \"Data Sources\" section explaining where and how sessions are read (SQLite and JSON).\n- Requirements updated for Python 3.10+.\n- Minor clarifications and structure improvements throughout for easier onboarding.\n\nv0.4.0 | 2026-07-11T00:15:15.335Z | auto\n\n- Adds detailed analysis of Hermes agent's token waste, including identification of duplicate tool calls, context bloat, model mismatch, and heartbeat waste.\n- Provides ready-to-use, one-click fix prompts for reducing unnecessary token usage.\n- Operates 100% locally with zero configuration required.\n- Expands trigger phrases to cover both English and Chinese cost/waste questions.\n- Introduces a bonus \"pipeline mode\" for transparent, automatic token savings as an OpenAI wrapper.\n\nArchive index:\n\nArchive v0.4.5: 3 files, 4466 bytes\n\nFiles: skill-card.md (2493b), SKILL.md (6436b), _meta.json (128b)\n\nFile v0.4.5:SKILL.md\n\n---\nname: tokensave\ndescription: Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. Analyze mode is 100% local, zero config.\nversion: 0.4.5\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - tokensave\n  - run tokensave\n  - analyze token waste\n  - analyze my session\n  - check token waste\n  - audit my tokens\n  - session cost analysis\n  - how much did this session cost\n  - analyze token usage\n  - optimize token cost\n  - reduce token cost\n  - model cost analysis\n  - duplicate tool calls\n  - context bloat\n  - token budget analysis\n  - analyze api spending\n  - analyze cost\n  - audit tokens\n  - token waste\n  - where is my money going\n  - cost breakdown\n  - estimate cost\n  - api fees\n  - check waste\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\n## Overview\n\n```bash\n$ tokensave analyze\n\nSession 20260711_a1b2c3: 12,000 tokens, ~$0.05, 44% avoidable.\n\nTop wastes:\n  1. duplicate_tool_calls (5x): ~3,000 tokens — read_file called 5x with same path\n  2. context_bloat (1x): ~1,800 tokens — 40% of input is stale context\n  3. model_mismatch (3x): ~500 tokens — simple queries routed through pro\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\"\n```\n\nOne session. 12K tokens. 44% could have been avoided — that's 5,300 tokens\nsaved with a single paste. Run after every session, bills drop immediately.\n\nAll numbers above are from `tests/test_analyzer.py` real test fixtures.\n12,000 input + output tokens, captured waste across all 4 detectors.\nNo made-up data.\n\n## When to Use\n\n- User explicitly asks to \"run tokensave\", \"analyze my session\", or similar\n- User provides a specific session ID or file path to analyze\n- User asks \"how much did this session cost\" with clear intent to run analysis\n- User mentions specific waste patterns like \"duplicate tool calls\" or \"context bloat\"\n\n## When NOT to Use — Read This First\n\n- Do NOT auto-analyze on general cost complaints (\"this is expensive\", \"save money\", \"too expensive\")\n- Do NOT read session data (~/.hermes/state.db) without explicit user confirmation\n- For general billing questions, explain that TokenSave can analyze a specific session\n  but wait for an explicit command like `tokensave analyze <session_id>`\n- Always prefer `tokensave analyze <session_id>` over auto-detecting the latest session\n  when the user has not explicitly asked for it\n\n## How It Works\n\nWhen the user has explicitly asked to run an analysis, use:\n\n```bash\ntokensave analyze\n```\n\nIf the user has provided a specific session ID or path, use that instead:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nAlways confirm with the user before analyzing if they haven't provided a\nspecific session target. Auto-detect only when the user has explicitly\nasked for their \"latest session\" or \"current session.\"\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Analyze mode: nothing else — no API keys, no network, no config\n- Pipeline mode (separate): requires `OPENAI_API_KEY` and makes API calls\n\n## Pipeline Mode (Bonus — Requires Network)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. **This mode requires an API key and makes network calls to\nyour configured API endpoint.** If the user has installed it with\n`from tokensave import OpenAI`, their API calls go through normalize → cache\n→ compress. But that's automatic — you don't need to do anything.\n\nThis mode is separate from `tokensave analyze`. The analyze command never\nmakes network calls; it only reads local session data.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\n## Common Pitfalls\n\n1. **No session data found.** If `tokensave analyze` returns no results, the session\n   may not have been written to `state.db` yet. Hermes writes state.db on session end —\n   try again after `/new`.\n2. **JSON fallback gives incomplete analysis.** JSON error dumps lack full metadata.\n   Always prefer SQLite mode (default). If you're seeing JSON fallback, the state.db\n   may be locked by another Hermes process.\n3. **Duplicate detection is generous.** Near-duplicate detection uses fuzzy matching\n   and may flag legitimate re-reads. Use the report as a starting point, not a verdict.\n4. **Pipeline mode doesn't work with all providers.** The transparent wrapper only\n   supports OpenAI-compatible APIs. Non-OpenAI providers will fall through to direct\n   calls.\n\nFile v0.4.5:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.5\",\n  \"publishedAt\": 1783765081087\n}\n\nFile v0.4.5:skill-card.md\n\n## Description:\n\nTokenSave analyzes explicitly requested session token waste and API cost issues, including duplicate tool calls, context bloat, model mismatch, and heartbeat waste, with a local zero-config analyze mode.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[raydatalab](https://clawhub.ai/user/raydatalab)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent users use this skill after an explicit request to run TokenSave against a specific local session or request dump. The skill returns a token waste and cost report with guidance the user can give to an agent to reduce avoidable spend.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Analyze mode reads local session transcripts and request dumps.\n\nMitigation: Run it only after an explicit user request and prefer a specific session ID, file, or directory target over auto-detection.\n\nRisk: The tool is installed from an unpinned external Python package.\n\nMitigation: Install it in an isolated Python environment and verify the tokensave package source and version before use.\n\nRisk: Pipeline mode can process API requests and requires an API key plus network access.\n\nMitigation: Treat pipeline mode separately from local analysis and enable it only with deliberate API-key and network configuration.\n\nRisk: Waste findings such as near-duplicate detection may include false positives.\n\nMitigation: Use the report as diagnostic guidance and review suggested changes before applying them to agent behavior.\n\n## Reference(s):\n\n- [TokenSave GitHub Homepage](https://github.com/raydatalab/tokensave)\n- [ClawHub Skill Page](https://clawhub.ai/raydatalab/skills/tokensave)\n- [ClawHub Publisher Profile](https://clawhub.ai/user/raydatalab)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown response with pasted CLI report output and concise remediation guidance.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Analyze mode uses local session data; pipeline mode is separate and may require an API key and network access.]\n\n## Skill Version(s):\n\n0.4.5 (source: server release evidence and frontmatter)\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\nArchive v0.4.4: 3 files, 4106 bytes\n\nFiles: skill-card.md (2184b), SKILL.md (5312b), _meta.json (128b)\n\nFile v0.4.4:SKILL.md\n\n---\nname: tokensave\ndescription: Use when analyzing token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.4\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\n  - reduce cost\n  - cut cost\n  - api spending\n  - token budget\n  - expensive model\n  - how much did this cost\n  - estimate cost\n  - cost breakdown\n  - where is my money going\n  - agent spending\n  - api fees\n  - lower my bill\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\n## Overview\n\n```bash\n$ tokensave analyze\n\nSession 20260711_a1b2c3: 12,000 tokens, ~$0.05, 44% avoidable.\n\nTop wastes:\n  1. duplicate_tool_calls (5x): ~3,000 tokens — read_file called 5x with same path\n  2. context_bloat (1x): ~1,800 tokens — 40% of input is stale context\n  3. model_mismatch (3x): ~500 tokens — simple queries routed through pro\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\"\n```\n\nOne session. 12K tokens. 44% could have been avoided — that's 5,300 tokens\nsaved with a single paste. Run after every session, bills drop immediately.\n\nAll numbers above are from `tests/test_analyzer.py` real test fixtures.\n12,000 input + output tokens, captured waste across all 4 detectors.\nNo made-up data.\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\n## Common Pitfalls\n\n1. **No session data found.** If `tokensave analyze` returns no results, the session\n   may not have been written to `state.db` yet. Hermes writes state.db on session end —\n   try again after `/new`.\n2. **JSON fallback gives incomplete analysis.** JSON error dumps lack full metadata.\n   Always prefer SQLite mode (default). If you're seeing JSON fallback, the state.db\n   may be locked by another Hermes process.\n3. **Duplicate detection is generous.** Near-duplicate detection uses fuzzy matching\n   and may flag legitimate re-reads. Use the report as a starting point, not a verdict.\n4. **Pipeline mode doesn't work with all providers.** The transparent wrapper only\n   supports OpenAI-compatible APIs. Non-OpenAI providers will fall through to direct\n   calls.\n\nFile v0.4.4:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.4\",\n  \"publishedAt\": 1783734222552\n}\n\nFile v0.4.4:skill-card.md\n\n## Description: <br>\nTokenSave helps agents analyze token waste, costs, and API bills by identifying duplicate tool calls, context bloat, model mismatch, and heartbeat waste locally. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal developers and agents use TokenSave after cost, billing, or token-usage questions to inspect local Hermes session data, identify avoidable token waste, and produce a concise savings report with suggested fixes. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can inspect recent local Hermes session stores and may automatically select the latest session for broad cost-related prompts. <br>\nMitigation: Confirm the user wants local session analysis and prefer an explicit session ID or file path, such as `tokensave analyze <session_id>` or `tokensave analyze <file.json>`. <br>\nRisk: The separate pipeline/OpenAI wrapper mode can affect live API traffic if enabled. <br>\nMitigation: Review the Python package and test wrapper behavior outside production traffic before using pipeline mode. <br>\n\n\n## Reference(s): <br>\n- [TokenSave homepage](https://github.com/raydatalab/tokensave) <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Text, Markdown, Guidance] <br>\n**Output Format:** [Markdown with inline shell commands and copied CLI reports] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Analyzes local Hermes SQLite or JSON session data and returns token/cost waste findings plus suggested prompt or workflow changes.] <br>\n\n## Skill Version(s): <br>\n0.4.4 (source: server release metadata and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.3: 3 files, 3995 bytes\n\nFiles: skill-card.md (2166b), SKILL.md (5124b), _meta.json (128b)\n\nFile v0.4.3:SKILL.md\n\n---\nname: tokensave\ndescription: Use when analyzing token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.3\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\n  - reduce cost\n  - cut cost\n  - api spending\n  - token budget\n  - expensive model\n  - how much did this cost\n  - estimate cost\n  - cost breakdown\n  - where is my money going\n  - agent spending\n  - api fees\n  - lower my bill\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\n## Overview\n\n```\n$ tokensave analyze\n\nSession test_123: 12,000 tokens, ~$0.05, 25% avoidable\n\n  #1 duplicate_tool_calls (5x): 3,000 tokens\n      read_file called 5x with same path\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\"\n```\n\ntokensave scans your session → finds the waste → gives you the exact\nprompt to stop it. One command. Paste the output. Bills go down.\n\nThe 25% above comes from real test fixtures: 12,000 tokens, 3,000 wasted\non duplicate reads. All numbers are from `tests/test_analyzer.py`. No made-up data.\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\n## Common Pitfalls\n\n1. **No session data found.** If `tokensave analyze` returns no results, the session\n   may not have been written to `state.db` yet. Hermes writes state.db on session end —\n   try again after `/new`.\n2. **JSON fallback gives incomplete analysis.** JSON error dumps lack full metadata.\n   Always prefer SQLite mode (default). If you're seeing JSON fallback, the state.db\n   may be locked by another Hermes process.\n3. **Duplicate detection is generous.** Near-duplicate detection uses fuzzy matching\n   and may flag legitimate re-reads. Use the report as a starting point, not a verdict.\n4. **Pipeline mode doesn't work with all providers.** The transparent wrapper only\n   supports OpenAI-compatible APIs. Non-OpenAI providers will fall through to direct\n   calls.\n\nFile v0.4.3:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.3\",\n  \"publishedAt\": 1783734004179\n}\n\nFile v0.4.3:skill-card.md\n\n## Description: <br>\nUse when analyzing token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to inspect Hermes session costs, identify avoidable token waste, and produce a concrete prompt or command guidance that helps reduce future spending. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can read local Hermes session history, including transcripts and metadata. <br>\nMitigation: Run it only on intended local sessions or files, and review the generated report before sharing output. <br>\nRisk: The advertised OpenAI wrapper mode transforms and caches requests. <br>\nMitigation: Avoid wrapper mode unless request transformation and caching behavior are understood and acceptable. <br>\nRisk: Near-duplicate detection may flag legitimate repeated reads. <br>\nMitigation: Treat findings as diagnostic guidance and verify high-impact recommendations before changing workflows. <br>\n\n\n## Reference(s): <br>\n- [TokenSave homepage](https://github.com/raydatalab/tokensave) <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and analysis summaries] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include local session cost summaries, waste categories, and prompt text to paste back to an agent.] <br>\n\n## Skill Version(s): <br>\n0.4.3 (source: server release metadata and frontmatter) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.2: 3 files, 3826 bytes\n\nFiles: skill-card.md (2057b), SKILL.md (4820b), _meta.json (128b)\n\nFile v0.4.2:SKILL.md\n\n---\nname: tokensave\ndescription: Use when analyzing token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.2\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\n  - reduce cost\n  - cut cost\n  - api spending\n  - token budget\n  - expensive model\n  - how much did this cost\n  - estimate cost\n  - cost breakdown\n  - where is my money going\n  - agent spending\n  - api fees\n  - lower my bill\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\n## Overview\n\nEvery day your agent wastes tokens — re-reading the same files, running on\npro when flash would do, keeping stale context around. TokenSave analyzes\nyour session and tells you exactly where the waste is, how much it costs,\nand gives you a ready-to-paste prompt to fix it.\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\n## Common Pitfalls\n\n1. **No session data found.** If `tokensave analyze` returns no results, the session\n   may not have been written to `state.db` yet. Hermes writes state.db on session end —\n   try again after `/new`.\n2. **JSON fallback gives incomplete analysis.** JSON error dumps lack full metadata.\n   Always prefer SQLite mode (default). If you're seeing JSON fallback, the state.db\n   may be locked by another Hermes process.\n3. **Duplicate detection is generous.** Near-duplicate detection uses fuzzy matching\n   and may flag legitimate re-reads. Use the report as a starting point, not a verdict.\n4. **Pipeline mode doesn't work with all providers.** The transparent wrapper only\n   supports OpenAI-compatible APIs. Non-OpenAI providers will fall through to direct\n   calls.\n\nFile v0.4.2:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.2\",\n  \"publishedAt\": 1783733769882\n}\n\nFile v0.4.2:skill-card.md\n\n## Description: <br>\nTokenSave analyzes local Hermes sessions for token waste, API cost drivers, duplicate tool calls, context bloat, model mismatch, and heartbeat waste. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use TokenSave to inspect local Hermes session data or JSON dumps, estimate token spend, identify avoidable waste, and generate a fix prompt for reducing future cost. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Broad cost-related triggers may cause the skill to read local Hermes session transcripts without a separate confirmation step. <br>\nMitigation: Invoke it explicitly for a specific session or file when possible, and use it only when local session analysis is intended. <br>\nRisk: Generated reports may summarize private prompts, tool outputs, costs, or metadata from local sessions. <br>\nMitigation: Review and redact output before sharing it outside the trusted local environment. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n- [TokenSave homepage](https://github.com/raydatalab/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown with shell command snippets and plain-text cost analysis] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include local session cost estimates, waste categories, and a ready-to-paste fix prompt.] <br>\n\n## Skill Version(s): <br>\n0.4.2 (source: server release metadata and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.1-1: 3 files, 3392 bytes\n\nFiles: skill-card.md (1928b), SKILL.md (4098b), _meta.json (130b)\n\nFile v0.4.1-1:SKILL.md\n\n---\nname: tokensave\ndescription: Analyze your Hermes agent's token waste and get one-click fix prompts. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.1\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\n  - reduce cost\n  - cut cost\n  - api spending\n  - token budget\n  - expensive model\n  - how much did this cost\n  - estimate cost\n  - cost breakdown\n  - where is my money going\n  - agent spending\n  - api fees\n  - lower my bill\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\nAnalyze your Hermes agent's token usage and get one-click fix prompts.\n\n## Why Use Me\n\nEvery day your agent wastes tokens — re-reading the same files, running on\npro when flash would do, keeping stale context around. TokenSave tells you\nexactly where the waste is, how much it costs, and gives you a ready-to-paste\nprompt to fix it.\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\nFile v0.4.1-1:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.1-1\",\n  \"publishedAt\": 1783730523899\n}\n\nFile v0.4.1-1:skill-card.md\n\n## Description: <br>\nTokenSave analyzes Hermes agent session data for token waste, cost drivers, duplicate tool calls, context bloat, model mismatch, and heartbeat waste, then produces fix prompts. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and Hermes users use this skill to inspect local agent sessions for token waste, estimate avoidable cost, and get concise prompts for reducing duplicate calls, context bloat, model mismatch, and heartbeat waste. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: TokenSave reads local Hermes session records that may include full transcripts, token counts, costs, and metadata. <br>\nMitigation: Install only where local session analysis is acceptable, ask before analyzing sensitive workspaces, and target a specific session or file when possible. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n- [TokenSave Homepage](https://github.com/raydatalab/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown with shell command snippets, waste analysis, and fix prompts] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Local analysis of Hermes session records; no API keys are described for analysis mode.] <br>\n\n## Skill Version(s): <br>\n0.4.1-1 (source: server release metadata; artifact frontmatter version is 0.4.1) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.1: 3 files, 3447 bytes\n\nFiles: skill-card.md (2210b), SKILL.md (3873b), _meta.json (128b)\n\nFile v0.4.1:SKILL.md\n\n---\nname: tokensave\ndescription: Analyze your Hermes agent's token waste and get one-click fix prompts. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.1\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\nAnalyze your Hermes agent's token usage and get one-click fix prompts.\n\n## Why Use Me\n\nEvery day your agent wastes tokens — re-reading the same files, running on\npro when flash would do, keeping stale context around. TokenSave tells you\nexactly where the waste is, how much it costs, and gives you a ready-to-paste\nprompt to fix it.\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\nFile v0.4.1:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.1\",\n  \"publishedAt\": 1783729449509\n}\n\nFile v0.4.1:skill-card.md\n\n## Description: <br>\nAnalyze Hermes agent token waste and costs, then provide local waste reports and fix prompts for duplicate tool calls, context bloat, model mismatch, and heartbeat waste. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this skill to inspect local Hermes sessions for token waste, cost drivers, and concrete optimization prompts. It is intended for local cost diagnostics where the user intentionally wants session history analyzed. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can inspect full local Hermes session history, which may contain sensitive conversations. <br>\nMitigation: Use explicit invocations such as `tokensave analyze <session_id>` or a specific file, confirm the data source before analysis, and review reports before sharing them. <br>\nRisk: Broad cost or billing requests may trigger analysis without a clear confirmation step. <br>\nMitigation: Ask the user to confirm that local token-cost analysis is intended before reading session history. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n- [Project homepage](https://github.com/raydatalab/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown and plain text with shell command examples and ready-to-paste fix prompts] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Produces local token-cost analysis from Hermes SQLite session data or JSON request dumps; no API keys or network configuration are described.] <br>\n\n## Skill Version(s): <br>\n0.4.1 (source: server release metadata and artifact frontmatter) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.0-1: 3 files, 3376 bytes\n\nFiles: skill-card.md (2043b), SKILL.md (3873b), _meta.json (130b)\n\nFile v0.4.0-1:SKILL.md\n\n---\nname: tokensave\ndescription: Analyze your Hermes agent's token waste and get one-click fix prompts. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.0\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\nAnalyze your Hermes agent's token usage and get one-click fix prompts.\n\n## Why Use Me\n\nEvery day your agent wastes tokens — re-reading the same files, running on\npro when flash would do, keeping stale context around. TokenSave tells you\nexactly where the waste is, how much it costs, and gives you a ready-to-paste\nprompt to fix it.\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, just run:\n\n```bash\ntokensave analyze\n```\n\nIt auto-detects the latest session from `~/.hermes/state.db` (the primary session store). You can also target a specific source:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## What It Detects\n\nFour waste detectors run against your session:\n\n| Detector | What it finds |\n|----------|---------------|\n| Duplicate tool calls | Same tool + same args called 2+ times (exact + near-duplicate) |\n| Context bloat | Stale/redundant context, oversized tool outputs, unused tool definitions, session overhead |\n| Model mismatch | Simple queries running on expensive models — tells you which cheaper model to use |\n| Heartbeat waste | Cron jobs and idle/status checks that could run on a cheaper model |\n\n## Data Sources\n\nTokenSave reads from two sources (no config needed):\n\n| Source | Format | What's there |\n|--------|--------|-------------|\n| `~/.hermes/state.db` | SQLite | Primary — full session transcripts with token counts, costs, and metadata |\n| `~/.hermes/sessions/*.json` | JSON | API error request dumps — partial data but useful when SQLite is unavailable |\n\nAuto-detect tries SQLite first, falls back to JSON, then gives a clear error message.\n\n## What You Need\n\n- Python 3.10+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | SQLite sessions + JSON error dumps | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\nFile v0.4.0-1:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.0-1\",\n  \"publishedAt\": 1783729335483\n}\n\nFile v0.4.0-1:skill-card.md\n\n## Description: <br>\nAnalyze your Hermes agent's token waste and get one-click fix prompts. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and Hermes users use this skill to inspect local session data for avoidable token waste, cost drivers, duplicate tool calls, context bloat, model mismatch, and heartbeat waste. The skill produces a waste report and fix prompt that can be reviewed before changing agent behavior. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can read and surface local Hermes session transcripts and cost metadata. <br>\nMitigation: Install and run it only when that local access is acceptable, and prefer targeting a specific session ID, file, or directory. <br>\nRisk: Broad billing or money-saving prompts could trigger analysis without a clear confirmation step. <br>\nMitigation: Use the skill for explicit Hermes token-analysis requests and ask for confirmation before reading local session data. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n- [Project homepage](https://github.com/raydatalab/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and plain-text token waste reports] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include estimated token and cost savings, detector summaries, and ready-to-paste fix prompts.] <br>\n\n## Skill Version(s): <br>\n0.4.0-1 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\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. <br>\n\nArchive v0.4.0: 3 files, 2732 bytes\n\nFiles: skill-card.md (1890b), SKILL.md (2494b), _meta.json (128b)\n\nFile v0.4.0:SKILL.md\n\n---\nname: tokensave\ndescription: Analyze your Hermes agent's token waste and get one-click fix prompts. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. 100% local, zero config.\nversion: 0.4.0\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - token waste\n  - analyze cost\n  - audit tokens\n  - save cost\n  - save money\n  - too expensive\n  - api bill\n  - wasted tokens\n  - spending too much\n  - 浪费 token\n  - 省钱\n  - 账单\n  - 分析用量\n  - token usage\n  - model cost\n  - optimize cost\n  - 优化成本\n  - check waste\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\nAnalyze your Hermes agent's token usage and get one-click fix prompts.\n\n## Why Use Me\n\nEvery day your agent wastes tokens — re-reading the same files, running on\npro when flash would do, keeping stale context around. TokenSave tells you\nexactly where the waste is, how much it costs, and gives you a ready-to-paste\nprompt to fix it.\n\n## How It Works\n\nWhen you send \"tokensave\" or ask about cost/waste, run:\n\n```bash\ntokensave analyze ~/.hermes/sessions/<latest>.json\n```\n\nCopy the output and paste it into your response. The user sees:\n\n```\nSession abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\"\n```\n\n## When to Use\n\n- User asks about costs, bills, or token usage\n- User says \"analyze my session\" or \"how much did I spend\"\n- User mentions \"waste\", \"expensive\", \"save money\"\n- You want to help the user understand where their money goes\n\n## What You Need\n\n- Hermes Agent v0.17+\n- `pip install tokensave`\n- Nothing else — no API keys, no network, no config\n\n## Pipeline Mode (Bonus)\n\ntokensave also works as a transparent OpenAI wrapper that cuts token usage\nautomatically. If the user has installed it with `from tokensave import OpenAI`,\ntheir API calls go through normalize → cache → compress. But that's automatic —\nyou don't need to do anything.\n\n## Tier Reference\n\n| Tier | What it checks | Output |\n|------|---------------|--------|\n| `analyze` | Session file | Waste report + fix prompt |\n| `pipeline` | Transparent proxy | Automatic token savings |\n\nFile v0.4.0:_meta.json\n\n{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.0\",\n  \"publishedAt\": 1783728915335\n}\n\nFile v0.4.0:skill-card.md\n\n## Description: <br>\nTokenSave analyzes Hermes agent token waste locally and produces fix prompts for duplicate tool calls, context bloat, model mismatch, and heartbeat waste. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[raydatalab](https://clawhub.ai/user/raydatalab) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and Hermes Agent users use this skill to inspect local session files for token waste, cost drivers, and ready-to-paste prompts that reduce avoidable usage. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may analyze local Hermes session files when invoked by broad billing or saving-money phrases, and those summaries can reveal usage details, file names, prompts, or other local-session context. <br>\nMitigation: Invoke it explicitly for TokenSave or Hermes token-usage analysis and review output before sharing. <br>\n\n\n## Reference(s): <br>\n- [TokenSave homepage](https://github.com/raydatalab/tokensave) <br>\n- [ClawHub skill page](https://clawhub.ai/raydatalab/skills/tokensave) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Guidance] <br>\n**Output Format:** [Markdown with shell command examples and token-waste analysis text] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include cost estimates, waste categories, and ready-to-paste fix prompts based on local Hermes session files.] <br>\n\n## Skill Version(s): <br>\n0.4.0 (source: server release metadata and skill frontmatter) <br>\n\n## Ethical Considerations: <br>\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. <br>","readmeExcerpt":"Skill: Tokensave Publish Owner: raydatalab Summary: Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste... Tags: latest:0.4.5 Version history: v0.4.5 | 2026-07-11T10:18:01.087Z | auto tokensave 0.4.5 - Tightened usage policy: analysis now runs only when the user explicitly requests it (e.g., \"run tokensave\", \"ana","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"$ tokensave analyze\n\nSession 20260711_a1b2c3: 12,000 tokens, ~$0.05, 44% avoidable.\n\nTop wastes:\n  1. duplicate_tool_calls (5x): ~3,000 tokens — read_file called 5x with same path\n  2. context_bloat (1x): ~1,800 tokens — 40% of input is stale context\n  3. model_mismatch (3x): ~500 tokens — simple queries routed through pro\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\""},{"language":"bash","snippet":"tokensave analyze"},{"language":"bash","snippet":"tokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # error request dump\ntokensave analyze <directory/>          # latest JSON in directory\ntokensave analyze --detectors dup,bloat # specific detectors only"},{"language":"text","snippet":"Session abc123: 12,400 tokens, ~$0.19, 41% avoidable.\n\nTop wastes:\n  #1 duplicate_tool_calls (8x): ~4,800 tokens\n  #2 model_mismatch (5x): ~860 tokens\n  #3 context_bloat: ~3,700 tokens\n\nSend to your agent: \"Before reading a file, check if you already...\""},{"language":"bash","snippet":"$ tokensave analyze\n\nSession 20260711_a1b2c3: 12,000 tokens, ~$0.05, 44% avoidable.\n\nTop wastes:\n  1. duplicate_tool_calls (5x): ~3,000 tokens — read_file called 5x with same path\n  2. context_bloat (1x): ~1,800 tokens — 40% of input is stale context\n  3. model_mismatch (3x): ~500 tokens — simple queries routed through pro\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\""},{"language":"bash","snippet":"tokensave analyze"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: tokensave\ndescription: Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste. Analyze mode is 100% local, zero config.\nversion: 0.4.5\nauthor: raydatalab\nlicense: Apache-2.0\nplatforms: [linux, macos, wsl]\ntriggers:\n  - tokensave\n  - run tokensave\n  - analyze token waste\n  - analyze my session\n  - check token waste\n  - audit my tokens\n  - session cost analysis\n  - how much did this session cost\n  - analyze token usage\n  - optimize token cost\n  - reduce token cost\n  - model cost analysis\n  - duplicate tool calls\n  - context bloat\n  - token budget analysis\n  - analyze api spending\n  - analyze cost\n  - audit tokens\n  - token waste\n  - where is my money going\n  - cost breakdown\n  - estimate cost\n  - api fees\n  - check waste\nmetadata:\n  hermes:\n    tags: [cost-optimization, token-analysis, waste-detection, diagnostics]\n    homepage: https://github.com/raydatalab/tokensave\n    related_skills: [hermes-smart-router, hermes-cost-optimization]\n---\n\n# TokenSave\n\n## Overview\n\n```bash\n$ tokensave analyze\n\nSession 20260711_a1b2c3: 12,000 tokens, ~$0.05, 44% avoidable.\n\nTop wastes:\n  1. duplicate_tool_calls (5x): ~3,000 tokens — read_file called 5x with same path\n  2. context_bloat (1x): ~1,800 tokens — 40% of input is stale context\n  3. model_mismatch (3x): ~500 tokens — simple queries routed through pro\n\nSend to your agent: \"Before calling any tool, check if you already have\nthe result in a previous message...\"\n```\n\nOne session. 12K tokens. 44% could have been avoided — that's 5,300 tokens\nsaved with a single paste. Run after every session, bills drop immediately.\n\nAll numbers above are from `tests/test_analyzer.py` real test fixtures.\n12,000 input + output tokens, captured waste across all 4 detectors.\nNo made-up data.\n\n## When to Use\n\n- User explicitly asks to \"run tokensave\", \"analyze my session\", or similar\n- User provides a specific session ID or file path to analyze\n- User asks \"how much did this session cost\" with clear intent to run analysis\n- User mentions specific waste patterns like \"duplicate tool calls\" or \"context bloat\"\n\n## When NOT to Use — Read This First\n\n- Do NOT auto-analyze on general cost complaints (\"this is expensive\", \"save money\", \"too expensive\")\n- Do NOT read session data (~/.hermes/state.db) without explicit user confirmation\n- For general billing questions, explain that TokenSave can analyze a specific session\n  but wait for an explicit command like `tokensave analyze <session_id>`\n- Always prefer `tokensave analyze <session_id>` over auto-detecting the latest session\n  when the user has not explicitly asked for it\n\n## How It Works\n\nWhen the user has explicitly asked to run an analysis, use:\n\n```bash\ntokensave analyze\n```\n\nIf the user has provided a specific session ID or path, use that instead:\n\n```bash\ntokensave analyze <session_id>          # specific session from state.db\ntokensave analyze <file.json>           # er"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7fk1ctfxrjyw4y1hdms1re458a736q\",\n  \"slug\": \"tokensave\",\n  \"version\": \"0.4.5\",\n  \"publishedAt\": 1783765081087\n}"},{"path":"skill-card.md","content":"## Description:\n\nTokenSave analyzes explicitly requested session token waste and API cost issues, including duplicate tool calls, context bloat, model mismatch, and heartbeat waste, with a local zero-config analyze mode.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[raydatalab](https://clawhub.ai/user/raydatalab)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent users use this skill after an explicit request to run TokenSave against a specific local session or request dump. The skill returns a token waste and cost report with guidance the user can give to an agent to reduce avoidable spend.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Analyze mode reads local session transcripts and request dumps.\n\nMitigation: Run it only after an explicit user request and prefer a specific session ID, file, or directory target over auto-detection.\n\nRisk: The tool is installed from an unpinned external Python package.\n\nMitigation: Install it in an isolated Python environment and verify the tokensave package source and version before use.\n\nRisk: Pipeline mode can process API requests and requires an API key plus network access.\n\nMitigation: Treat pipeline mode separately from local analysis and enable it only with deliberate API-key and network configuration.\n\nRisk: Waste findings such as near-duplicate detection may include false positives.\n\nMitigation: Use the report as diagnostic guidance and review suggested changes before applying them to agent behavior.\n\n## Reference(s):\n\n- [TokenSave GitHub Homepage](https://github.com/raydatalab/tokensave)\n- [ClawHub Skill Page](https://clawhub.ai/raydatalab/skills/tokensave)\n- [ClawHub Publisher Profile](https://clawhub.ai/user/raydatalab)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown response with pasted CLI report output and concise remediation guidance.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Analyze mode uses local session data; pipeline mode is separate and may require an API key and network access.]\n\n## Skill Version(s):\n\n0.4.5 (source: server release evidence and frontmatter)\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."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1525,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T05:52:05.536Z","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-11T05:52:05.536Z","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-11T08:41:45.204Z","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"}]}}}