thedotmack/claude-mem / claude-mem-cursor/skills/agent-cost-report
agent-cost-report
VerifiedBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 100 B |
| CHECKSUMS.txt | markdown | 2.1 KB |
| SKILL.md | skill md | 21.3 KB |
| scripts/acr.py | script | 12.2 KB |
| scripts/acr/__init__.py | script | 105 B |
| scripts/acr/behavior.py | script | 17.5 KB |
| scripts/acr/classify.py | script | 5.5 KB |
| scripts/acr/costs.py | script | 6.3 KB |
| scripts/acr/devices.py | script | 5.4 KB |
| scripts/acr/evidence.py | script | 9.2 KB |
| scripts/acr/labels.py | script | 7.6 KB |
| scripts/acr/measure.py | script | 5.6 KB |
| scripts/acr/mistakes.py | script | 23.1 KB |
| scripts/acr/owner.py | script | 2.9 KB |
| scripts/acr/patterns.py | script | 26.0 KB |
| scripts/acr/period.py | script | 3.8 KB |
| scripts/acr/prices.py | script | 5.0 KB |
| scripts/acr/render.py | script | 52.7 KB |
| scripts/acr/rollup.py | script | 31.7 KB |
| scripts/acr/rules.json | config | 3.5 KB |
| scripts/acr/rules.py | script | 4.5 KB |
| scripts/acr/sample.py | script | 3.6 KB |
| scripts/acr/snapshot.py | script | 2.0 KB |
| scripts/acr/sync.py | script | 3.7 KB |
| scripts/acr/transcripts.py | script | 7.4 KB |
| scripts/acr/wins.py | script | 21.0 KB |
scripts/acr/owner.py
View on GitHub"""Report owner for the name-keyed detectors and human reviews.
Order: an explicit name (the ``--owner-name`` flag), then ``ACR_OWNER_NAME``, then
``git config user.name``. A blank explicit value or a blank ``ACR_OWNER_NAME`` forces
the name-free patterns and does not consult git. Nothing here defaults to a person.
"""
import os
import re
import subprocess
_MISSING = object()
_pin = _MISSING
_git_cached = False
_git_value = None
def clean(value):
if value is None: return None
text = str(value).strip()
return text or None
def git_user_name():
"""``git config --get user.name``, or None when git has no name or cannot run."""
try:
r = subprocess.run(["git", "config", "--get", "user.name"], capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=5)
except (OSError, subprocess.SubprocessError):
return None
if r.returncode != 0: return None
return clean(r.stdout)
def _cached_git():
global _git_cached, _git_value
if not _git_cached:
_git_value = git_user_name()
_git_cached = True
return _git_value
def resolve(explicit=_MISSING, environ=None, git_lookup=None):
"""The owner name, or None when unset. ``explicit`` (including "") wins over the environment."""
if explicit is not _MISSING:
return clean(explicit)
env = os.environ if environ is None else environ
if "ACR_OWNER_NAME" in env:
return clean(env["ACR_OWNER_NAME"])
lookup = _cached_git if git_lookup is None else git_lookup
try:
found = lookup()
except (OSError, subprocess.SubprocessError):
return None
return clean(found)
def name():
"""Name in effect for this process: a scoped override, else :func:`resolve`."""
if _pin is not _MISSING:
return clean(_pin)
return resolve()
def names(value=_MISSING):
"""The owner name plus, for a multi-word name, its first word: git's "Sam Lee" is "Sam" in
"Blocked on Sam" and "Sam asked". Empty when no owner name is set."""
full = name() if value is _MISSING else clean(value)
if not full: return []
first = full.split()[0]
return [full] if first == full else [full, first]
def alt(value=_MISSING):
"""A regex alternation of :func:`names` (longest first, each escaped as a literal), or None when unset."""
found = names(value)
if not found: return None
return "(?:" + "|".join(re.escape(n) for n in sorted(found, key=len, reverse=True)) + ")"
class scoped:
"""Pin an explicit owner for one command. None leaves environment and git resolution alone."""
def __init__(self, explicit):
self.explicit = explicit
def __enter__(self):
global _pin
self._prev = _pin
if self.explicit is not None:
_pin = self.explicit
return name()
def __exit__(self, *exc):
global _pin
_pin = self._prev
return False
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| backup-setupthedotmack/claude-memSet up, check, or restore local claude-mem database snapshots. Use when the user says "set up backups", "back up my memories", "backup status", or "restore my database". | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |