Skip to content

~/.husk is created by doctor that says it is not, and deleting it does not reset husk on WSL #111

Description

@Hotragn

Two separate things, both about ~/.husk not being what it says it is. Filing together
because the fix is one pass over the same story.

1. doctor prints "not created yet" and then creates it

$ ls -la ~/.husk
ls: cannot access '.husk': No such file or directory

$ npx -y @husk-ai/cli doctor
husk 0.1.3  node 24.14.0 · win32-arm64
state: C:\Users\hotra\.husk  (not created yet)
...

$ ls -la ~/.husk
drwxr-xr-x cache/  computers/  data/  husks/  runs/  transcripts/  workspaces/

Seven directories, all timestamped at that run, and no other command had been run. So the
line is true when it is printed and false by the time the command exits.

The README is more specific than the line is: "Nothing is created until the first tool
call, so an installed husk that nobody uses costs nothing." doctor is not a tool call.
Someone who runs doctor to decide whether to keep husk has already been given a state
directory.

The cost is seven empty directories, so this is cosmetic in effect. It is in the honesty
surface, though, which is the part of husk I would least want to be loose.

While in there: ~/.husk/cache/ was empty after doctor, so provider probes are not
cached across invocations. That is consistent with
probeTtlMs = 30_000
being per-process, and with how the homepage phrases it ("an agent that creates four
machines in a row pays that once"). But a reader can easily take "provider probes are
cached for 30 seconds" to mean two husk commands in a row are cheap, and they are not.
Either the sentence or the cache should move.

2. "delete it to reset husk completely" is not true on WSL

The first-run banner:

  state      C:\Users\hotra\.husk (delete it to reset husk completely)

On the WSL path the workspaces live in the WSL home, which that directory does not
contain. The computer record says so itself:

"nativeId": "\\\\wsl.localhost\\Ubuntu\\home\\hotragn\\.husk\\workspaces\\cmp_2p6pgx38a4gt",
"husk.wslWorkspace": "/home/hotragn/.husk/workspaces/cmp_2p6pgx38a4gt"

~/.husk/workspaces/ on the Windows side stayed empty for the whole session.

I found this by moving ~/.husk aside to get a clean first run. It was not clean. Three
workspaces from earlier sessions were still inside WSL, and the ~/.husk I moved aside
held exactly one computer record:

$ wsl -d Ubuntu -e bash -lc "ls -1 ~/.husk/workspaces/"
cmp_12rgq756hr3g      # no record on the Windows side
cmp_2p6pgx38a4gt      # mine, this session
cmp_gfevmyp99fg5      # mine, this session
cmp_hqwka5hzb325      # the one record that existed
cmp_y1d5a7x4qnc2      # no record on the Windows side

So two were already orphaned before I started. Nothing I did created them; normal use
did.

Deleting ~/.husk deletes the bookkeeping and leaves the data, which is the wrong half to
keep. It also means "reset husk completely" leaves a machine's files on disk, which for a
tool whose pitch includes /work outliving the conversation is a surprising thing to get
backwards.

What I would do

For (1), print the line after the directory exists, or do not create it in doctor — the
second matches the README.

For (2), the banner should say what it actually covers, and husk needs some way to see
and clear WSL-side workspaces whose record is gone. LocalProvider already has the
orphan scan (local.ts around 862-895) and the comment there notes it reports rather than
sweeps, with the registry entry as the anchor. Surfacing that in doctor would have told
me about those two orphans instead of leaving me to find them with ls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkg: cliTouches packages/clipkg: runtimeTouches packages/runtimetested with opus 5Found during an Opus 5 test pass

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions