Economy
Economy asks a worktree’s agent to be terser, so it spends fewer tokens on narration. A level can also cap and trim the command output the agent reads. You set it per worktree.
Levels
Section titled “Levels”| Level | What the agent is told |
|---|---|
| Off | Nothing. The agent reasons and explains as much as it wants. This is the default. |
| Light | Trim filler and restate less. Reasoning stays full. |
| Moderate | Shorter explanations and terser output throughout. |
| Heavy | Minimal narration: state results and decisions, skip recaps and closing summaries. |
| Max | As terse as possible: answers only, no explanation unless asked. |
Pick a level in the Create worktree dialog, or later from the row menu → Economy. The primary row has no Economy setting.
How it works
Section titled “How it works”At the start of a session, ket hands the agent one sentence describing the level. Claude Code and Codex receive it. Other agents don’t, so Economy has no effect on them. With ket’s built-in levels, Economy doesn’t change the model, effort, command output or anything else. A pack can make a level do more.
A running agent keeps the level it started with. A new level applies from the next session in that worktree.
Command output
Section titled “Command output”Every build log and test run an agent reads stays in its conversation, and the agent sends it again on every later turn. Two settings cut that down. ket’s built-in levels leave both off; a pack’s level can turn them on, and your own config.toml overrides the pack either way.
The command filter
Section titled “The command filter”With the filter on, ket trims a successful command’s output after it runs and before Claude Code reads it. The command runs as the agent wrote it, with its own exit status, and a failed run reaches the agent whole.
ket trims only programs it has a recipe for: cargo, go, pytest, jest, package installs, listings and diffs. A build drops its Compiling lines and keeps every warning. A test run collapses its passes to a count and keeps any failure. Long output keeps its tail, where the summary is. Every trimmed result ends with a line saying how much ket cut and where the full output is:
[ket: 44 lines → 6 · ≈686 → 49 tokens · full output in the session transcript]The filter works with Claude Code. Set command_filter = true in the [agent] section to turn it on at every level, or false to turn a pack’s filter off.
By default ket keeps no copy of the full output, because the session transcript already holds it and command output can include a token or an environment variable. Set command_archive = true to keep a copy, readable only by you and deleted after a day, and get it back with ket recall <id>.
To see what the filter would do to a command, run it through ket filter:
ket filter -- cargo testIt prints the trimmed output and exits with the command’s own status. Add --keep to save the full output for ket recall.
The output cap
Section titled “The output cap”A cap limits how much successful output the agent takes inline at all, using each agent’s own setting: characters for Claude Code (bashOutputMaxChars, 30,000 by default) and tokens for Codex (tool_output_token_limit). Set output_limit in the [agent] section to choose your own.
A lower cap isn’t always cheaper. If the agent loses lines it needed, it runs the command again, and the re-run costs more than the lines saved.
What it saved
Section titled “What it saved”The Economy figure in the header shows what Economy sessions are estimated to have saved over the last 7 days, 30 days or all time. Click it for the breakdown by project and worktree. Settings → Economy shows the same total with its estimated cost.
The figures
Section titled “The figures”- Est. cost is what the Economy sessions cost, priced from their own tokens.
- Est. saved is the output those sessions would also have written with Economy off, at the model’s output price. It is never negative.
- The percentage is the saving as a share of what the same sessions would have cost with Economy off.
A project’s figures are its worktrees’ added together. The total is every project’s plus removed worktrees’.
How a session is priced
Section titled “How a session is priced”- ket records each session’s tokens: fresh input, output, cache reads and cache writes.
- Cost is each of those at the model’s rate. The rate is yours from
[rates]inconfig.tomlwhen you’ve set one, otherwise the provider’s list price. - Saved assumes each level trims a fixed share of output: Light 10%, Moderate 20%, Heavy 35%, Max 50%. A Max session that wrote 10,000 output tokens is counted as saving another 10,000.
Only output is counted, because output is all the level’s sentence asks the agent to change. Input and cache reads come from the task, not the level. They’re usually most of a session’s tokens, so the saving is a small share of the cost.
The shares are estimates, not measurements. Comparing sessions with Economy on against sessions with it off doesn’t work: a session’s size depends on the task, so whichever side got the heavier work looked more expensive.
On a Pro or Max plan the figures are what the same tokens would cost through the API, not what you paid.
What isn’t counted
Section titled “What isn’t counted”A session with Economy on shows as not priced when:
- Its model has no rate, either configured or listed.
- The level changed while the session was running.
Sessions with Economy off are never counted as savings, even in a worktree that has Economy on now. A running agent keeps the level it started with, so if you turn Economy on mid-session, that session still ran with it off. The saving starts from the next session.
Which worktrees are listed
Section titled “Which worktrees are listed”Worktrees with Economy on now, and any that ran Economy sessions in the period. A worktree switched back to off keeps what it saved while it was on.
A deleted worktree keeps its savings. Its sessions with Economy on appear on the Removed line and count in the total, but not in any project’s figure.
Limits
Section titled “Limits”- All covers the last 500 sessions ket has recorded.
- List prices are built into ket and can go stale when a provider changes them. Set
[rates]to override them.
Command output, measured
Section titled “Command output, measured”The breakdown also shows a line for the shell commands agents ran in the period, for example:
Command output ≈10K tokens · 25% of fresh input · filter trimmed ≈4KThis line is a count, not an estimate. ket’s hooks see every command’s result, so ket counts the bytes each command returned and the bytes the agent read. The difference is what the filter trimmed. The share is of fresh input, because a command’s output costs once as fresh input and again as a cache read on every later turn. ket counts only commands that ran while it was listening and estimates four bytes per token, so treat the figure as a floor.
Hover a worktree’s usage ring in the sidebar to see one session’s cost, savings, cache use and command output.
An organisation can publish a pack that defines its own levels, including the model, effort and caching each one uses, and for each agent an output cap (outputLimit) and the command filter (commandFilter). ket’s standard pack turns the filter on at Heavy and Max. Point ket at a pack with the [pack] section in config.toml. When ket fetches a new pack, it waits for you to choose Use it, and the pack applies the next time ket starts.