Skip to content

Repository budget

A repository can say how many tokens a session should cost at start. Put .agent-gc.toml at the repository root:

[budget]
max_start_tokens = 40000

Unknown keys are ignored; a missing file means no budget, and a file that does not parse is reported by agent-gc scan and otherwise ignored.

The start cost is measured, not estimated: the median of the repository’s interactive sessions in the last 7 days (its last 10 when fewer than 3 are recent), per installation, so ~/.claude and ~/.claude-personal can differ. It is split into the repo part (the repo’s CLAUDE.md, .claude/skills, .mcp.json, project hooks) and your part (plugins, user skills, MCP servers, user hooks, your own CLAUDE.md), which is the measured total minus the repo part, with the heaviest sources named.

Where it shows:

  • agent-gc scan inside the repository: repo budget: 52k of 40k (repo 11k, yours 41k: meshy 16k, …), one line per installation.
  • The tray app (and scan --json, as repo_budgets): repositories seen in the last 30 days whose budget file says they are over.
  • agent-gc budget repo [path]: the full breakdown for one repository (exit code 0 even when over).
  • Session start, after agent-gc notify on: one line in the same notice, every session while over budget: “Sessions in this repo start at 52k tokens (budget 40k): repo 11k, your setup 41k — meshy 16k, claude-mem 7k.”

It only informs. It never blocks a session and never switches anything off: plugins and MCP servers belong to the whole machine, and switching one off because one repository is heavy would remove it from every other repository. The repository’s own sources are never touched either. The per-installation budget (agent-gc budget <install> <tokens>) stays the only automatic lever.