Files
dotfiles/CLAUDE.md
CatoandClaude Opus 5 1b883ff10c fix(hooks): commit the hook that was running from one disk, drop the renamed twins (#72)
settings.json is this repo's SSOT for what runs, and it disagreed with
.claude/hooks/ in both directions at once.

Registered but never committed: session-start.sh. It prints the "AGENTS
RUNNING" banner at the top of every session — the thing that makes
scripts/fleet-status.sh unavoidable rather than something a session has to
remember. It was written on 2026-09-10 and has been running here ever since,
while existing on exactly one disk. A new machine would not have had it, and
nothing would have said so.

Committed nothing runs — or rather, registered after it was superseded:
fleetcrown-capture.sh and fleetcrown-session-end.sh survived the FleetCrown ->
Loki rename as byte-for-byte twins of loki-capture.sh / loki-session-end.sh,
differing only in token path and host. Both ~/.config/fleetcrown and
~/.config/loki still hold a token, and both fleetcrown.orangecat.ch and
loki.orangecat.ch still answer, so since the rename every prompt typed on this
machine has been posted TWICE, to two different products. Their registrations
are removed here; the scripts are deleted from the box in the same change.

settings.json also gains the SessionStart block and modelSettings, which lived
only in the working copy. The file is otherwise the live one unchanged.

A registration with no file and a file nothing runs are the same bug seen from
opposite ends, so the new test asserts both ends, and is itself asserted to
fail in both directions rather than merely to pass today.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-20 07:16:54 -07:00

5.3 KiB

What This Repo Is

George's dotfiles — the Linux environment, installed by symlink. Nothing else.

Two things used to live here and both moved out:

  • Fleet automation (cross-repo audits, golden CI templates, SHARED.md, the reusable auto-merge sweep) → bitbaum/fleet, 2026-08-28. SHARED.md here is a pointer; auto-merge-sweep.yml here is a forwarding shim for the 16 repos that still call it. Do not add fleet checkers, registries or templates here — they go to fleet.
  • The agent runtime (stop/notify/dispatch, PyQt beacon, prompt injection) → Loki (Fleet Runner), 2026-06. .claude/hooks/ keeps only the thin per-session edge below.

Architecture

.bashrc .ssh/config .editorconfig install.sh
.config/          kitty, starship, zellij, git hooks
scripts/          personal utilities for THIS machine (fleet-status.sh,
                  fix-scans.sh) — not fleet automation, which lives in `fleet`
.claude/hooks/    per-session edge only (see the table below)
.claude/skills/   fix-lint, fix-types, write-tests
SHARED.md         POINTER to bitbaum/fleet — the registry is maintained there
.github/workflows/ this repo's own slim CI, auto-merge, and the sweep SHIM

The hooks, and which are actually alive

settings.json is the SSOT for what runs, and CI now enforces that it and .claude/hooks/ agree in both directions — see the note under the table. Verified 2026-09-20:

Hook Event State
pre-tool-use.sh PreToolUse alive — auto-approves; audits destructive commands to dangerous-commands.log; blocks a leading cd (see below)
post-tool-use.sh PostToolUse alive — typechecks after .ts/.tsx writes and feeds errors back
keep-awake-acquire.sh / -release.sh UserPromptSubmit / Stop alive — inhibits sleep while a session is working
loki-capture.sh, loki-session-end.sh UserPromptSubmit / Stop alive, but not ours — generated by Loki's Fleet Runner, which rewrites them on startup. Gitignored deliberately. Do not edit here.
stop.sh Stop no-op since 2026-06-11. Dispatch moved to Fleet Runner.
notification.sh Notification no-op since 2026-08-27. Previously exec'd a bridge that no longer exists.
session-start.sh SessionStart alive — prints what every other session is working on, by making scripts/fleet-status.sh unavoidable rather than optional. Owns no logic of its own.

Two ways this table has been wrong, both now caught by CI (.claude/hooks/tests/settings-hooks-match.test.sh):

  • A hook registered but not committed. session-start.sh ran on this box for ten days while existing on exactly one disk — it printed the banner every session, and losing the disk would have lost it silently.
  • A hook committed but not registered, or registered after it was superseded. The FleetCrown → Loki rename left fleetcrown-capture.sh and fleetcrown-session-end.sh registered alongside their loki-* successors. Both tokens and both hosts were still live, so every prompt typed was posted twice, to two different products, for six days.

A leading cd is blocked outright by pre-tool-use.sh: the Bash tool resets the working directory after every call, so it gains nothing, but a background daemon spawned in that same instant captures it and re-homes every later session to the wrong project — wrong transcript, wrong memory silo. Use an absolute path, -C, or (cd DIR && ...).

If you are about to add agent-dispatch logic here, stop: that is Loki's job. If you are about to add a fleet-wide checker here, stop: that is fleet's job.

When Working Here

Test changes:

bash -n .claude/hooks/*.sh install.sh      # what this repo's CI runs

After editing a hook: takes effect on the next session event. There is no daemon to restart.

Knowing what the other agents are doing

Ten to twenty sessions run at once, across a dozen projects. Two things follow, and both have cost real work:

Run scripts/fleet-status.sh when you start. It prints every live session grouped by project, and what each repo has moved today. The session registry alone gives a one-line name; this gives the picture. Use it before wide-blast-radius work — a shared type layer, a CI workflow, a migration — where what collides is intent, which worktrees do not isolate.

Memory is loaded from the session's CWD, ~/.claude/projects/<slug>/memory/. A lesson written while working on project A is invisible to an agent sitting in project B, and a session whose cwd is dotfiles but whose work is hirnli files its memories under dotfiles. That happened: 23 hirnli lessons were written where no hirnli agent could ever read them. Write a memory where the agents who need it will be sitting, and if it is a fleet-wide lesson, name the file in the other project's MEMORY.md rather than copying it.

Project detection

Use cwd. The session registry at ~/.claude/sessions/<pid>.json is the SSOT for what else is running.

Zellij tab names are not project identity. Tabs read Tab #9, one pane hosts many concurrent sessions, and the claude-projects.conf mapping was removed on 2026-08-27 after it had been dead for months. Do not reintroduce it.

Quality Standards

@~/.claude/CLAUDE.md