SessionStart

A session-start hook that runs maintenance and setup checks when a coding session begins. It checks updates and status-line setup, repairs or builds tracking tools when needed, and clears editing state.

In plain words
What is it for?
Use it to perform the repository's startup checks, including update checks, self-healing checks, tracker compilation, and tracker cleanup.
Why use it?
These checks would otherwise need to be remembered and run manually at the start of each session. Running them automatically prepares the session's tracking and status features.

Hook

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add hooks/randomittin/heimdall/session-start
Clone the repo
git clone --depth 1 https://github.com/randomittin/heimdall
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade A, and why

SessionStart scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

hooks/hooks.json · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

{
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "PLUGIN=\"${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}\"; AUTOUP=\"$PLUGIN/bin/heimdall-autoupdate\"; [ -x \"$AUTOUP\" ] && (\"$AUTOUP\" check >/dev/null 2>&1 &) || true; SLREG=\"$PLUGIN/bin/heimdall-statusline-register\"; [ -x \"$SLREG\" ] && \"$SLREG\" register >/dev/null || true; HEAL=\"$PLUGIN/bin/heimdall-cc-selfheal\"; if [ -x \"$HEAL\" ]; then (\"$HEAL\" check >/dev/null 2>&1 &) || true; \"$HEAL\" pin-notice 2>/dev/null || true; fi; TRACKER=\"$PLUGIN/bin/parallelism-tracker\"; if [ -f \"$PLUGIN/bin/parallelism-tracker.c\" ] && { [ ! -x \"$TRACKER\" ] || ! \"$TRACKER\" check probe >/dev/null 2>&1; }; then \"$PLUGIN/bin/build-tracker.sh\" >/dev/null 2>&1 || true; fi; ETRACKER=\"$PLUGIN/bin/edit-tracker\"; if [ -f \"$PLUGIN/bin/edit-tracker.c\" ] && { [ ! -x \"$ETRACKER\" ] || [ \"$PLUGIN/bin/edit-tracker.c\" -nt \"$ETRACKER\" ]; }; then clang -O2 -Wall -Wextra -o \"$ETRACKER\" \"$PLUGIN/bin/edit-tracker.c\" 2>/dev/null || true; fi; \"$ETRACKER\" clear 2>/dev/null || true; \"$ETRACKER\" init 2>/dev/null || true; if [ ! -f heimdall-state.json ] && [ ! -f superx-state.json ]; then heimdall-state init 2>/dev/null || true; fi; if [ -f heimdall-state.json ] || [ -f superx-state.json ] || [ -d .planning ]; then mkdir -p .planning 2>/dev/null && \"$PLUGIN/bin/stack-pack\" detect 2>/dev/null > .planning/detected-stack.json || true; fi; HMDTEAM=\"$PLUGIN/bin/heimdall-team\"; HMDPRES=\"$PLUGIN/bin/heimdall-presence\"; if [ -x \"$HMDTEAM\" ] || [ -x \"$HMDPRES\" ]; then ( [ -x \"$HMDTEAM\" ] && \"$HMDTEAM\" auto >/dev/null 2>&1; [ -x \"$HMDPRES\" ] && \"$HMDPRES\" beat >/dev/null 2>&1; ) >/dev/null 2>&1 & fi; REAP=\"$PLUGIN/bin/heimdall-reap-idle\"; if [ -x \"$REAP\" ] && [ -d .git ]; then RN=$(\"$REAP\" 2>/dev/null | grep -cE '^\\[REAP' || true); [ \"${RN:-0}\" -gt 0 ] && echo \"[heimdall] $RN agent worktree(s) reapable — run bin/heimdall-

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 68 lines scan A 8674f3e7a47c

Subscribe to this mod's changes

SessionStart is a hook published in the GitHub repository randomittin/heimdall (5 stars, last pushed 11d ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.