read allows 600 lines / 20,000 bytes (MAX_LINES, MAX_BYTES in crates/hx-tools/src/lib.rs); bash truncates at the same 20,000 (head 4,000 + tail). Roughly 5k tokens per result, resent each turn. Masking (window.rs, mask.rs) starts only once context passes min(compact_at/3, 60k) tokens, only elides results >= 4,000 bytes, and keeps the last 8 turns. The 60k value comes from two sessions (see the ponytail comment in window.rs). Cache reads are cheap, so the real saving may be small.
Steps
Run hx stats on several real sessions and record resent bytes per tool (bash/read/other), as the stats command already reports.
Only if bash or read dominate: lower the bash cap (e.g. ~10k bytes, keep more of the tail since errors sit at the end), and/or lower MASK_FROM_MAX, KEEP, MIN_BYTES.
Do not change anything if the numbers say resend cost is small.
Effect
Unknown; my rough guess is 5-15% of input cost, low confidence.
Risk
Agent re-reads files it needed; masked-stub rewrites invalidate the cache from the first changed result.
Verify
Same sessions/tasks before and after: compare hx stats resent bytes and the number of repeated read calls on one file.
## Problem (hypothesis, unmeasured)
`read` allows 600 lines / 20,000 bytes (`MAX_LINES`, `MAX_BYTES` in `crates/hx-tools/src/lib.rs`); `bash` truncates at the same 20,000 (head 4,000 + tail). Roughly 5k tokens per result, resent each turn. Masking (`window.rs`, `mask.rs`) starts only once context passes `min(compact_at/3, 60k)` tokens, only elides results >= 4,000 bytes, and keeps the last 8 turns. The 60k value comes from two sessions (see the `ponytail` comment in `window.rs`). Cache reads are cheap, so the real saving may be small.
## Steps
1. Run `hx stats` on several real sessions and record resent bytes per tool (bash/read/other), as the stats command already reports.
2. Only if bash or read dominate: lower the `bash` cap (e.g. ~10k bytes, keep more of the tail since errors sit at the end), and/or lower `MASK_FROM_MAX`, `KEEP`, `MIN_BYTES`.
3. Do not change anything if the numbers say resend cost is small.
## Effect
Unknown; my rough guess is 5-15% of input cost, low confidence.
## Risk
Agent re-reads files it needed; masked-stub rewrites invalidate the cache from the first changed result.
## Verify
Same sessions/tasks before and after: compare `hx stats` resent bytes and the number of repeated `read` calls on one file.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem (hypothesis, unmeasured)
readallows 600 lines / 20,000 bytes (MAX_LINES,MAX_BYTESincrates/hx-tools/src/lib.rs);bashtruncates at the same 20,000 (head 4,000 + tail). Roughly 5k tokens per result, resent each turn. Masking (window.rs,mask.rs) starts only once context passesmin(compact_at/3, 60k)tokens, only elides results >= 4,000 bytes, and keeps the last 8 turns. The 60k value comes from two sessions (see theponytailcomment inwindow.rs). Cache reads are cheap, so the real saving may be small.Steps
hx statson several real sessions and record resent bytes per tool (bash/read/other), as the stats command already reports.bashcap (e.g. ~10k bytes, keep more of the tail since errors sit at the end), and/or lowerMASK_FROM_MAX,KEEP,MIN_BYTES.Effect
Unknown; my rough guess is 5-15% of input cost, low confidence.
Risk
Agent re-reads files it needed; masked-stub rewrites invalidate the cache from the first changed result.
Verify
Same sessions/tasks before and after: compare
hx statsresent bytes and the number of repeatedreadcalls on one file.