agentleFS
crisandrewscrisandrews/ClawCode/skills/usage/SKILL.md

usage

Skill64 starsChanged 2 months agoMITView on GitHub

Show usage cost summary — session, today, last 30 days. OpenClaw-compatible format. Works from CLI or messaging. Triggers on /usage, /agent:usage, "cuanto gasté", "agent usage", "cost".

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call agent_status MCP tool → get file/chunk counts

    line 42
  2. Distinctive:

    Reply tool: if on messaging channel.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/usage — Cost Summary

Show usage costs in the OpenClaw-compatible format. Works from CLI or messaging channels.

Output format (matches OpenClaw exactly)

💸 Usage cost
Session <cost> · <tokens> tokens
Today <cost>
Last 30d <cost>

Subcommands

  • /usage — show the cost summary (default)
  • /usage tokens — compact token display
  • /usage full — verbose token + cost
  • /usage cost — same as default

Steps

  1. Detect surface (CLI vs messaging channel).
  2. Try to read session cost data from Claude Code's session store:

    ls ~/.claude/projects/*/\*.jsonl 2>/dev/null | head -3

    NOTE: Claude Code stores session data in ~/.claude/projects/<slug>/*.jsonl. The plugin cannot reliably read these because:

    • The session slug depends on the current cwd
    • The format is internal to Claude Code
    • Token counts per session are not always available to skills
  3. Fall back to estimate from memory/dreams:
    • Call agent_status MCP tool → get file/chunk counts
    • Bash: du -sh memory/ | awk '{print $1}' → memory dir size
    • Bash: wc -l memory/.dreams/events.jsonl 2>/dev/null | awk '{print $1}' → event count
  4. Build the response in OpenClaw format:

When cost data is available

💸 Usage cost
Session $0.42 · 125k tokens
Today $1.23
Last 30d $34.56

When cost data is NOT available (most likely case)

💸 Usage cost
Session n/a (run native /cost or /usage in CLI for tokens)
Today n/a
Last 30d n/a

📊 Agent resources
Memory: <size>, <N> files, <M> chunks
Dreams: <events> events, <unique> unique memories
  1. Format per surface:
    • CLI: standard markdown
    • WhatsApp: single *bold*
    • Telegram: **bold**
  2. Reply tool if on messaging channel.

Important

  • Claude Code does not expose session cost data to plugin skills directly.
  • The honest answer is "n/a — use native /cost on CLI for real token/cost data".
  • Agent resources (memory, dreams, files) ARE available and we can show them.
  • This matches OpenClaw's /usage cost format but with the Claude Code limitation documented.
  • This is the agent-aware equivalent of OpenClaw's /usage.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.