Skip to content

Releases: Neurone/custom-claude-code-settings

v1.2.0

Choose a tag to compare

@Neurone Neurone released this 03 Oct 04:05
899fd07

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:

    1. CLAUDE_DIR (wins) or Claude Code's own CLAUDE_CONFIG_DIR is set:
      only that directory, no question asked.
    2. Otherwise, every existing directory among ~/.claude and 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.
    3. 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") and scripts/README.md.

  • Watchdog only for ~/.claude — only the native Claude Code config dir
    gets the launchd/systemd watchdog, since nothing else rewrites
    settings.json behind 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.sh and status.sh skip the
    service steps for it, and status.sh says so instead of reporting a
    missing service.

  • Install-time hooks — a customization can ship bin/post-install.sh,
    run once by install-or-update.sh right after that customization's files
    are installed, with INSTALL_DIR as $1. It is never copied into the
    shared bin/, 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" in customizations/README.md.

  • hbar-addicted improvements — it uses the new hook to populate its
    price history synchronously at install, so the status line doesn't show
    n/a until 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 (one jq call
    instead of five and a single git call instead of two in
    claude-session-info, one jq per manifest and no basename/dirname in
    statusline, two date calls instead of four in hbar-addicted), and the
    installer renders its @@...@@ placeholders with one sed escape pass
    instead of one per value, which makes an install noticeably faster.

Fixes

  • Uninstalling a non-~/.claude config dir no longer takes down the
    ~/.claude watchdog.
    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 ~/.claude was still installed.
  • A failing enforcer is now reported. If settings.json can't be parsed,
    install-or-update.sh and enforce-now.sh used to exit with status 1 and
    no message; they now stop with the last entry of the enforcer's log.
  • status.sh keeps reporting when a customization's
    customization.meta.json is malformed, and no longer fails on an empty
    catalog under macOS's bash 3.2. errexit is now switched off explicitly,
    only around the block that lists the catalog.

Behavior changes

  • With both ~/.claude and ~/.secure-ai/claude-code/config present, the
    scripts now act on both
    by default, where they previously only ever
    touched ~/.claude. To manage just one, set CLAUDE_CONFIG_DIR
    (e.g. CLAUDE_CONFIG_DIR=~/.secure-ai/claude-code/config scripts/install-or-update.sh).
  • scripts/logs.sh -f follows only the first directory's logs when
    several are managed; pick one with CLAUDE_CONFIG_DIR.
  • Interactive prompt when no config dir exists (see above), asked by
    install-or-update.sh only; it is skipped when CLAUDE_DIR/CLAUDE_CONFIG_DIR
    is set or stdin isn't a terminal. The other scripts use ~/.claude.
  • bin/post-install.sh is 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.

v1.1.0

Choose a tag to compare

@Neurone Neurone released this 12 Sep 02:32
d754764

Status line segments, dependencies between customizations, and per-customization
logs/cache — plus the first customization built on top of it, an HBAR price
ticker.

Highlights

  • Status line segments — statusline is now a host: it contributes
    nothing on its own, just collects segments declared by other
    customizations (resources/statusline-segment.json + an executable),
    orders them, and joins the non-empty ones with a dim │ separator. A
    segment that fails or is missing becomes a red <name>! marker instead of
    breaking the line. A segment's manifest names its executable by filename
    only (e.g. hbar-segment.sh), resolved against the shared bin/ at
    runtime rather than an absolute path baked in at install time — so the
    same install keeps working if ~/.claude is later mounted somewhere with
    a different $HOME (for example, inside a container). Full contract:
    customizations/statusline/docs/statusline-segments.md.
  • claude-session-info — the model/cwd/git-branch/tokens/cost line this
    repo used to hard-code into statusline is now its own segment
    customization, installable and replaceable independently.
  • hbar-addicted — a new segment showing the HBAR/USD price with its
    1h/24h change and last-update time. Builds its own price history locally
    (cryptoprices.cc/HBAR only returns the current price), refetches in the
    background so rendering never blocks on the network, and sets
    statusLine.refreshInterval so the line keeps updating during idle
    sessions.
  • Dependencies between customizations — an optional
    customization.meta.json declares description and requires.
    install-or-update.sh expands what you name to its full transitive
    closure and tells you when it pulls in a dependency; uninstall.sh refuses
    to remove one still required by an installed dependent. Settings fragments
    are now merged in topological order (dependencies first) instead of
    directory-name order, so a customization can override a setting from
    something it requires.
  • Install manifest — resources/installed.json is now the source of
    truth for what's installed, fixing uninstall.sh's partial-uninstall path
    (it used to assume every customization in the repo was installed).
  • Per-customization logs and cache — logs/<name>/ and cache/<name>/
    are created for every installed customization and removed with it;
    logs.sh takes an optional customization name.
  • status.sh catalog — replaces the flat "customizations in repo" line
    with a table of every customization, its dependencies, its description,
    and whether it's installed.
  • Tested on Linux, not just verified at the surface — scripts/test-linux.sh now
    runs the entire test suite (tests/, which includes
    enforcement/enforce-custom-claude-code-settings.py's tests)
    against real Linux/GNU coreutils inside a container, in addition to its
    existing install/status/enforce-now/uninstall verification. New
    scripts/test-all.sh is a single entry point: the full suite natively on
    macOS, plus the Linux suite always (via Docker for the install/uninstall
    verification; the test suite itself also runs without Docker when the host
    is already Linux, e.g. a dev container — directly there instead of inside
    a disposable container). This caught (and fixed)
    two macOS-only assumptions that had slipped into this release's own new
    code: hbar-price-fetch.sh's stale-lock check called BSD's stat -f
    before GNU's stat -c, which crashes on Linux instead of falling back
    (GNU's -f is a real, different flag, not an error); and status.sh's
    catalog table used a multi-byte dash whose display width it computed with
    a locale-dependent character count, misaligning columns under the plain
    C/POSIX locale common in minimal containers.

Behavior changes

  • statusline alone is now silent. It used to render model/cwd/branch/
    tokens/cost by itself; that behavior moved to claude-session-info, which
    you need to install too (install-or-update.sh does this automatically
    when installing everything, but not if you'd previously installed only
    statusline by name).
  • Installing by name is now a union, not a replacement. Previously,
    install-or-update.sh some-customization rebuilt settings.enforced.json
    from only the named customization(s), silently dropping enforcement of
    everything else already installed. It now adds to the installed set; use
    uninstall.sh to remove something.
  • Logs moved: hbar-price.log-style flat files are gone in favor of
    logs/<name>/*.log; the watchdog's own logs/enforce.log is unaffected.

Requirements

jq, python3, macOS or Linux — unchanged. hbar-addicted additionally
needs curl and awk.

Upgrading

Re-run scripts/install-or-update.sh (with no arguments, to pick up
claude-session-info alongside statusline and get the status line back).

v1.0.0

Choose a tag to compare

@Neurone Neurone released this 10 Sep 01:01
6e013c3

First stable release of Custom Claude Code Settings: a way to define the Claude Code settings you want, and a watchdog that keeps Claude Code from silently dropping them.

Highlights

  • Customizations framework — each customization lives in its own directory under customizations/ with a customization.json settings fragment, optional bin/ executables and resources/. Fragments are deep-merged (directory-name order, later wins) into a single settings.enforced.json at install time.
  • Enforcement watchdog — enforce-custom-claude-code-settings.py deep-merges the enforced settings back into ~/.claude/settings.json whenever it drifts, touching only the enforced keys and leaving everything else untouched. Writes are atomic, and an unparseable settings.json is backed up before being rebuilt.
    • macOS: a launchd agent, triggered on file changes plus a 5-minute safety net.
    • Linux: systemd --user path + timer units with the same triggers; in environments without a running user manager (e.g. containers), the installer still applies customizations once and degrades gracefully instead of failing.
  • Built-in customizations:
    • statusline — a compact status line showing model, current directory, git branch, context-window tokens and session cost.
    • no-attribution — disables "Generated by Claude Code" attribution in commits and PRs.
    • clear-context-on-plan-accept — offers to clear context when a plan is accepted, so implementation starts from a clean context window.
  • Day-to-day tooling — install-or-update.sh, status.sh, enforce-now.sh, logs.sh, uninstall.sh (with --keep-files and per-customization targeting) for managing the whole lifecycle from the command line.
  • Cross-platform support — shared logic in scripts/lib/common.sh with platform backends (platform-darwin.sh, platform-linux.sh) selected automatically by uname -s; a Docker-based Linux smoke test (test-linux.sh) covers both the systemd and no-systemd cases.