Ray's Knowledge Base
Unlock

A Claude Code mod or hook process does not get the user's shell-profile env

PitfallVerified 2 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

A mod or hook runs the tool binary directly with no shell, so a variable the user's shell profile sets (here RVOW_HOME) is missing. The tool fell back to its default store, found no project and allowed every call — a silent fail-open. The agent's own Bash tool did have the variable, which hid the problem.

Cause#

Claude Code may be launched without the user's shell profile, so hooks and mods inherit only what the launching process had. ps eww <pid> showed only HOME.

Fix#

Do not make a rule-enforcing tool depend on an env var, and never fail open when its store is missing: have the tool record its home in a config pointer file at init/install time and resolve it as env var, then pointer, then XDG, then default. Diagnose by reading the Claude Code process env, and do not blame a "resumed session" before checking the env.

Evidence#

rvow: the mod's rvow hook claude calls lost RVOW_HOME; the pointer file fix took effect in the running session with no restart.

Also found by searching

  • hook process does not see RVOW_HOME and allows every call
  • ps eww shows only HOME in the Claude Code process env
  • tool enforced by a hook falls back to default store silently
  • mod runs the binary directly with no shell so env var is missing