Skip to content

Commit 491a52f

Browse files
bfowlerclaude
andcommitted
docs(shared): document the per-scan PATH listing snapshot
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 2d61009 commit 491a52f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/shared/src/shell.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,10 @@ const PathDirectoryListings = Context.Reference<
534534
* Run a batch of command lookups (such as editor discovery) that lists each
535535
* PATH directory once and only probes names the listing contains, instead of
536536
* stat-ing every PATH x PATHEXT candidate per command. A single lookup is
537-
* cheaper without it. Each run lists afresh, so later batches see new installs.
537+
* cheaper without it. Listings are a snapshot for the run: a command installed
538+
* into a directory after the run listed it is missed until the next run, and
539+
* that miss is cached like any other. Accepted for the tens of thousands of
540+
* stats this saves on long Windows PATHs.
538541
*/
539542
export const withPathDirectoryListings = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
540543
Effect.gen(function* () {

0 commit comments

Comments
 (0)