# Devxkit Usage Observability

Read local backend usage captured in agent runs without pricing or raw payloads. Output includes token and duration summaries in JSON or CSV format.

**Canonical URL:** https://skillshunter.net/skills/discovered-080e8dacb182cd4e8b00676bfe3ec513904784bded36e83f

**JSON URL:** https://skillshunter.net/api/public/v1/skills/discovered-080e8dacb182cd4e8b00676bfe3ec513904784bded36e83f

**Markdown URL:** https://skillshunter.net/skills/discovered-080e8dacb182cd4e8b00676bfe3ec513904784bded36e83f.md

**Instructions download URL:** https://skillshunter.net/skills/discovered-080e8dacb182cd4e8b00676bfe3ec513904784bded36e83f/download

**Category:** Software & Development

**Source URL:** https://github.com/jesuserro/devxkit/blob/0380bd30488627f7232a08c38ebc0c7dd9a66dc3/src/devxkit/assets/skills/devxkit/devxkit-usage-observability/SKILL.md

**Source commit:** 0380bd30488627f7232a08c38ebc0c7dd9a66dc3

**Listing approved at:** 2026-11-29

**Created at:** 2026-11-28T18:48:52.000000Z

**Updated at:** 2026-11-29T10:53:27.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Ensure agent runs exist with `logs/<backend>/agent-run.json` under `.agent-runs/<issue>/` before using commands. Do not infer monetary cost from token counts or attempt to calculate pricing.

### When to use it

- Inspect token and duration summaries from past agent runs
- Compare backends for a slice without re-running backends
- Export usage data for offline analysis in JSON or CSV format

## Skill instructions

---
name: devxkit-usage-observability
description: Read local backend usage captured in agent runs without pricing or raw payloads.
scope: global
devxkit_commands:
  - devxkit agent usage history
  - devxkit agent usage totals
  - devxkit agent usage export
---

# devxkit usage observability

## When to use

- Inspect token/duration summaries from past agent runs under `.agent-runs/`
- Compare backends (`cursor`, `codex`, etc.) for a slice without re-running backends
- Export usage for offline analysis (JSON/CSV) — **read-only**

## Preconditions

- Agent runs exist with `logs/<backend>/agent-run.json` under `.agent-runs/<issue>/`
- No backend execution required; commands only read local files

## Commands

```bash
devxkit agent usage history
devxkit agent usage totals
devxkit agent usage export --format json
devxkit agent usage export --format csv
```

Filtered examples:

```bash
devxkit agent usage history --issue 117 --backend cursor
devxkit agent usage totals --issue 117 --last 7d
devxkit agent usage export --format json --issue 117 --since 2026-06-01
devxkit agent usage history --json | jq '.events[0]'
devxkit agent usage totals --json | jq '.grand_total'
```

## Validation

- Commands exit 0 even when no events match (empty list / null totals)
- JSON output includes `monetary_cost: null` — never a dollar amount
- `history --json` and `export --format json` share the same event payload shape (ADR 0013)
- No `raw_usage`, prompts, results, stdout, stderr, or secrets in output

## Common failures

- **Empty history** → no captured run yet; backend may not have executed or did not emit usage JSON
- **Expecting pricing** → not supported; do not infer cost from token counts
- **Wrong issue filter** → confirm `.agent-runs/<issue>/` exists and run completed

## Stop conditions

- Do **not** calculate or report monetary cost
- Do **not** print or persist `raw_usage`, prompts, results, or API keys
- Do **not** run backends just to populate usage — use `devxkit agent run` only with explicit authorization
- `export` is read-only; it never triggers backend execution

## Related skills

- `devxkit-cursor-cost-policy`, `devxkit-pr-reporting` (scorecard may reference latest usage summary)

