Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{ "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.claudinite/sync-claudinite.sh" },
{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claudinite/preferences/inject-preferences.sh" },
{ "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claudinite/packs/load-active-prose.mjs" },
{ "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claudinite/skills/mount-skills.mjs" },
{ "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claudinite/packs/env.mjs check" }
]
}
],
"Stop": [
{
"hooks": [
{ "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claudinite/checks/stop-hook.mjs" }
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{ "type": "command", "command": "node $CLAUDE_PROJECT_DIR/.claudinite/checks/pretooluse-guard.mjs" }
]
}
]
}
}
20 changes: 20 additions & 0 deletions .claudinite-checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"packs": [
"basics",
"grow_with_claudinite",
"tidy-repo",
"github-actions"
],
"rules": {},
"accept": [
{ "rule": "warning-suppression", "path": "laughcounter/cli.py", "reason": "deliberate BLE001 broad-excepts: the listen loop and clip scan must never crash on one bad frame, load failure, ID error, or save error — resilience is the design intent" },
{ "rule": "warning-suppression", "path": "laughcounter/dashboard.py", "reason": "N802 on do_GET/do_POST is required by Python's http.server BaseHTTPRequestHandler API — the method names are fixed by the framework and cannot be renamed" },
{ "rule": "warning-suppression", "path": "laughcounter/notify.py", "reason": "deliberate BLE001 broad-except: a notification failure must never break the listening loop" },
{ "rule": "warning-suppression", "path": "laughcounter/detector/robust.py", "reason": "F401 optional-dependency availability probes (laugh_segmenter, torch) — imported to detect presence of the optional detector stack, not for direct use" },
{ "rule": "warning-suppression", "path": "laughcounter/detector/yamnet.py", "reason": "F401 optional-dependency availability probe (numpy) — imported to detect presence of the optional yamnet stack" },
{ "rule": "warning-suppression", "path": "laughcounter/speaker.py", "reason": "F401 optional-dependency availability probe (torch) — imported to detect presence of the optional speaker-attribution stack" }
],
"maintenance": {
"delivery": "push"
}
}
41 changes: 41 additions & 0 deletions .claudinite/sync-claudinite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# DO NOT DELETE. In a consuming repo this tracked file is both the Method B sync
# hook and the committed signal that the project mounts Claudinite
# (https://github.com/missingbulb/Claudinite) — fleet maintenance discovers
# opted-in repos by its presence on the default branch. Everything else under
# .claudinite/ is synced by this hook and gitignored; only this file is tracked.
# Canonical source: sync-claudinite.sh at the Claudinite repo root. Never edit a
# consumer's copy — the nightly re-bootstrap refreshes it from the canon.
#
# Syncs Claudinite into .claudinite/ over plain HTTPS from codeload (which the
# environment's network policy must allowlist; a submodule clone 403s on cloud).
# Pulls latest main. On a failed sync it keeps
# any prior copy silently; only when there is NO copy at all (the harness would be
# absent) does it inject a directive telling the assistant to halt and ask.
# Set CLAUDINITE_REF to a branch/tag/SHA to pin instead of tracking main.
set -euo pipefail
REF="${CLAUDINITE_REF:-main}"
URL="https://codeload.github.com/missingbulb/Claudinite/tar.gz/${REF}"
dest="${CLAUDE_PROJECT_DIR:-.}/.claudinite"
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
if curl -fsSL --retry 2 --max-time 30 "$URL" -o "$tmp/c.tgz" 2>/dev/null \
&& tar -tzf "$tmp/c.tgz" >/dev/null 2>&1; then
rm -rf "$dest.new"; mkdir -p "$dest.new"
tar -xzf "$tmp/c.tgz" -C "$dest.new" --strip-components=1
# The tracked copy of this hook wins over the tarball's, so a canon update never
# dirties the consumer's working tree mid-cycle — the nightly re-bootstrap is
# this file's update path. (.gitkeep: legacy pre-relocation marker, preserved
# until the re-bootstrap migration removes it.)
[ -f "$dest/sync-claudinite.sh" ] && cp "$dest/sync-claudinite.sh" "$dest.new/sync-claudinite.sh"
[ -f "$dest/.gitkeep" ] && cp "$dest/.gitkeep" "$dest.new/.gitkeep"
rm -rf "$dest"; mv "$dest.new" "$dest"; exit 0
fi
[ -f "$dest/README.md" ] && exit 0 # offline: prior copy present, harness still loads
# No prior copy: the harness is absent and the session would run vanilla. A SessionStart
# hook can't block or prompt on its own, so inject a directive telling the assistant to
# halt and confirm with the user before doing any work. stdout is added to the session
# context; the message is plain text (no double quotes or backslashes) so it embeds in
# the JSON string directly.
printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"%s"}}\n' \
"CLAUDINITE NOT LOADED: the sync failed and no local .claudinite/ copy exists, so @.claudinite/CLAUDE.md is unresolved and none of the Claudinite harness (packs, skills, preferences) is active this session. A common cause is the environment blocking the corpus fetch: codeload.github.com must be reachable and allowlisted in the environment network policy, or the sync 403s. STOP: before running any other tool, answering, or starting the requested task, use the AskUserQuestion tool to ask the user whether to proceed without the harness or pause and fix the sync (e.g. allowlist codeload.github.com, then retry); do not proceed until they answer."
exit 0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ venv/
*.db
*.jsonl
.laughcounter/
/.claudinite/*
!/.claudinite/sync-claudinite.sh
/.claudinite.new/
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

@.claudinite/CLAUDE.md

> Claudinite self-check: if the `@.claudinite/CLAUDE.md` import above did not resolve (the `.claudinite/` payload is absent — e.g. no `.claudinite/README.md`), the Claudinite harness is **not active** this session. Treat it as not loaded and confirm with the user before substantive work, since a launch-layer hook failure can eat the sync hook's own not-loaded directive.