[{"data":1,"prerenderedAt":477},["ShallowReactive",2],{"article-\u002Fblog\u002Fcontext-churn-and-the-sisyphus-loop":3},{"id":4,"title":5,"author":6,"body":7,"date":458,"description":459,"extension":460,"featured":461,"logId":462,"meta":463,"navigation":359,"path":466,"published":359,"readingTime":467,"sector":468,"seo":469,"stem":470,"tags":471,"__hash__":476},"blog\u002Fblog\u002Fcontext-churn-and-the-sisyphus-loop.md","Context Churn & The Loop of Sisyphus: Auditing AI Agent Thrash","RetroAgile Systems Architecture",{"type":8,"value":9,"toc":449},"minimark",[10,14,18,21,29,32,69,79,82,87,90,95,98,101,105,108,112,121,125,132,153,395,398,402,405,442,445],[11,12,5],"h1",{"id":13},"context-churn-the-loop-of-sisyphus-auditing-ai-agent-thrash",[15,16,17],"p",{},"In ancient Greek mythology, King Sisyphus rolled a colossal boulder up a hill, only to watch it roll back down.",[15,19,20],{},"In modern agentic software development, engineering teams pay frontier LLMs to repeat that cycle hundreds of times per sprint.",[15,22,23,24,28],{},"We call this phenomenon ",[25,26,27],"strong",{},"Context Churn",".",[15,30,31],{},"It occurs when an autonomous coding agent, confronted with contradictory requirements, unstated dependencies, or hidden side-effects, enters an oscillating loop of self-correction:",[33,34,35,43,49,58,66],"ol",{},[36,37,38,39,28],"li",{},"Agent implements Feature A in ",[40,41,42],"code",{},"auth.ts",[36,44,45,46,28],{},"Existing unit test fails in ",[40,47,48],{},"billing.ts",[36,50,51,52,54,55,28],{},"Agent modifies ",[40,53,48],{}," to satisfy Feature A, inadvertently breaking ",[40,56,57],{},"tenant.ts",[36,59,60,61,63,64,28],{},"Agent attempts to fix ",[40,62,57],{},", forgets initial constraints from Step 1, and reverts ",[40,65,42],{},[36,67,68],{},"The cycle repeats until context limits trigger compaction or maximum tool calls exhaust the budget.",[70,71,77],"pre",{"className":72,"code":74,"language":75,"meta":76},[73],"language-text","[TELEMETRY STREAM \u002F\u002F LOOP OSCILLATION DETECTED]\nFile: src\u002Fservices\u002Fauth.ts (Modified: 14 times across 22 turns)\nFile: src\u002Fservices\u002Fbilling.ts (Modified: 11 times across 22 turns)\nNet Code Delta: +18 lines (Gross code churn: 1,420 lines modified \u002F reverted)\nTotal Token Ingestion: 340,000 tokens\nCost Incurred: $10.20 for an 18-line diff\nVerdict: REPETITIVE CONTEXT THRASHING\n","text","",[40,78,74],{"__ignoreMap":76},[15,80,81],{},"To traditional project management tools, this sprint task looked active and healthy: commits appeared every four minutes. In reality, the agent was stuck in a feedback loop.",[83,84,86],"h2",{"id":85},"the-anatomy-of-agent-thrash","The Anatomy of Agent Thrash",[15,88,89],{},"Why do autonomous agents thrash? Through telemetry audits across hundreds of repositories, agent churn traces back to three structural failures:",[91,92,94],"h3",{"id":93},"_1-inverted-feedback-signals","1. Inverted Feedback Signals",[15,96,97],{},"When human developers get stuck, they step back, ask a colleague for clarification, or challenge the ticket requirements.",[15,99,100],{},"An LLM agent cannot challenge ambiguous human intent unless explicitly instructed to stop. Instead, it assumes the specification is absolute ground truth and the test harness is broken. It begins mutating surrounding codebase infrastructure: mocking away failing tests, creating redundant wrappers, or silently disabling type checkers.",[91,102,104],{"id":103},"_2-cascading-context-compaction","2. Cascading Context Compaction",[15,106,107],{},"As the conversation transcript grows beyond 60,000 tokens, system prompts and original acceptance criteria suffer from attention decay. The agent prioritizes the most recent compiler error message over the original architectural design.",[91,109,111],{"id":110},"_3-missing-structural-guardrails","3. Missing Structural Guardrails",[15,113,114,115,120],{},"Without deterministic linters and immutable database contracts, the agent treats your entire codebase as malleable clay. Providing an ",[116,117,119],"a",{"href":118},"\u002Fblog\u002Finternal-developer-platform-for-coding-agents","agent-ready internal developer platform"," with isolated database branches prevents speculative migrations from polluting shared environments.",[83,122,124],{"id":123},"auditing-churn-with-continuous-telemetry","Auditing Churn with Continuous Telemetry",[15,126,127,128,131],{},"RetroAgile replaces passive burndowns with real-time ",[25,129,130],{},"Agent Churn Indexes",". By streaming Git commits and AST diffs directly into our telemetry pipeline, we track:",[133,134,135,141,147],"ul",{},[36,136,137,140],{},[25,138,139],{},"Touch Frequency \u002F File Ratio",": A healthy agent feature branch touches a file 1.2 to 2.1 times. Any ratio above 4.0 indicates circular thrashing.",[36,142,143,146],{},[25,144,145],{},"Reversion Velocity",": The rate at which an agent undoes its own previous tool calls within the same branch.",[36,148,149,152],{},[25,150,151],{},"Review Turnaround Latency",": Measuring how long human architects take to approve modular sub-PRs versus monolithic diffs.",[70,154,158],{"className":155,"code":156,"language":157,"meta":76,"style":76},"language-typescript shiki shiki-themes github-dark-default","\u002F\u002F Telemetry Churn Formula\nexport function calculateChurnIndex(branchEvents: GitTelemetryEvent[]): number {\n  const touchesByFile = groupTouches(branchEvents);\n  const reverts = detectReversions(branchEvents);\n  \n  const thrashScore = Object.values(touchesByFile).reduce((acc, count) => {\n    return acc + (count > 2 ? Math.pow(count - 2, 1.8) : 0);\n  }, 0);\n\n  return normalizeScore(thrashScore + reverts.length * 2.5);\n}\n","typescript",[40,159,160,169,209,227,242,248,290,343,354,361,389],{"__ignoreMap":76},[161,162,165],"span",{"class":163,"line":164},"line",1,[161,166,168],{"class":167},"sH3jZ","\u002F\u002F Telemetry Churn Formula\n",[161,170,172,176,179,183,187,191,194,197,200,202,206],{"class":163,"line":171},2,[161,173,175],{"class":174},"suJrU","export",[161,177,178],{"class":174}," function",[161,180,182],{"class":181},"sc3cj"," calculateChurnIndex",[161,184,186],{"class":185},"sZEs4","(",[161,188,190],{"class":189},"sQhOw","branchEvents",[161,192,193],{"class":174},":",[161,195,196],{"class":189}," GitTelemetryEvent",[161,198,199],{"class":185},"[])",[161,201,193],{"class":174},[161,203,205],{"class":204},"sFSAA"," number",[161,207,208],{"class":185}," {\n",[161,210,212,215,218,221,224],{"class":163,"line":211},3,[161,213,214],{"class":174},"  const",[161,216,217],{"class":204}," touchesByFile",[161,219,220],{"class":174}," =",[161,222,223],{"class":181}," groupTouches",[161,225,226],{"class":185},"(branchEvents);\n",[161,228,230,232,235,237,240],{"class":163,"line":229},4,[161,231,214],{"class":174},[161,233,234],{"class":204}," reverts",[161,236,220],{"class":174},[161,238,239],{"class":181}," detectReversions",[161,241,226],{"class":185},[161,243,245],{"class":163,"line":244},5,[161,246,247],{"class":185},"  \n",[161,249,251,253,256,258,261,264,267,270,273,276,279,282,285,288],{"class":163,"line":250},6,[161,252,214],{"class":174},[161,254,255],{"class":204}," thrashScore",[161,257,220],{"class":174},[161,259,260],{"class":185}," Object.",[161,262,263],{"class":181},"values",[161,265,266],{"class":185},"(touchesByFile).",[161,268,269],{"class":181},"reduce",[161,271,272],{"class":185},"((",[161,274,275],{"class":189},"acc",[161,277,278],{"class":185},", ",[161,280,281],{"class":189},"count",[161,283,284],{"class":185},") ",[161,286,287],{"class":174},"=>",[161,289,208],{"class":185},[161,291,293,296,299,302,305,308,311,314,317,320,323,326,328,330,333,335,337,340],{"class":163,"line":292},7,[161,294,295],{"class":174},"    return",[161,297,298],{"class":185}," acc ",[161,300,301],{"class":174},"+",[161,303,304],{"class":185}," (count ",[161,306,307],{"class":174},">",[161,309,310],{"class":204}," 2",[161,312,313],{"class":174}," ?",[161,315,316],{"class":185}," Math.",[161,318,319],{"class":181},"pow",[161,321,322],{"class":185},"(count ",[161,324,325],{"class":174},"-",[161,327,310],{"class":204},[161,329,278],{"class":185},[161,331,332],{"class":204},"1.8",[161,334,284],{"class":185},[161,336,193],{"class":174},[161,338,339],{"class":204}," 0",[161,341,342],{"class":185},");\n",[161,344,346,349,352],{"class":163,"line":345},8,[161,347,348],{"class":185},"  }, ",[161,350,351],{"class":204},"0",[161,353,342],{"class":185},[161,355,357],{"class":163,"line":356},9,[161,358,360],{"emptyLinePlaceholder":359},true,"\n",[161,362,364,367,370,373,375,378,381,384,387],{"class":163,"line":363},10,[161,365,366],{"class":174},"  return",[161,368,369],{"class":181}," normalizeScore",[161,371,372],{"class":185},"(thrashScore ",[161,374,301],{"class":174},[161,376,377],{"class":185}," reverts.",[161,379,380],{"class":204},"length",[161,382,383],{"class":174}," *",[161,385,386],{"class":204}," 2.5",[161,388,342],{"class":185},[161,390,392],{"class":163,"line":391},11,[161,393,394],{"class":185},"}\n",[15,396,397],{},"When an agent's Churn Index crosses the warning threshold, RetroAgile automatically triggers a circuit breaker, halts the autonomous task, and notifies the human architect with exact telemetry on where the specification stalled.",[83,399,401],{"id":400},"the-solution-circuit-breakers-atomic-scopes","The Solution: Circuit Breakers & Atomic Scopes",[15,403,404],{},"How do you eliminate context churn permanently?",[33,406,407,413,436],{},[36,408,409,412],{},[25,410,411],{},"Max Re-touch Quotas",": Restrict agents to a maximum of 3 edits per file per sub-task. If a test is not passing after 3 iterations, the problem is not syntax—it is architecture.",[36,414,415,418,419,425,426,430,431,435],{},[25,416,417],{},"Atomic Contract PRs",": Never task an agent with building an entire subsystem in one pass. Task it with defining the database schema and ",[116,420,424],{"href":421,"rel":422},"https:\u002F\u002Fmihailtd.github.io\u002Fgraphpg\u002F",[423],"nofollow","GraphPG"," subscription interface first, then implement the worker in an isolated sub-PR. Pair contracts with ",[116,427,429],{"href":428},"\u002Fblog\u002Fdeath-of-the-13-point-ticket","spec-readiness scoring"," and ",[116,432,434],{"href":433},"\u002Fblog\u002Fdora-metrics-for-coding-agents","agentic DORA metrics"," to evaluate delivery health.",[36,437,438,441],{},[25,439,440],{},"Continuous Retrospective Audits",": Review your sprint's Churn Index every Friday. If one module consistently induces agent thrash, that module has architectural debt that needs human refactoring.",[15,443,444],{},"Stop paying for LLM circular reasoning. Audit agent telemetry, enforce circuit breakers, and keep your agents moving forward.",[446,447,448],"style",{},"html pre.shiki code .sH3jZ, html code.shiki .sH3jZ{--shiki-default:#8B949E}html pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}html pre.shiki code .sc3cj, html code.shiki .sc3cj{--shiki-default:#D2A8FF}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}html pre.shiki code .sQhOw, html code.shiki .sQhOw{--shiki-default:#FFA657}html pre.shiki code .sFSAA, html code.shiki .sFSAA{--shiki-default:#79C0FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":76,"searchDepth":171,"depth":171,"links":450},[451,456,457],{"id":85,"depth":171,"text":86,"children":452},[453,454,455],{"id":93,"depth":211,"text":94},{"id":103,"depth":211,"text":104},{"id":110,"depth":211,"text":111},{"id":123,"depth":171,"text":124},{"id":400,"depth":171,"text":401},"2026-11-02","Measuring the hidden token and latency costs of ambiguous specifications when agents touch the same files 14 times in circular regression.","md",false,"DISPATCH-002",{"type":464,"canonical":465},"article","https:\u002F\u002Fretroagile.com\u002Fblog\u002Fcontext-churn-and-the-sisyphus-loop","\u002Fblog\u002Fcontext-churn-and-the-sisyphus-loop","6 min","AGENT_TELEMETRY",{"title":5,"description":459},"blog\u002Fcontext-churn-and-the-sisyphus-loop",[472,473,474,475],"agent churn","token burn","telemetry","developer experience","DqUWVYul1XvwUiAO4jSElRvZQhTAdwY90IbbKsRmYCk",1794728603659]