Skip to content

GitHub Action

The promptsize Action runs your budget check on every pull request. It’s self-contained — a bundled node20 action with no install step — and it fails the job, posts a job-summary table, and annotates each over-budget prompt inline.

.github/workflows/promptsize.yml
name: promptsize
on: [pull_request]
jobs:
budget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: abdulmunimjemal/promptsize@v1
with:
why: "true" # optional: per-file breakdown in the log
# config: custom/path.json # optional: non-default config location

Your repo needs a config file and the prompt files it points at. Nothing else.

InputDefaultDescription
config(auto-detect)Path to the promptsize config file.
whyfalseShow the per-file token breakdown in the log.
  • Step status — the job fails when any prompt is over budget (exit 1).
  • Job summary — a table of every prompt with tokens, limit, and status, rendered on the workflow run page.
  • Annotations — an inline ::error:: for each over-budget prompt.
  • @v1 — the moving major tag. Gets non-breaking updates automatically.
  • @v0.1.0 — pin an exact release for full reproducibility.
- uses: abdulmunimjemal/promptsize@v0.1.0 # exact
- uses: abdulmunimjemal/promptsize@v1 # latest v1.x

If you’d rather not use the Action, run the CLI in any workflow:

- uses: actions/setup-node@v4
with:
node-version: 20
- run: npx promptsize --why