DedrooM: loop detection + context compression for Claude Code (open source)
I kept running into the same two problems with Claude Code on longer sessions: it'd get stuck retrying a failing command in a near-identical loop, and tool output (file listings, logs, diffs) would pile up in context even after it stopped being useful. Both quietly ran up the token bill. So I built

I kept running into the same two problems with Claude Code on longer sessions: it'd get stuck retrying a failing command in a near-identical loop, and tool output (file listings, logs, diffs) would pile up in context even after it stopped being useful. Both quietly ran up the token bill. So I built DedrooM โ a small proxy that sits in front of Claude Code (and a few other agents: Codex, Aider, Cursor, Cline, OpenCode) and does two things: Stops loops before they compound. Tracks repeated tool calls with an adaptive window, tightens up automatically once error rate climbs, and blocks a call outright if it's clearly stuck. It's one command to try: bashpip install dedroom dedroom unwrap claude puts things back to normal. It's Apache 2.0, source is here: https://github.com/Devaretanmay/dedroom Being upfront about the numbers: the compression/savings figures in the README are from a handful of internal test scenarios, not a big benchmark suite โ real savings depend a lot on your workload (loop-prone sessions and repetitive tool output benefit a lot more than a clean session does). I'd rather you try it and tell me it doesn't do much for your setup than oversell it here. Would genuinely like feedback from people running long Claude Code sessions โ especially if it either catches something useful or gets in your way. Happy to answer questions about how the loop detection or compression actually works under the hood.
Key Takeaways
- โขI kept running into the same two problems with Claude Code on longer sessions: it'd get stuck retrying a failing command in a near-identical loop, and tool output (file listings, logs, diffs) would pile up in context even after it stopped being useful
- โขThis story was reported by Dev.to, covering developments in the dev space.
- โขAI advancements continue to reshape industries โ read the full article on Dev.to for complete coverage.
๐ Continue reading the full article:
Read Full Article on Dev.to โShare this article



