Fetching latest headlines…
DedrooM: loop detection + context compression for Claude Code (open source)
NORTH AMERICA
πŸ‡ΊπŸ‡Έ United Statesβ€’July 6, 2026

DedrooM: loop detection + context compression for Claude Code (open source)

1 views0 likes0 comments
Originally published byDev.to

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.
Compresses redundant tool output before it hits the model β€” truncates repetitive stuff like long file listings, dedupes logs, keeps the parts that actually matter.

It's one command to try:

bashpip install dedroom
dedroom wrap claude

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.

Comments (0)

Sign in to join the discussion

Be the first to comment!