Repository navigation
Conversation
Measurement only. On Windows the SessionStart row gains one key, interp_reparse, saying whether the interpreter that runs the hooks is reached through a symbolic link or junction: 1 executable path, 2 standard library path, 4 that path is under AppData, 8 could not be checked; 0 when neither is. Inside the packaged Claude Desktop app Windows leaks kernel memory on every file opened through such a link under AppData (a uv-managed Python is one), and every hook starts an interpreter. This sizes how many users that is. See anthropics/claude-code#96870. No process is started, no hook behaves differently, and no other row changes. The key is the last one of its row, so it never displaces another.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: nothing in the plugin's metrics says whether the Python that runs its hooks sits behind a symbolic link or junction on Windows. anthropics/claude-code#96870 reports that inside the packaged Claude Desktop app Windows leaks kernel memory on every file opened through such a link under AppData (a uv-managed Python is one), and every hook starts an interpreter, so the plugin's hooks add to that leak. How many users are in that situation is unknown.
After: the SessionStart row carries one more key on Windows,
interp_reparse, that says so. No behaviour changes.Measurement only: no hook does anything different, no process is started, and no other row changes.
How
interp_reparse_metric()inhooks/_base.pywalks the folders ofsys.executableandsys.base_prefixwith onelstateach, up to the first symbolic link or junction, and reports bits: 1 executable path through a link, 2 standard library path through a link, 4 that path is under%APPDATA%or%LOCALAPPDATA%as spelled, 8 a path could not be checked (including Python older than 3.8, which has no reparse tag)....\Microsoft\WindowsApps) and volumes mounted at a folder are not counted as links.ensure_agent_sdk.pyappends it as the last key of the SessionStart row, so it is the first key a row over the key cap loses and never displaces another. A healthy row stays within 10 keys.Implications
lstatcalls once per session on Windows.Tests
tests/test_interp_reparse_metric.py: 21 tests with the interpreter paths and file attributes passed in (regular install, junction and symlink under AppData, link elsewhere, only the standard library or only the executable behind a link, AppData itself moved by a link, app execution alias, mounted volume, unreadable folders, failures on one path, other systems, the SessionStart row and its key order).%APPDATA%to that install%LOCALAPPDATA%cpython-3.12-windows-...-none)No version bump.
Human: @mhegazy
Generated by Claude Code