The session-gate engine (check.js). Run it by hand only to debug the engine; /session-start and /session-end read its report.
Resources
17Install
npx skillscat add surreptakos/claude-dotfiles/session-check Install via the SkillsCat registry.
Session check (engine)
check.js is the one engine the session-gate hook runs, for any repo. To read its findings, use/session-start or /session-end. Run it by hand when the engine itself is what you are debugging:
node ~/.claude/skills/session-check/check.js # start-of-session checks
node ~/.claude/skills/session-check/check.js --end # adds release gatesExit 1 reports STOP-level findings from a run that completed. The header comment of check.js is
the reference for every detection, every optional .claude/session.json key, and when --end
skips the test command. This SKILL.md exists because the plugin packager
(tools/build-cloud-plugin.py) ships only a directory that carries one, and the plugin is howcheck.js reaches every session.
Rulings the engine encodes
- Hung release gate (issue 818). Each
releaseGatescommand runs undergateTimeoutMs
(default 300000 ms); a timeout is a STOP naming it. A gate that printed aPASSverdict line
before hanging (a gas-run-driven gate that never returns) is a!!quoting that line instead:
the gate already passed the work. - End gate (issue 622). At
--end, three checks nothing can talk past, each skipped where the
file it reads is absent:tools/skill-stamps.py check aac-skills(a skill edited without a
re-stamp is a STOP); the files this branch touched against the credential patterns parsed out oflib/manifest.ps1(read, never restated, so it is the listAssert-NoSecretsuses); and every
hook scriptprofile/claude/settings.jsonnames that this repo carries (~/.claude/hooks/…→profile/claude/hooks/…), which must exist and, for Python, import cleanly. A command naming
anything else is reported unchecked, never passed.SESSION_END_GATE_ROOTrepoints the third
check at a fixture tree, for tests and demonstrations only. - Host-only checks. A
checksentry with"host": "desktop"(or"cloud") reportsskipped (<host>-only)on the other host and does not run: a check that can only exit 2 there
is noise, and noise gets the whole report skimmed past. - Account (
identity.js; owner ruling 2026-09-25, issue 714). Either of the owner's accounts
in~/.claude/accounts.jsonmay work any repo, so the only finding is a session under an
unregistered account, and it is a warning by ruling. - Pull nudge (
pull-nudge.js, issue 735). Desktop, claude-dotfiles checkout only: one line
naming the pull command, printed only when a merge since the lastsync.ps1 -Mode pulltouched
a pathGet-DotfileItemsinlib/manifest.ps1whitelists. A merge that moved only
plugin-carried content stays silent.
Tests
node --test *.test.js from this directory. Each test locates its fixtures relative to itself and
assumes nothing about where this copy is installed (issue 300: two located "this repo" by counting
three directories up, which is the home directory in an installed copy, and they were red)..github/workflows/skill-tests.yml runs them a second time from a copy outside any checkout,
which is the run that catches that.
Related
- The plugin's
hooks/scripts/session-gate.js(source: claude-dotfilesprofile/claude/hooks/session-gate.js) runs this on SessionStart, SessionEnd and
UserPromptSubmit.