Skip to content

v2.33.1 ·

Open the editor from the Dock and the agent could not run ls

I opened VS Code from the Dock and the agent could not run ls. It could not write a file either. Every single call came back blocked:

/bin/sh: node: command not found
AIDLC approval guard could not run, so the call is blocked; reinstall it with: aidlc hook install

The approval guard is the hook that stops an agent from approving its own gates. It runs before every Bash, Edit and Write call, and it fails closed on purpose: if it cannot run, nothing runs. That part is right. The bug was how it started. The hook command began with a bare node, and an app opened from the Dock does not get your shell's PATH. No nvm, no Homebrew, no node. So the guard never started, and the agent sat there unable to do anything.

The fix in the message was wrong too. Reinstalling writes the same command again.

Can you imagine a new user hitting that on day one? Opening an editor from the Dock is not an edge case.

What changed

Both guards, the approval guard and the reviewer agent's guard, now start through a small script that is committed next to them, .claude/hooks/aidlc-node.sh. It looks for node in the usual places first: an AIDLC_NODE override, Homebrew, /usr/local/bin, then the nvm, Volta, fnm, asdf and mise folders in your home directory. It skips anything that is not an absolute path, is not executable, or sits in a folder anyone can write to. If it finds nothing at all, it blocks and says where it looked, and it tells you to open the editor from a terminal instead of telling you to reinstall.

Projects that already have the guard get the new command on aidlc update.

Why PATH is still in the list

The cost hooks already solved this, and they refuse to look at PATH at all, because a hostile PATH could swap in a fake node. I kept PATH, but last. It is exactly what the guard did before, so no setup that works today can start blocking tomorrow. Any node in a known location wins over it, which makes this strictly safer than the old command, not weaker.

I also did not reuse the cost hooks' script. That one is generated per machine and kept out of git, so on a fresh clone it does not exist yet, and a guard pointed at it would block everything until someone ran an install. Same bug, different door.

What it does not fix

If node lives somewhere none of those folders cover and PATH does not have it either, you still get blocked. At least now the message says why.