[{"data":1,"prerenderedAt":763,"buildId":764},["ShallowReactive",2],{"docs:\u002Fguide\u002Fbudget":3},{"page":4,"section":16,"document":17,"credits":10,"prev":757,"next":761},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"budget","\u002Fguide\u002Fbudget","guide\u002Fbudget.md","Budget","How readerly fits agent output into 8,000 characters, which lines it keeps, the hidden footer, --max-chars and --full, and planBudget on its own.",null,[],"i-lucide-gauge","article",true,9,"guide",{"nodes":18,"toc":749},[19,28,36,54,57,164,190,196,202,241,244,250,253,279,311,317,326,359,371,374,388,394,435,441,454,685,712,718,732,742],[20,21,22,23,27],"p",{},"A coding agent reads a command's output through a host that cuts long output. readerly gives ",[24,25,26],"code",{},"agent"," output a character budget, keeps whole lines that fit, and tells the agent what it left out.",[29,30,35],"h2",{"id":31,"anchor":32},"the-default-is-8000-characters",{"label":33,"icon":34},"Section titled \"The default is 8,000 characters\"","#","The default is 8,000 characters",[20,37,38,41,42,49,50,53],{},[24,39,40],{},"DEFAULT_REPORT_BUDGET"," in ",[43,44,46],"a",{"href":45},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Fsrc\u002Fbudget.ts",[24,47,48],{},"src\u002Fbudget.ts"," is ",[24,51,52],{},"8000",". That is under Claude Code's 30,000-character Bash output limit and Codex's 10,000-token cap. Codex cuts from the middle, so a report that runs over loses the lines an agent needs most, between the verdict and the next steps.",[20,55,56],{},"The profile sets the budget in this order:",[58,59,60,80],"table",{},[61,62,63],"thead",{},[64,65,66,70,75],"tr",{},[67,68,69],"th",{},"Case",[67,71,72],{},[24,73,74],{},"profile.budget",[67,76,77],{},[24,78,79],{},"profile.why.budget",[81,82,83,100,117,133,150],"tbody",{},[64,84,85,91,96],{},[86,87,88],"td",{},[24,89,90],{},"--full",[86,92,93],{},[24,94,95],{},"Infinity",[86,97,98],{},[24,99,90],{},[64,101,102,107,112],{},[86,103,104],{},[24,105,106],{},"--max-chars \u003Cn>",[86,108,109],{},[24,110,111],{},"n",[86,113,114],{},[24,115,116],{},"--max-chars",[64,118,119,124,128],{},[86,120,121,122],{},"format ",[24,123,26],{},[86,125,126],{},[24,127,52],{},[86,129,130],{},[24,131,132],{},"format agent",[64,134,135,141,145],{},[86,136,137,138],{},"an agent reader on ",[24,139,140],{},"text",[86,142,143],{},[24,144,52],{},[86,146,147],{},[24,148,149],{},"agent reader on text",[64,151,152,155,159],{},[86,153,154],{},"anything else",[86,156,157],{},[24,158,95],{},[86,160,161],{},[24,162,163],{},"no budget for \u003Creader> on \u003Cformat>",[20,165,166,167,169,170,172,173,176,177,180,181,185,186,189],{},"Only the ",[24,168,26],{}," renderer reads it. ",[24,171,140],{},", ",[24,174,175],{},"json"," and ",[24,178,179],{},"jsonl"," print every line whatever the budget says. A ",[43,182,184],{"href":183},"\u002Fguide\u002Frenderers","custom renderer"," can read ",[24,187,188],{},"ctx.profile.budget"," and decide for itself.",[29,191,195],{"id":192,"anchor":193},"what-the-agent-keeps",{"label":194,"icon":34},"Section titled \"What the agent keeps\"","What the agent keeps",[20,197,198,199,201],{},"The ",[24,200,26],{}," renderer plans its lines before it prints them:",[203,204,205,213,219,229,235],"ul",{},[206,207,208,212],"li",{},[209,210,211],"strong",{},"Whole lines."," A diagnostic is kept or dropped as one line. readerly never cuts a line in half.",[206,214,215,218],{},[209,216,217],{},"Verdict first."," Line 1 is always the verdict, with the status and the full counts, even when most rows are hidden.",[206,220,221,224,225,228],{},[209,222,223],{},"Next steps before rows."," ",[24,226,227],{},"next:"," lines are planned first, so a suggested command survives a tight budget.",[206,230,231,234],{},[209,232,233],{},"Errors before warnings."," Then errors, warnings, infos and logs, in that order. No warning gets in while an error is still left out.",[206,236,237,240],{},[209,238,239],{},"One of each code."," Inside a severity, rows group by code. Every code gets its first row before any code gets a second, so 120 copies of one warning can't push out a different one.",[20,242,243],{},"The first line that doesn't fit stops the plan. Everything after it is hidden, and the footer counts it.",[29,245,249],{"id":246,"anchor":247},"the-hidden-footer",{"label":248,"icon":34},"Section titled \"The hidden footer\"","The hidden footer",[20,251,252],{},"To see the footer, run a lint with 3 errors and 120 warnings as a coding agent. The output is 7,963 characters: the verdict, 3 errors, 91 warnings, the next step and this last line:",[254,255,257],"pre",{"language":140,"class":256,"wrap":14},"shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,258,260,268,269,268,274],{"class":259},"language-text",[261,262,265],"span",{"class":263,"style":264},"line","display: inline",[261,266,267],{},"warn ACME010 packages\u002Fpkg-91\u002Fvite.config.ts:8:5 Alias shadows a workspace package","\n",[261,270,271],{"class":263,"style":264},[261,272,273],{},"next: acme lint --fix   (applies 3 safe fixes)",[261,275,276],{"class":263,"style":264},[261,277,278],{},"hidden: 29 warn. rerun: acme lint --full, or acme lint --format json",[20,280,281,282,172,285,172,288,172,291,294,295,298,299,303,304,306,307,310],{},"The footer names each kind it dropped (",[24,283,284],{},"error",[24,286,287],{},"warn",[24,289,290],{},"info",[24,292,293],{},"log",", or ",[24,296,297],{},"lines"," of an ",[43,300,302],{"href":301},"\u002Fguide\u002Frenderers#answers-the-tool-renders","answer",") and two commands that get the rest: the same invocation with ",[24,305,90],{},", and with ",[24,308,309],{},"--format json",". readerly reserves room for the longest footer it could print before it plans the final cut, so the footer never pushes the total over the budget, unless the budget is smaller than the verdict and the footer together.",[29,312,316],{"id":313,"anchor":314},"max-chars-and-full",{"label":315,"icon":34},"Section titled \"--max-chars and --full\"","--max-chars and --full",[20,318,319,321,322,325],{},[24,320,106],{}," sets the budget to any positive integer. The same lint with ",[24,323,324],{},"--max-chars 600"," gives a coding agent 511 characters:",[254,327,328],{"language":140,"class":256,"wrap":14},[24,329,330,268,335,268,340,268,345,268,350,268,354],{"class":259},[261,331,332],{"class":263,"style":264},[261,333,334],{},"acme lint: failed. 3 errors, 120 warnings.",[261,336,337],{"class":263,"style":264},[261,338,339],{},"error ACME001 src\u002Froutes\u002Fr1.ts:14:3 Route handler reads process.env at module scope. fix: Read it inside the handler",[261,341,342],{"class":263,"style":264},[261,343,344],{},"error ACME001 src\u002Froutes\u002Fr2.ts:14:3 Route handler reads process.env at module scope. fix: Read it inside the handler",[261,346,347],{"class":263,"style":264},[261,348,349],{},"error ACME001 src\u002Froutes\u002Fr3.ts:14:3 Route handler reads process.env at module scope. fix: Read it inside the handler",[261,351,352],{"class":263,"style":264},[261,353,273],{},[261,355,356],{"class":263,"style":264},[261,357,358],{},"hidden: 120 warn. rerun: acme lint --full, or acme lint --format json",[20,360,361,363,364,176,367,370],{},[24,362,90],{}," removes the budget and adds ",[24,365,366],{},"why:",[24,368,369],{},"docs:"," to each line. The same run prints 10,293 characters with no footer.",[20,372,373],{},"A value that isn't a positive integer is a usage failure with exit code 2. A coding agent gets:",[254,375,376],{"language":140,"class":256,"wrap":14},[24,377,378,268,383],{"class":259},[261,379,380],{"class":263,"style":264},[261,381,382],{},"acme build: failed. --max-chars abc is not a positive integer.",[261,384,385],{"class":263,"style":264},[261,386,387],{},"fix: Pass --max-chars with a positive integer, such as --max-chars 8000.",[29,389,393],{"id":390,"anchor":391},"failures-under-a-budget",{"label":392,"icon":34},"Section titled \"Failures under a budget\"","Failures under a budget",[20,395,396,397,400,401,404,405,306,408,172,410,176,412,414,415,418,419,418,422,425,426,429,430,434],{},"A failure report is a few lines: the verdict, ",[24,398,399],{},"fix:",", any ",[24,402,403],{},"missing:"," inputs, ",[24,406,407],{},"rerun:",[24,409,90],{},[24,411,366],{},[24,413,369],{},". When those run over the budget, readerly drops ",[24,416,417],{},"docs",", then ",[24,420,421],{},"why",[24,423,424],{},"fix",", and adds ",[24,427,428],{},"hidden: fix. rerun: \u003Ccommand> --full",". The verdict, the missing inputs and the rerun line always stay, because the agent needs them to act. See ",[43,431,433],{"href":432},"\u002Fguide\u002Ffailures","Failures and exit codes",".",[29,436,440],{"id":437,"anchor":438},"using-planbudget-on-its-own",{"label":439,"icon":34},"Section titled \"Using planBudget on its own\"","Using planBudget on its own",[20,442,443,446,447,450,451,453],{},[24,444,445],{},"planBudget"," from ",[24,448,449],{},"readerly\u002Fbudget"," is the planner the ",[24,452,26],{}," renderer uses, without any text. You give it sizes in characters, and it returns the units that fit.",[254,455,458],{"language":456,"filename":457,"class":256,"wrap":14},"ts","plan.ts",[24,459,461,268,487,268,489,268,514,268,551,268,578,268,583,268,612,268,627,268,642,268,662],{"class":460},"language-ts",[261,462,463,467,471,474,477,480,484],{"class":263,"style":264},[261,464,466],{"style":465},"color:#CF222E;--shiki-dark:#FF7B72","import",[261,468,470],{"style":469},"color:#1F2328;--shiki-dark:#E6EDF3"," { hasHidden, hiddenCounts, planBudget, shownGroups, ",[261,472,473],{"style":465},"type",[261,475,476],{"style":469}," BudgetGroup } ",[261,478,479],{"style":465},"from",[261,481,483],{"style":482},"color:#0A3069;--shiki-dark:#A5D6FF"," \"readerly\u002Fbudget\"",[261,485,486],{"style":469},";",[261,488],{"class":263,"style":264},[261,490,491,494,498,501,505,508,511],{"class":263,"style":264},[261,492,493],{"style":465},"const",[261,495,497],{"style":496},"color:#0550AE;--shiki-dark:#79C0FF"," groups",[261,499,500],{"style":465},":",[261,502,504],{"style":503},"color:#953800;--shiki-dark:#FFA657"," BudgetGroup",[261,506,507],{"style":469},"[] ",[261,509,510],{"style":465},"=",[261,512,513],{"style":469}," [",[261,515,516,519,522,525,528,531,534,536,538,540,542,545,548],{"class":263,"style":264},[261,517,518],{"style":469},"  { tier: ",[261,520,521],{"style":496},"1",[261,523,524],{"style":469},", header: ",[261,526,527],{"style":496},"40",[261,529,530],{"style":469},", rows: [",[261,532,533],{"style":496},"60",[261,535,172],{"style":469},[261,537,533],{"style":496},[261,539,172],{"style":469},[261,541,533],{"style":496},[261,543,544],{"style":469},"], detail: ",[261,546,547],{"style":496},"120",[261,549,550],{"style":469}," },",[261,552,553,555,558,560,562,564,567,569,571,573,576],{"class":263,"style":264},[261,554,518],{"style":469},[261,556,557],{"style":496},"2",[261,559,524],{"style":469},[261,561,527],{"style":496},[261,563,530],{"style":469},[261,565,566],{"style":496},"50",[261,568,172],{"style":469},[261,570,566],{"style":496},[261,572,544],{"style":469},[261,574,575],{"style":496},"80",[261,577,550],{"style":469},[261,579,580],{"class":263,"style":264},[261,581,582],{"style":469},"];",[261,584,585,587,590,593,597,600,603,606,609],{"class":263,"style":264},[261,586,493],{"style":465},[261,588,589],{"style":496}," units",[261,591,592],{"style":465}," =",[261,594,596],{"style":595},"color:#8250DF;--shiki-dark:#D2A8FF"," planBudget",[261,598,599],{"style":469},"(",[261,601,602],{"style":496},"20",[261,604,605],{"style":469},", groups, ",[261,607,608],{"style":496},"300",[261,610,611],{"style":469},");",[261,613,614,616,619,621,624],{"class":263,"style":264},[261,615,493],{"style":465},[261,617,618],{"style":496}," shown",[261,620,592],{"style":465},[261,622,623],{"style":595}," shownGroups",[261,625,626],{"style":469},"(groups, units);",[261,628,629,631,634,636,639],{"class":263,"style":264},[261,630,493],{"style":465},[261,632,633],{"style":496}," hidden",[261,635,592],{"style":465},[261,637,638],{"style":595}," hiddenCounts",[261,640,641],{"style":469},"(groups, shown);",[261,643,644,647,649,651,654,656,659],{"class":263,"style":264},[261,645,646],{"style":469},"console.",[261,648,293],{"style":595},[261,650,599],{"style":469},[261,652,653],{"style":496},"JSON",[261,655,434],{"style":469},[261,657,658],{"style":595},"stringify",[261,660,661],{"style":469},"(shown));",[261,663,664,666,668,670,672,674,676,679,682],{"class":263,"style":264},[261,665,646],{"style":469},[261,667,293],{"style":595},[261,669,599],{"style":469},[261,671,653],{"style":496},[261,673,434],{"style":469},[261,675,658],{"style":595},[261,677,678],{"style":469},"(hidden), ",[261,680,681],{"style":595},"hasHidden",[261,683,684],{"style":469},"(hidden));",[20,686,687,688,691,692,695,696,699,700,703,704,707,708,711],{},"Each ",[24,689,690],{},"BudgetGroup"," is one group of rows, such as every finding of one code. ",[24,693,694],{},"tier"," orders groups, lower first. ",[24,697,698],{},"header"," is the group's heading at its longest, ",[24,701,702],{},"rows"," the size of each row, and ",[24,705,706],{},"detail"," what showing every row in detail would add. ",[24,709,710],{},"fixed"," is what the head and footer cost, here 20.",[20,713,714,715,717],{},"Here the tier 1 group fits with all three rows, 240 characters with ",[24,716,710],{},". The tier 2 header and its first row would take 90 more and pass 300, so the plan stops. The script prints:",[254,719,720],{"language":140,"class":256,"wrap":14},[24,721,722,268,727],{"class":259},[261,723,724],{"class":263,"style":264},[261,725,726],{},"[{\"header\":true,\"rows\":3,\"detail\":false},{\"header\":false,\"rows\":0,\"detail\":false}]",[261,728,729],{"class":263,"style":264},[261,730,731],{},"{\"groups\":1,\"rows\":2,\"detail\":5} true",[20,733,734,735,49,738,741],{},"Detail is added only when nothing else is hidden, one whole group at a time. ",[24,736,737],{},"hasHidden(hidden)",[24,739,740],{},"true"," when any group, row or detail is left out.",[20,743,744,745,434],{},"Next: ",[43,746,748],{"href":747},"\u002Fguide\u002Fprompts","Prompts and input",[750,752,753,754,755,756],{"id":31,"depth":751,"text":35},2,{"id":192,"depth":751,"text":195},{"id":246,"depth":751,"text":249},{"id":313,"depth":751,"text":316},{"id":390,"depth":751,"text":393},{"id":437,"depth":751,"text":440},{"path":758,"title":759,"description":760},"\u002Fguide\u002Fdiagnostics","Diagnostics","The DiagnosticRecord fields, the out.error, warn, info and diagnostic calls, and how text and agent output print each finding and the verdict line.",{"path":747,"title":748,"description":762},"How out.ask and out.confirm get a value from a flag, --input, an env var, a prompt or a default, and when they stop with action_required.",1795985392872,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]