Skip to content
Agentmart
Submit a tool

pr-cost

Collect a typed AI cost payload for a newly created GitHub PR, persist it to a local ledger, and optionally post an idempotent PR comment when live writes are…

Skill by cheshirecode

IndexedUnlicense
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cheshirecode-pr-cost

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Collect a typed AI cost payload for a newly created GitHub PR, persist it to a local ledger, and optionally post an idempotent PR comment when live writes are explicitly enabled.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/pr-cost

What's inside

Skill name
pr-cost
Description
Collect a typed AI cost payload for a newly created GitHub PR, persist it to a local ledger, and optionally post an idempotent PR comment when live writes are explicitly enabled.
License
Unlicense
Instructions
36 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (32)

  • INSTALL.md
  • SKILL.md
  • pr_cost_from_hook.py · adapters/claude/v1/
  • README.md · adapters/codex/
  • gh · adapters/codex/bin/
  • README.md · adapters/cursor/
  • hooks.json · adapters/cursor/
  • pr-cost-from-hook.sh · adapters/cursor/
  • annotate.md · references/
  • billed-validation.md · references/
  • diagnosis.md · references/
  • payload.md · references/
  • claude_session_usage.py · scripts/
  • codex_session_usage.py · scripts/
  • opencode_session_usage.py · scripts/
  • pr_cost_collect.py · scripts/
  • pr_cost_doctor.py · scripts/
  • emit_valid.json · tests/fixtures/
  • hook_claude_pr_create.json · tests/fixtures/
  • hook_cursor_pr_create.json · tests/fixtures/
  • hook_cursor_pr_view.json · tests/fixtures/
  • test_adapters_smoke.py · tests/
  • test_annotation_recipe.py · tests/
  • test_cache_aware_usd.py · tests/
  • test_codex_rate_boundaries.py · tests/
  • test_no_hardcoded_paths.py · tests/
  • test_opencode_reader.py · tests/
  • test_pr_cost_collect.py · tests/
  • test_pr_cost_doctor.py · tests/
  • test_reader_failure_modes.py · tests/
  • test_skill_doc_matches_doctor.py · tests/
  • test_usage_key_contract.py · tests/

SKILL.md (first lines)

# pr-cost

Collect session usage after successful PR creation. Prefer the local ledger;
GitHub comments require explicit authorization and `PR_COST_HOOK_LIVE=1`.
Resolve the skill directory from this file's load path and run commands there.

## Route first

- Hook setup or adapter installation: read [INSTALL.md](INSTALL.md).
- Construct or validate a payload, invoke a collector, or select a usage reader:
  read [references/payload.md](references/payload.md).
- Diagnose a harness lane: read [references/diagnosis.md](references/diagnosis.md).
- Add cost to an existing PR: read [references/annotate.md](references/annotate.md).
- Check a rate or cache-pricing claim against billed cost: read
  [references/billed-validation.md](references/billed-validation.md).

Load only the reference needed by the request. Adapters live in
`adapters/{cursor,claude,codex}/`; the collector is `scripts/pr_cost_collect.py`.

## Privacy rules

- Never copy prompts, responses, file contents, or shell output beyond the PR URL.
- Never store API keys, tokens, auth headers, or repo-local secrets.
- Prefer safe metadata only: harness, model, token counts, session identifier,
  bounded timestamps, PR URL, and a short note about confidence.
- Cursor and Codex adapters should treat unavailable data as `null`, not as a
  reason to scrape unrelated local state.

## Environment

- `PR_COST_LEDGER`: optional ledger override. Defaults to
  `~/.local/share/pr-cost/ledger.jsonl`.
- `PR_COST_HOOK_LIVE=1`: enables live `gh pr comment` writes. Unset keeps the
  collector dry and ledger-only.

From cheshirecode/dotfiles, Unlicense.

More from cheshirecode/dotfiles

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 16, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Unlicense
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from cheshirecode

Cite this page

pr-cost skill. Agent Mart. https://agentmart.dev/skills/cheshirecode-pr-cost (last updated 2026-10-24)