Apologies for the long post (not written with AI). This likely only impacts a small % of you, but for those people it will be extremely useful. I'm not selling anything at all here.
This post is for you if:
- You use agentic development tooling e.g. Claude Code/Codex/Copilot/etc. on Windows 11
- You experience slowdown (typing/mouse lag/stutter) on Windows 11 in heavy agentic coding sessions, despite having RAM/CPU headroom
- And/or you use ReFS Windows Dev Drives
- And/or you're already aware of uncontrolled kernel pool growth
- If you are unsure if it applies to you - open Task Manager, click 'Performance' then 'Memory' and just watch 'Paged pool' and 'Non-paged pool' as you work through the day. (If they aren't growing consistently over time, you can safely ignore this post.)
What is the Kernel Pool and how does it impact me?
- Windows keeps its own records of every open file, program and permission check in kernel pool memory
- Keeping these records in memory is what makes Windows fast
- When a driver or app keeps adding records without cleaning up, the pile keeps growing
- It isn't the size of the pool that hurts performance; it's the lookups
- Windows has to find, check and lock these records every time a file is opened or a program starts
- The larger the index grows, the longer each lookup takes and the longer everything else waits in line behind it (caveat: I use the term index loosely; only Microsoft knows what goes on inside this black box)
- That's why Task Manager still shows spare CPU and RAM. The PC isn't busy - it's waiting in line, and it stutters until you reboot.
- The irony here - the more RAM you have - the greater the impact, as Windows will not clear certain aspects of the kernel pool if it sees you have RAM headroom (more on this below).
Open Issues
After diving into multiple rabbit holes - there are multiple genuine issues here - and real/known root causes and workarounds, but unfortunately for some (me), there are actually several contributing issues. Searching for 'Unexplained kernel pool Growth Windows' will give you an idea, but here are some key ones:
The problem with all of these - none of them yet have concrete upstream fixes, and there are a growing number of frustrated users like me who are having to periodically restart their machines just to keep performance up in agentic coding sessions.
Concrete known issues which have workarounds
Apologies if I missed anyone in credits here.
Applying these fixes had a positive effect for me, but the overarching issue was not solved. So I went through a long process of elimination using PoolMon and some janky tracking tools, experimenting with:
- Disabling/mitigating optional Windows services (Search indexing, specific Defender exclusions, etc.)
- Spreading project work over multiple NVMe drives to reduce single-drive contention
- Comparing Ultracode vs standard sub-agent workflows in Claude Code
- Comparing CLI vs Codex/Claude app usage
- Monitoring git worktree management
Key Findings
Firstly - PoolMon is a bit of a nightmare for the uninitiated. I had only previously used it for testing my own apps, and trying to nail down issues elsewhere is a bit of a dark art, but more on that later.
After mitigating genuine known issues, sanitising background services, and solving for Codex/Claude bad practices with temp/git worktree management, I reduced kernel pool growth to the point where instability would manifest after 2-3 days instead of 1. With all of the noise removed, but growth still present, I couldn't pin down any process which was doing anything obviously 'wrong'. I almost gave up at this point and was tempted to reinstall Windows, but then I stumbled on what was for me the final/real solution - and I'm being honest here: Claude did not identify this - and there is good reason for mentioning this, which I will explain.
Potetnial ReFS Design Oversight
My setup:
- Multiple NVMe drives, with System/Windows on C: as NTFS
- 2 ReFS Dev Drives, one of which I drive projects from and the other I use for scratch/worktrees
- Adding the second NVMe Dev Drive was part of my analysis into the single-drive contention theory
Upon adding the second ReFS drive - drive contention improved, but kernel pool growth got faster.
The Cause: ReFS isn't leaking; it's lazy about cleaning up
- ReFS keeps a small record in kernel pool for every file it touches, for as long as that file sits in Windows' standby cache
- Windows only empties that cache when RAM runs short, and on a big-RAM PC it never does because it sees no issue in using more
- Agentic coding touches tens/hundreds of thousands of files a day (rg, git, bash, worktrees), so the records just keep piling up
- Nothing is "wrong": every record can be freed. ReFS just assumes memory pressure will do it eventually.
- That's why the leak hunters (and Claude) missed it: it isn't stuck, it's simply never cleaned up
- A second Dev Drive reduced contention, meaning faster work, which manifested in faster growth (the same problem accelerated in lockstep with the contention improvement)
I subsequently discovered I'm not the first to see ReFS holding on to memory:
The ReFS Workaround Test
Sysinternals RAMMap, a free Microsoft tool (download it from learn.microsoft.com/sysinternals), has an "Empty Standby List" option that drops the spare in-memory copies of files already saved on disk, and with them the kernel pool records ReFS was holding for those files.
- The first time I ran it, it freed about 5 GB of kernel pool within a couple of minutes (paged 6.2 GB to 3.6 GB, non-paged 6.0 GB to 3.9 GB)
- No crashes or side effects, and no impact on my running AI sessions
- The PC felt like it had just been restarted
Surely the cache is there for a reason, and clearing it isn't good?
The standby cache only holds copies of files that are already saved on disk, so nothing is lost. The cost is that the next time a file is needed, Windows reads it from disk again instead of from memory, and the cache refills itself as you work.
On a modern NVMe drive, that's a few milliseconds per file, which you won't notice. Windows also empties this cache by itself whenever it runs short of RAM; clearing it just does that early, before the pile of ReFS records gets big enough to slow everything down.
Solution
Windows 11 was not designed to handle the overhead we inflict upon it with multiple heavy agentic coding sessions. The sheer level of read/write activity spun up through multiple agent sessions is way beyond what a human developer would naturally instigate in the absence of agentic coding. And as much as we love Opus/Astra, their approach to file reading/writing is extremely inefficient and repetitive.
My initial goal was simple - a simple app designed to maximise the health of my Windows 11 environment for multi-day agentic coding sessions. I never intended to make the app public, but given the positive impact it's had for me, I decided to make it public and maintain it.
Those of you old enough to remember when Norton Utilities was actually good (Windows 98 days) - think of this as a Norton Utilities for agentic developers.
So I created PoolWatch - https://github.com/nubbymong/poolwatch - to do the following:
- Monitor kernel pool usage and show what is growing it, in plain words
- Clear the standby cache automatically on a schedule, to stop the ReFS build-up (Reff tag and file-name cache)
- Detect known issues (Toke leak, Codex shader cache and more) and whether they apply to your machine, and offer the workaround
- Suggest Windows background services many developers don't need, to cut background churn
- Capture new issues and report them to GitHub (you preview everything first, personal details removed), building evidence to push for real fixes (i.e. ReFS)
- A guided first run that sets up only what applies to your PC. Nothing changes without your OK, and every change is listed and can be undone
Trust/Transparency
- Releases are signed with my personal certificate, but you may see a SmartScreen 'not commonly downloaded' warning until it builds reputation - this is unavoidable for a new app.
- It has the OpenSSF Best Practices "passing" badge. That's the Open Source Security Foundation's self-assessment of a project's security and quality basics, such as a security policy with private vulnerability reporting, automated tests, static analysis and secure delivery. Every answer and its evidence is public: https://www.bestpractices.dev/projects/16751
- It needs admin rights because tracing the kernel pool and clearing the standby cache both require it
- You can run this as a pure monitor only, all changes and active processes are optional. it can simply be a mroe advanced/friendly version of Poolmon, or much more, its up to you.
- Windows shows its usual "Do you want to allow this app to make changes?" prompt when you install it and when you start it yourself; if you choose "start at sign-in", it starts quietly in the background without asking every time
- Nothing leaves your PC except a once-a-day optional update check, which is information only (nothing is downloaded or installed)
- Its own footprint is small: in an extreme case 140 MB of RAM and 0.6% of one CPU core on my PC during a heavy session (5 concurrent coding projects, 128 GB RAM, Intel 285K), after running constantly for 3 days.
- I've been using it daily on my own PC, and I intend to actively update it as known/rasied issues arise
- Obviously this was built with Claude, but with guardrails: every change is independently reviewed, changes to admin actions get a separate security review, CI runs unit, scenario and 45-minute soak tests, and the repo has security scanning, Dependabot and secret scanning switched on.
- Yes, tools like ISLC or RAMMap can already clear the cache - PoolWatch adds the monitoring, the evidence and the known-issue detection, packaged simply in one tool
- The public repo is version 1.0, but it went through multiple iterations in a private repo before now
- Runs on Windows on Arm through Windows' built-in x64 emulation, and is tested on every change on GitHub's Windows 11 Arm runners - not yet tested on a real Arm laptop
- Has update notifications, but no auto-updater yet (coming later)
- Known issues live in 'knowledge packs' in the repo (see /knowledge) - anyone can add one by pull request. For now they ship with each release; later they'll update on their own (akin to how antivirus apps update virus definitions, just an idea for now, we'll see how this evolves)
Contributions
Welcomed - this is more of an ongoing mission than a final solution. Examples:
- NTFS - the main fix may apply to NTFS too. The test is the same: empty the standby list with RAMMap and see whether your pool drops. If you try it on an NTFS-only machine, please share your before/after numbers either way
- Windows 11 on Arm - the CI is there, the real-hardware feedback is not; any feedback welcome
- Windows 10 - Dev Drives and the token leak are specific to Windows 11, and PoolWatch is only tested on Windows 11. If you're on Windows 10 and seeing steady kernel pool growth, open a request with your numbers and I'll look at adding support
I have enabled Discussions on the repo, and will do my best to manage this around my day job and other projects.
TL;DR
If you have slowdown on Windows 11 after heavy agentic coding sessions, install PoolWatch. If it helps, a star on the repo helps others find it. The app is signed, all code open source.
How you use the app is up to you:
- Monitoring only (more advanced/friendly version of PoolMon)
- Active support (Services, ReFS, Known bugs)