SessionStart

A session-start hook that runs checks when an agent session begins or is compacted. It reads project team settings and runs scripts that check for outdated information and project invariants, which are rules that should remain true.

In plain words
What is it for?
Loading repository team settings and running outdated-check and invariant-check scripts at session start.
Why use it?
It gives the agent current project context and surfaces important checks early. It also reports deprecated team-configuration file locations.

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/nexaduo/marc/session-start
Clone the repo
git clone --depth 1 https://github.com/NexaDuo/mARC
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 yesterday.

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.

harnesses/claude-code/marc/hooks/hooks.json · 31 lines

How it starts

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

{
  "SessionStart": [
    {
      "matcher": "*",
      "hooks": [
        {
          "type": "command",
          "command": "cfg=\"${CLAUDE_PROJECT_DIR:-${OLDPWD:-$PWD}}/.agents/team.toml\"; fallback=\"${CLAUDE_PROJECT_DIR:-${OLDPWD:-$PWD}}/.claude/team.toml\"; legacy=\"${CLAUDE_PROJECT_DIR:-${OLDPWD:-$PWD}}/.claude/team.config\"; if [ -f \"$cfg\" ]; then printf '=== mARC :: per-repo team.toml (channel topic) ===\\n'; cat \"$cfg\"; printf '\\n=== end team.toml ===\\n'; elif [ -f \"$fallback\" ]; then printf '=== mARC :: per-repo team.toml (channel topic) ===\\n'; cat \"$fallback\"; printf '\\n=== end team.toml ===\\n'; printf '[mARC] DEPRECATED path: .claude/team.toml — re-run /marc:init to migrate to .agents/team.toml (it will offer to remove the old file).\\n'; elif [ -f \"$legacy\" ]; then printf '[mARC] DEPRECATED: .claude/team.config found but mARC now reads .agents/team.toml (or .claude/team.toml as a fallback) — re-run /marc:init (or convert by hand from docs/team.toml.example) to migrate; the old .claude/team.config file is no longer parsed.\\n'; else printf '[mARC] no .agents/team.toml (or .claude/team.toml) in this repo — @techlead will fall back to runtime discovery (gh repo view / gh project list). Add one from docs/team.toml.example to pin repo/project facts.\\n'; fi; exit 0"
        }
      ]
    },
    {
      "matcher": "*",
      "hooks": [
        {
          "type": "command",
          "command": "script=\"${CLAUDE_PLUGIN_ROOT:-$PWD}/hooks/outdated-check.sh\"; if [ -f \"$script\" ]; then bash \"$script\" 2>/dev/null; else st=\"${MARC_STATE_DIR:-$HOME/.claude/marc-state}/hook-missing\"; mkdir -p \"$st\" 2>/dev/null; sid=\"$(cat 2>/dev/null | LC_ALL=C sed -n -e 's/.*\"session_id\"[[:space:]]*:[[:space:]]*\"\\([^\"]*\\)\".*/\\1/p' -e 's/.*\"conversationId\"[[:space:]]*:[[:space:]]*\"\\([^\"]*\\)\".*/\\1/p' | head -n1)\"; sid=\"${sid:-${ANTIGRAVITY_CONVERSATION_ID:-$PPID}}\"; mk=\"$st/$(printf '%s' \"${sid:-nosession}_outdated-check.sh\" | LC_ALL=

Read the full file on GitHub · 31 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. yesterday First seen · 31 lines scan A 22ca02f8a8f2

Subscribe to this mod's changes

SessionStart is a hook published in the GitHub repository NexaDuo/mARC (6 stars, last pushed 2d 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.