Install TraceVault’s Claude Code hooks into claude_dir/settings.json
(deep-merged, never clobbering existing hooks/keys) and append a
workspace-mode instruction block to claude_dir/CLAUDE.md (idempotent,
guarded by a marker comment). Intended for tracevault init --global,
installing once for all Claude Code sessions rather than per-repo.
Write the user-level config.toml (under config_root) carrying the
user-context setting. An EXISTING user config is preserved (this mirrors the
“don’t clobber” contract of the global-hooks install): requested overrides
the user_context when a flag was given; otherwise an existing value is kept,
and only a first-time setup (no existing config) defaults to enabled.
When the resulting layer is enabled, the referenced context file is seeded
(empty) if absent — a custom --user-context <path> seeds THAT file, a
disabled layer seeds nothing. Returns the active context file path (the file
the hook will read), or None when the layer is disabled. Used by init --global.