Skip to content

Hardcoded ~/.claude paths in hooks/ and LIFEOS/TOOLS/ ignore CLAUDE_CONFIG_DIR, breaking non-default installs #1455

Description

@bravandi

LifeOS supports installing outside the default ~/.claude location via the CLAUDE_CONFIG_DIR environment variable, and hooks/lib/paths.ts implements correct resolution for this (getClaudeDir() checks CLAUDE_CONFIG_DIR → CLAUDE_PLUGIN_ROOT → falls back to
~/.claude; getLifeosDir() similarly checks CLAUDE_PLUGIN_ROOT → LIFEOS_DIR → falls back to ~/.claude/LIFEOS).

However, the large majority of hooks and tool scripts don't use this helper. Instead they define their own local HOME/CLAUDE_DIR/LIFEOS_DIR constants that hardcode ~/.claude directly, e.g.:

const HOME = process.env.HOME || "";
const CLAUDE_DIR = join(HOME, '.claude');
const LIFEOS_DIR = process.env.LIFEOS_DIR || join(HOME, ".claude", "LIFEOS");
const CLAUDE_ROOT = pathResolve(homedir(), ".claude");

These bypass CLAUDE_CONFIG_DIR entirely. On an install at a non-default path (e.g. ~/.claude-lifeos), these scripts silently resolve to the wrong, nonexistent ~/.claude directory instead of the actual install root — causing reads/writes to the wrong location or outright failures.

Scope

Roughly 116 files are affected, spanning:

  • hooks/.hook.ts, hooks/lib/.ts, hooks/handlers/*.ts — including hooks that fire on every tool call (e.g. HookHealer.hook.ts, SystemFileGuard.hook.ts, CheckpointPerISC.hook.ts, MemoryHealthGate.hook.ts, WritingGate.hook.ts)
  • LIFEOS/TOOLS/.ts and subdirectories (healthsync/, llcli/, TokenXray/) — including core tools like algorithm.ts, WorkSweep.ts, TelosFreshness.ts, ArchitectureSummaryGenerator.ts, and the InstallSweep.ts plist installers

Critically, the same hardcoded pattern also exists in the install/template sources that the /lifeos update workflow overlays into a live install (e.g. skills/LifeOS/install/hooks/.ts, skills/LifeOS/install/LIFEOS/TOOLS/.ts). Fixing only the live copies is
not durable — the next /lifeos update run re-copies from these templates and will reintroduce the bug.

Suggested fix

Refactor all affected files to import and use the existing helpers from hooks/lib/paths.ts (getClaudeDir(), getLifeosDir(), getEnvPath(), paiPath()) instead of locally reconstructing ~/.claude-based paths. This must be applied consistently to both the live

hooks//LIFEOS/TOOLS/ trees and their corresponding template sources under skills/LifeOS/install/, so the fix survives future update overlays.

To reproduce

  1. Install LifeOS with CLAUDE_CONFIG_DIR set to a non-default path (e.g. ~/.claude-lifeos).
  2. Run any affected tool/hook (e.g. bun LIFEOS/TOOLS/WorkSweep.ts) and observe it operating against ~/.claude/... instead of the configured install root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions