Skip to main content

Session search and unified usage analytics for coding agents

Project description

CodingAgentTools

coding-agent-tools is a practical CLI bundle for local coding-agent workflows.

It currently provides:

  • find-session: search and resume sessions across Claude Code, Codex, and OpenCode
  • agent-usage: unified usage and estimated USD-equivalent cost across Claude Code, Codex, OpenClaw, OpenCode, and OpenWhispr

Why this repo exists

This consolidates earlier standalone tools into one package:

  • find-session (now here)
  • local allusage script (now agent-usage)

The goal is one install, one command surface, one place to improve.

Install

From PyPI (recommended):

uv tool install coding-agent-tools

Alternative:

pipx install coding-agent-tools
# or
pip install coding-agent-tools

From source:

uv tool install .

Quickstart

# Find sessions in current project across all supported agents
find-session "auth,refactor"

# Search all projects
find-session -g

# Usage report (daily default)
agent-usage

# Weekly report with per-model expansion
agent-usage weekly --breakdown

find-session

Unified session search with interactive selection, resume, and export/copy actions.

# Search current project
find-session "redis,bug"

# Search all projects
find-session -g

# Limit to one agent
find-session "checkpoint" --agents codex

Preview behavior

Session previews now include both ends of user intent:

  • First: ...
  • Last: ...

If only one meaningful user message is found, it displays as First/Last: ....

agent-usage

Token usage and estimated cost tables by period.

# Daily usage for all sources
agent-usage

# Weekly with per-model breakdown
agent-usage weekly --breakdown

# Restrict sources
agent-usage monthly opencode codex

Sources and aliases

  • claude / cc / claudecode (native ccusage)
  • codex / cx
  • openclaw / oc / claw
  • opencode / oe / code
  • openwhispr / ow / whispr

Claude source = native ccusage

For Claude data, agent-usage now delegates directly to ccusage (no custom reimplementation).

  • Uses ccusage if installed
  • Otherwise falls back to npx --yes ccusage@latest
  • Requires Node.js + npx unless you already have ccusage installed

Cost model

agent-usage estimates costs from token counts using live LiteLLM pricing metadata.

  • This avoids misleading $0 totals for subscription-backed traffic (especially OpenCode).
  • If a model is missing in the pricing registry, it falls back to source-observed cost when present.

Data sources

  • Claude Code: native ccusage
  • Codex: ~/.codex/sessions/**/rollout-*.jsonl
  • OpenCode: ~/.local/share/opencode/opencode.db
  • OpenClaw: ~/.openclaw/agents/*/sessions/*.jsonl
  • OpenWhispr: ~/Library/Application Support/open-whispr/transcriptions.db

Beautiful terminal demos (yes, via subprocess recording)

Yes: you can generate polished terminal renders by recording commands as subprocesses.

This repo includes ready-to-run VHS tapes in demo/:

# macOS
brew install vhs

# render animated gifs from deterministic command scripts
./scripts/render-demos.sh

How it works:

  • vhs launches a shell subprocess
  • runs scripted commands (sample queries and real command output)
  • renders a styled terminal recording directly to GIF

Use these as README assets, release previews, or social clips.

find-session demo

find-session demo

agent-usage demo

agent-usage demo

Development

python3 -m pip install -e .
find-session --help
agent-usage --help

References

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coding_agent_tools-0.1.7.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coding_agent_tools-0.1.7-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file coding_agent_tools-0.1.7.tar.gz.

File metadata

  • Download URL: coding_agent_tools-0.1.7.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for coding_agent_tools-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7721d1d39f3ed9c38546df887a595b1b5d411632fe3b97d5fe022c53543476eb
MD5 f87ec135e92b5ac6c47b6316e81aa331
BLAKE2b-256 e4817299365670776cc45c18d47700ae8055f47fdff88d03a1200ca967cbfe7d

See more details on using hashes here.

File details

Details for the file coding_agent_tools-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for coding_agent_tools-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fac43b001c3589f1bf3dde0a6b89d25d2c7a7ddd46c17d8de66954ffe972d94b
MD5 66a088f84963034d3cf72583f4b3223f
BLAKE2b-256 b66f5aa14a8a5885a28ded09449eb1e3974527b29acc753aed10abdda858f71e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page