Repository navigation
Support for managing more than one Claude Code config directory — notably the
secure-ai sandbox's — plus install-time
hooks for customizations and an HBAR-denominated session cost.
Highlights
-
Configurable config directory — every script in
scripts/(and the
enforcement utility) now works against a Claude Code config dir that
isn't necessarily~/.claude. Selection, in order:CLAUDE_DIR(wins) or Claude Code's ownCLAUDE_CONFIG_DIRis set:
only that directory, no question asked.- Otherwise, every existing directory among
~/.claudeand secure-ai's
~/.secure-ai/claude-code/config: the script runs once per directory
with the same arguments. A failure in one doesn't skip the other; the
exit status is non-zero. - Neither exists: asks
Claude Code config dir [~/.claude]:when run
interactively (Enter keeps the default, a leading~is expanded, the
path must be absolute); without a terminal it uses~/.claude.
Each directory gets its own install under
<config dir>/customizations/custom-claude-code-settings. Details:
README.md("Which config directory") andscripts/README.md. -
Watchdog only for
~/.claude— only the native Claude Code config dir
gets the launchd/systemd watchdog, since nothing else rewrites
settings.jsonbehind our back. Any other directory (secure-ai's
included) has its customizations enforced once at install time, with no
service.install-or-update.sh,uninstall.shandstatus.shskip the
service steps for it, andstatus.shsays so instead of reporting a
missing service. -
Install-time hooks — a customization can ship
bin/post-install.sh,
run once byinstall-or-update.shright after that customization's files
are installed, withINSTALL_DIRas$1. It is never copied into the
sharedbin/, so two customizations' hooks can't clash; a failing hook is
logged as a warning and doesn't abort the install. See "Install-time
hooks" incustomizations/README.md. -
hbar-addictedimprovements — it uses the new hook to populate its
price history synchronously at install, so the status line doesn't show
n/auntil the first background refetch completes. Combined with
claude-session-info, the session cost is now shown in HBAR as well as
USD. The segments also spawn fewer processes per render (onejqcall
instead of five and a singlegitcall instead of two in
claude-session-info, onejqper manifest and nobasename/dirnamein
statusline, twodatecalls instead of four inhbar-addicted), and the
installer renders its@@...@@placeholders with onesedescape pass
instead of one per value, which makes an install noticeably faster.
Fixes
- Uninstalling a non-
~/.claudeconfig dir no longer takes down the
~/.claudewatchdog. A full uninstall of e.g. secure-ai's config dir used
to unload the launchd/systemd service and delete its files, although both
dirs share one service label and~/.claudewas still installed. - A failing enforcer is now reported. If
settings.jsoncan't be parsed,
install-or-update.shandenforce-now.shused to exit with status 1 and
no message; they now stop with the last entry of the enforcer's log. status.shkeeps reporting when a customization's
customization.meta.jsonis malformed, and no longer fails on an empty
catalog under macOS's bash 3.2.errexitis now switched off explicitly,
only around the block that lists the catalog.
Behavior changes
- With both
~/.claudeand~/.secure-ai/claude-code/configpresent, the
scripts now act on both by default, where they previously only ever
touched~/.claude. To manage just one, setCLAUDE_CONFIG_DIR
(e.g.CLAUDE_CONFIG_DIR=~/.secure-ai/claude-code/config scripts/install-or-update.sh). scripts/logs.sh -ffollows only the first directory's logs when
several are managed; pick one withCLAUDE_CONFIG_DIR.- Interactive prompt when no config dir exists (see above), asked by
install-or-update.shonly; it is skipped whenCLAUDE_DIR/CLAUDE_CONFIG_DIR
is set or stdin isn't a terminal. The other scripts use~/.claude. bin/post-install.shis now a reserved filename in a customization's
bin/.
Requirements
jq (1.6 or newer), python3, macOS or Linux. claude-session-info
additionally needs git and hbar-addicted needs curl and awk.
Upgrading
Re-run scripts/install-or-update.sh. If you use secure-ai, the same run now
also installs into its config directory; the existing ~/.claude install and
its watchdog are unchanged.