Tighten agent token brief stop gate · Entire
Tighten agent token brief stop gate
ef07c4d·
peyton-alt·3w ago·2 files·+7 added/-3 removed
Sessions
1051aa7485b2View transcript
Changes
2
cmd/entire/cli
Msessions_tokens.go+2/-2
Msessions_test.go+5/-1
65 unmodified lines
// ...
const agentBriefCostProxyBatchAction = "Use at most 3 batched reads before answering. Avoid broad grep, broad diffs, broad tests, and repeated token diagnostics; keep the answer tight."
const agentBriefCostProxyBatchAction = "Use at most 3 batched reads before answering. Continue only if a named file or test can change the verdict; otherwise answer now. Avoid broad grep, broad diffs, broad tests, and repeated token diagnostics; keep the answer tight."
func newTokensCmd() *cobra.Command {
var jsonFlag bool
// ...
case hasTokenRecommendation(report, "api-call-amplification"):
return agentBriefCostProxyBatchAction, true
case hasTokenRecommendation(report, "context-replay-hotspot"):
return "Use at most 2 focused reads after summarizing known findings, then answer. Avoid broad grep, broad diffs, and broad tests.", true
return "Use at most 2 focused reads only if a named file or test can change the answer; otherwise answer now. Avoid broad grep, broad diffs, broad tests.", true
case hasTokenRecommendation(report, "subagent-heavy"):
return "Do not launch broad subagents. Use one narrowly scoped check with a concrete expected output.", true
case hasTokenRecommendation(report, "high-context-pressure"):
Mcmd/entire/cli/session_tokens.go+2/-2
1253 unmodified lines
// ...
"Token usage: 6213.6k total; 97.4% cache/context replay; 70 API calls.",
"Next best action:",
"Use at most 3 batched reads before answering.",
"Continue only if a named file or test can change the verdict; otherwise answer now.",
"Avoid broad grep, broad diffs, broad tests, and repeated token diagnostics; keep the answer tight.",
"Signals:",
"- Cache/context replay dominates token volume."
}
// ...
Mcmd/entire/cli/sessions_test.go+5/-1
// code omitted for brevity