{
  "_comment": "Merge the SessionStart entry into the hooks object of ~/.claude/settings.json. Replace YOUR-OWNER/YOUR-PORTFOLIO-REPO. Do not replace your whole settings file.",
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if git rev-parse --git-dir >/dev/null 2>&1; then echo \"PORTFOLIO SESSION START CHECK (standing rule, see Portfolio session check in CLAUDE.md). Treat this start as the end-check of the previous session, which may have crashed.\"; echo \"Repo state:\"; git status -sb | head -8; echo \"Recent commits:\"; git log --oneline -3; echo \"Local branches not merged into current:\"; git branch --no-merged 2>/dev/null | head -5; echo \"Before starting the user task: (1) if the state above shows uncommitted, unpushed or unmerged work, mention it as possibly interrupted and do not resume it without asking; (2) run the close-what-is-done and capture rules for this project in YOUR-OWNER/YOUR-PORTFOLIO-REPO; (3) report in one line, or say nothing if there is nothing to change.\"; fi",
            "timeout": 15,
            "statusMessage": "Portfolio session-start check"
          }
        ]
      }
    ]
  }
}
