Windows and WSL¶
When agentgrep runs inside a WSL distro, it also searches the agents
installed on the Windows side. Claude desktop, Codex desktop, Cursor, VS Code,
and ChatGPT desktop keep their history under the Windows profile, which the
distro sees under /mnt/c/Users/<name>/. agentgrep finds each profile, adds
its stores to the same search, and prints the paths without the Windows
account name.
Detection is automatic: the probe runs only when /proc/version names a
WSL kernel, and only for directories that exist.
What is searched¶
Agent |
Windows location |
Searched as |
Default prompt search |
|---|---|---|---|
Claude Code (run by Claude desktop) |
|
Claude Code transcripts |
|
Claude desktop Cowork |
|
Claude Code transcripts, first messages, titles |
no; transcripts with |
Claude desktop Code tab |
|
session titles |
no, |
Codex desktop |
|
Codex sessions and SQLite state |
|
Cursor agent |
|
Cursor CLI transcripts |
|
Cursor IDE |
|
Cursor IDE state databases |
as on Linux |
VS Code Copilot Chat |
|
VS Code (GitHub Copilot Chat) chat sessions |
as on Linux |
ChatGPT desktop |
|
ChatGPT desktop conversation titles, scheduled-task prompts |
no, conversation scope |
The catalogue records each store’s Windows path in its win32 platform
variant, which get_store_descriptor and the backend pages show.
Claude desktop’s claude.ai chat client keeps only a rolling cache of a few
recently opened conversations in Chromium IndexedDB, catalogued as
claude.desktop_chat_cache and not searched; the full chat
history stays on Anthropic’s servers.
Other agents on Windows¶
Gemini CLI, Grok, Pi, OpenCode, and Antigravity CLI were not installed on the Windows host checked. Their Windows locations come from each tool’s source, which resolves its directory from the user’s home on Windows as on Linux:
Agent |
Windows location |
Override |
|---|---|---|
Gemini CLI |
|
|
Grok |
|
|
Pi |
|
|
OpenCode |
|
|
Antigravity CLI |
|
none documented |
Gemini CLI, Antigravity CLI, and Antigravity IDE all write under
%USERPROFILE%/.gemini, so that directory alone does not show which is
installed. The backend pages list each store’s win32 path.
Paths in output¶
A Windows path is shown with the profile prefix replaced by the Windows
variable that names it, the way a Linux path under your home starts with
~:
Real path |
Shown as |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Agents also name project folders after the working directory, which can carry an account name. Those encoded names are rewritten the same way:
Encoded folder name |
Shown as |
|---|---|
|
|
|
|
|
|
|
|
The rewrite applies to text, JSON, NDJSON, the TUI, and MCP results. To reach the real file:
Opaque result refs open it.
find -aprints real absolute paths in text output; JSON keeps the display form.
Two cases are left as is:
A single-component home such as
/rootencodes to a common word.A repository whose own name contains the account name keeps its name.
Inside an encoded folder name an account is recognized by name, since the encoding leaves no mark where a name ends, so agentgrep reads the profile names of every drive mounted under the automount root, not only the users directory it searches.
A printed path works as a path: query, and a printed working directory as a
cwd: query, so the Windows-side results can be selected or left out.
%APPDATA% and %LOCALAPPDATA% sit inside the profile, so
path:%USERPROFILE% covers them too. Only the Windows side:
$ agentgrep find 'path:%USERPROFILE%'
Everything except the Windows side:
$ agentgrep search 'NOT path:%USERPROFILE% deploy'
Over MCP, the same predicates go in search search‘s terms, and a returned
ref opens the real file through inspect_result search; see
MCP Windows-side search.
Choosing the Windows users directory¶
The users directory defaults to <automount root>/c/Users, where the
automount root is root in the [automount] section of /etc/wsl.conf
(/mnt/ when unset). Set AGENTGREP_WSL_USERS_ROOT when drive C: is
mounted elsewhere, or to search a different drive:
$ AGENTGREP_WSL_USERS_ROOT=/mnt/d/Users agentgrep find --agent codex
Point it at a directory that does not exist to turn the Windows probe off.
Copies of WSL sessions¶
Claude desktop runs a session that targets a WSL distro inside that
distro, so its transcript is written to the distro’s ~/.claude, and the
app keeps a copy under %USERPROFILE%/.claude/projects/ssh-<id>/ on
Windows. agentgrep skips a Windows copy when a transcript with the same
file name is already in the local ~/.claude/projects, so each session is
read once. Copies of sessions from other hosts are kept.
Speed¶
The Windows drive is a 9p network mount, where every stat is a round trip.
The default prompt search reads only each profile’s prompt-history files and
skips the desktop app directories. find and --exhaustive walk every
Windows-side transcript tree and overlap the stat calls on the mount. Off
WSL, none of this runs.
The figures below come from one WSL host where find lists 391 Windows-side
sources (most from a large Claude desktop install) and compare the main branch
(“before”) with commit c07f6f1 (“now”). They answer three questions in turn:
how many round trips a discovery pass makes on the mount, whether whole
commands got slower, and how long an exhaustive search over the Windows side
takes.
Operations on the mount¶
One discovery pass, counted by wrapping os.stat, os.scandir, and fd
calls on paths under the mount, so the counts do not depend on machine load:
Pass |
Windows sources |
|
|
Directory scans |
|
|---|---|---|---|---|---|
Prompt search, before |
1 |
39 |
39 |
2 |
0 |
Prompt search, now |
1 |
24 |
24 |
1 |
0 |
|
103 |
327 |
3.2 |
51 |
0 |
|
391 |
262 |
0.7 |
61 |
10 |
Prompt search makes 15 fewer stat calls and one fewer directory scan: the
backends that probe the Windows side (Claude, Codex, Cursor CLI, VS Code, and
Cursor IDE) share one listing of the Windows users directory per discovery
pass.
find lists 3.8 times as many Windows sources with fewer stat calls: it
never shows a modification time, so it skips the stat that reads one unless
a source predicate such as mtime: needs it.
Wall-clock time¶
Each row times the whole command over 8 rounds; every round runs both builds,
alternating which goes first, so a change in machine load lands on both. The
table gives the median with the range in brackets. “Before” is the main
branch, which runs 0.1.0a54’s code with updated dependencies, installed in its
own environment. The mount-hidden rows ran with an empty directory
bind-mounted over /mnt/c, standing in for a Linux machine. The host is
shared, so differences under about 10% are noise:
Command |
Before |
Now |
|---|---|---|
|
4.76 s (4.15–6.20) |
4.61 s (3.87–4.82) |
|
2.53 s (1.93–3.25) |
2.36 s (2.02–2.98) |
|
1.56 s (1.29–1.80) |
1.35 s (1.17–1.58) |
|
2.34 s (1.62–3.55) |
2.29 s (1.68–3.53) |
No median is slower, so reading the Windows side costs no wall-clock time
against the main branch on this host. With the mount hidden, find is faster
(1.35 s against 1.56 s), but the ranges overlap, so that is not claimed as a
speedup. The rows ran under heavy load from
other work (load average 12 to 21), which is why they are slower in absolute
terms than an idle machine would be. The benchmark harness gives a quicker
comparison against the main branch, but it times one build after the other,
so a change in machine load can hide or invent a gap of this size:
$ uv run scripts/benchmark.py run \
--head-vs-trunk \
--commands find,search-limit-1
Exhaustive search¶
An exhaustive search over the Windows-side Claude stores on the host above reads their transcripts after skipping the copies of WSL-distro transcripts (276 MB). Each figure is a single run on a shared machine:
Run |
Commit |
Sources |
Wall clock |
|---|---|---|---|
First read, Windows side reading from disk |
|
863 |
about 100 s |
Warm, right after |
|
863 |
about 35 s |
Warm |
|
868 |
about 19 s |
The two warm runs are not comparable: they ran at different commits and under different machine load, so the drop from 35 s to 19 s is not claimed as a speedup.
Cancelling or skipping the walk¶
A cancelled search stops the walk instead of finishing it in the background:
The profile listing and any running directory listing end, and no new
statstarts on the mount.Only the calls already in flight finish: at most 16, the size of the
statpool every search in the process shares. A single directory listing step cannot be interrupted, only the walk between steps.The same holds when an MCP client cancels
finddiscovery,list_sourcesdiscovery,filter_sourcesdiscovery,summarize_discoverydiscovery,recent_sessionssearch,inspect_resultsearch, orinspect_record_samplecatalog, or anagentgrep://sourcesread.
To leave the Windows side out entirely, point AGENTGREP_WSL_USERS_ROOT at a
missing directory. A NOT path:%USERPROFILE% filter drops the Windows-side
results but still walks the mount.
Python API¶
agentgrep.wsl exposes the same lookups:
host_user_profiles()
lists the Windows profiles, and its path type is a pathlib.PosixPath
whose str() is the real path while repr() and .display hide the account
name. Windows host paths from WSL has a runnable example.