frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Stop Claude Code from compacting mid-task

https://github.com/LippInc/catnap
2•LippInc•1h ago
I run long sessions with Claude. For a long time I've had Claude in the middle of some difficult coding task, and then I see the auto-compact message pop up. Every time I wonder if Claude actually picks everything up correctly and nothing is lost. Claude told me 78/82 auto-compactions landed while Claude was working. For a while I couldn't do much. At first I made a skill that would make Claude explicitly save progress throughout long runs. But that didn't fix the core problem and cost more tokens as well. Now that mods came out, I fixed the actual problem.

catnap tells Claude at 50% context what the context is and that it should finish what it's working on, write a handoff, and then initialize compaction itself. When Claude finishes its task, catnap compacts, and Claude can then pick up work again. The handoff replaces Claude Code's default summary, so we don't do similar work twice. If Claude for some reason doesn't compact before 60%, it gets a stricter note. And Claude Code's default auto-compact kicks in at 70% as a backstop. The 3 numbers are all settings.

After I took on catnap, 0 of 129 naps came mid-task: 98 of them in benchmarks and 31 in my own sessions.

The cost is the same as the default auto-compact kicking in at the same point, in tokens and dollars, on 200K and 1M context windows. Compared to the default auto-compaction that kicks in when context is nearly full, catnap used 56% fewer tokens. But lowering the default auto-compact will get you most of the way there as well.

I measured memory today as well. Claude worked through tasks one message at a time while 20 instructions and facts were said in the chat, inside long chatty messages, and nowhere else. Asked right after compaction to list them from memory, no file reads: all 20 were listed with catnap and with the default compaction, in every run (15 with catnap, 5 with the default). So in my tests the memory was exactly the same, but catnap got there with a handoff 60% shorter (4.0K tokens against 10K).

I was surprised that catnap is actually faster than the default option. This wasn't even one of the reasons I wanted to make this, it just happened. Since Claude writes the handoff in one go instead of the separate summary call the default makes, and the note is shorter, tasks finish sooner: measured end to end, 406 seconds instead of 464.

Try it with nothing installed:

  npx github:LippInc/catnap
It prints how often auto-compact cut in mid-task in your own logs (reads numbers only, sends nothing).

Install (needs Claude Code 2.1.287 or later, where mods are on by default):

  claude plugin marketplace add LippInc/catnap
  claude plugin install catnap@lippinc
Currently Claude Code only, tested on Windows and Linux. The memory test used made-up coding tasks on a 200K window.

Some related tools: compact-adviser, handoff-compact, session-pilot and sub-agent-compact. What catnap adds: Claude finishes its piece first, and the numbers on where the cut lands.

The Kevin Bacon

https://pudding.cool/2026/10/kevin-bacon/
1•xnx•47s ago•0 comments

Self-contained GLM-5 serving stack: Just Vx kernels compiled to PTX

https://github.com/vx-lang/glm-vx
1•adityazero•1m ago•0 comments

Social dynamics of toxic metal industry in medieval Europe

https://www.cambridge.org/core/journals/antiquity/article/social-dynamics-of-toxic-metal-industry...
2•XzetaU8•4m ago•0 comments

Gradium open-sourced its on-device TTS

https://gradium.ai/phonon
1•IsaacZerh•4m ago•0 comments

Show HN: Hackingscreenfake.com- Fake Hacking Screen Simulator/Prank Tool

https://hackingscreenfake.com/
1•TechDevArchitec•5m ago•1 comments

SoloMCN – Claude Code as the runtime for a one-person video studio

https://github.com/ymybxx/SoloMCN
1•noequal666•6m ago•0 comments

Is it possible to be bigger than a Blue Whale?

https://www.reddit.com/r/askscience/comments/1x6umva/comment/ph5u2bh/
1•mooreds•6m ago•0 comments

Show HN: Skillsync – Coding agent memory but it's just search

https://skillsync.com
1•cat-whisperer•6m ago•0 comments

My Thinking about School Reform Has Changed over Decades (Part 1)

https://larrycuban.wordpress.com/2026/10/20/how-my-thinking-about-school-reform-has-changed-over-...
1•Tomte•6m ago•0 comments

The Technopolitics of Ad-Tech

https://pluralistic.net/2026/10/19/spying-v-context/
1•hn_acker•7m ago•0 comments

Kash Patel's FBI stats are bolstered by arrests made by state and local agencies

https://www.ms.now/news/crime-stats-touted-kash-patel-arrests-state-local-agencies
2•hn_acker•7m ago•1 comments

A photo of a patient's face could predict whether they'll survive cancer

https://www.washingtonpost.com/health/2026/10/20/how-photo-patients-face-could-predict-whether-th...
1•elo2000•7m ago•0 comments

The Gospel According to Peter (Thiel)

https://www.theverge.com/tech/1014252/peter-thiel-antichrist-lectures-analysis
1•pavel_lishin•7m ago•0 comments

The Download: the claim shaking up AI and the internet's agent problem

https://www.technologyreview.com/2026/10/20/1147355/the-download-claim-shaking-up-ai-internet-age...
1•joozio•8m ago•0 comments

Show HN: Contrack – Self-hosted contact manager and people search

https://github.com/arvarik/contrack
2•arvarik•9m ago•0 comments

Go Conventions That Clicked Too Late for an AI Engineer

https://towardsdev.com/10-go-conventions-that-clicked-too-late-for-an-ai-engineer-78319f2d538f?sk...
2•cheikhdev•11m ago•0 comments

Parametric Error Rendering and Interactive Diagnostics

https://gavinleroy.com/writings/posts/errors-diagnostics-interaction/
1•yorelnivag•11m ago•0 comments

Stop Waiting on a Failed Build

https://devblogs.microsoft.com/visualstudio/stop-waiting-on-a-failed-build/
1•ibobev•12m ago•0 comments

Scope Creep

https://www.gridbugs.org/scope-creep/
2•ibobev•13m ago•0 comments

Alignment is correct, safe, reproducible behavior under explicit constraints

https://getswiftapi.com
2•rayanpal_•14m ago•0 comments

Show HN: My attempt to get Claude to run a business

https://pagecritic.app/
1•diegoaad•14m ago•0 comments

Roguelike Tutorial 2020

https://www.gridbugs.org/roguelike-tutorial-2020/
1•ibobev•14m ago•0 comments

Compound Memory Models

https://www.sigarch.org/compound-memory-models/
1•matt_d•22m ago•0 comments

Citrini Therapeutics

https://www.citriniresearch.com/p/citrini-therapeutics
1•nycdatasci•22m ago•0 comments

Whoops: Grok Bot Spills Tech CEO's Bank Data in Public Slack

https://www.techdirt.com/2026/10/19/whoops-grok-bot-spills-tech-ceos-bank-data-in-public-slack/
5•speckx•22m ago•0 comments

Patch your Plex media server before someone hacks it

https://arstechnica.com/security/2026/10/recently-fixed-plex-media-vulnerabilities-are-being-expl...
2•PaulHoule•23m ago•0 comments

Ask HN: What is/was your strategy which landed you a JOB in this market?

1•shivang2607•23m ago•0 comments

Show HN: we made every cloud work like one giant computer

https://getovercast.com/
2•jperryjperry•24m ago•0 comments

Datacenters 2027: The Year of Acceleration, +50GW in a Single Year

https://newsletter.semianalysis.com/p/datacenters-2027-the-year-of-acceleration
2•bigwheels•24m ago•0 comments

Getting Agents to Tell on Themselves

https://blog.thinkst.com/2026/09/getting-agents-to-tell-on-themselves.html
1•mooreds•24m ago•0 comments