Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ctxcap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"include": ["AGENTS.md", "CLAUDE.md", "**/AGENTS.md", "**/CLAUDE.md"]
}
42 changes: 42 additions & 0 deletions .github/workflows/ctxcap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: context budget

# AGENTS.md and CLAUDE.md are loaded by every harness working in this repo, so
# their token cost is part of the repo's interface. This measures the delta a PR
# introduces against the merge base and fails when it grows. Nested per-crate
# AGENTS.md files are included, because a harness working in rust/crates/api is
# given that one and not the root file. The committed ctxcap-baseline.json is
# what the comparison uses; update it in the same PR as an intended increase.
on:
pull_request:
branches: [main]
paths:
- '**/AGENTS.md' # root, rust/, rust/crates/*/, and src/
- '**/CLAUDE.md'
- '.ctxcap.json' # which files are in scope
- 'ctxcap-baseline.json' # what a PR is measured against
- '.github/workflows/ctxcap.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ctxcap-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
context-budget:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
persist-credentials: false
- uses: Naeha-S/ctxcap@v1
with:
fail-on: increase
stale: true
13 changes: 13 additions & 0 deletions ctxcap-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"AGENTS.md": 1643,
"CLAUDE.md": 250,
"rust/AGENTS.md": 1005,
"rust/CLAUDE.md": 226,
"rust/crates/api/AGENTS.md": 762,
"rust/crates/commands/AGENTS.md": 819,
"rust/crates/plugins/AGENTS.md": 652,
"rust/crates/runtime/AGENTS.md": 983,
"rust/crates/rusty-claude-cli/AGENTS.md": 1034,
"rust/crates/tools/AGENTS.md": 836,
"src/AGENTS.md": 798
}