SessionStart

SessionStart is a hook for Claude Code from Zts0hg/codexspec. Its token cost is not measured, scanned A, original, MIT.

A session-start hook that runs a configured Git command when a coding session begins. The command adds guidance for analysing staged changes before creating commits.

In plain words
What is it for?
Use it in a Git workflow that requires a commit-message check before authorised commits.
Why use it?
It puts the project's commit rules in place automatically at session start. This helps keep commit messages tied to the files that are actually staged for a commit.

Hook for Claude Code

Written for Claude Code: SessionStart hook event.

Good fit Use it in a Git workflow that requires a commit-message check before authorised commits.

Compare 6 hooks from other repositories ↓
Install with agentmods
npx agentmods add hooks/zts0hg/codexspec/session-start
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.

Clone the repo
git clone --depth 1 https://github.com/Zts0hg/codexspec

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for SessionStart

README.md
[![agentmods](https://agentmods.dev/badge/hooks/zts0hg/codexspec/session-start/github.svg)](https://agentmods.dev/hooks/zts0hg/codexspec/session-start)
Your own site
<a href="https://agentmods.dev/hooks/zts0hg/codexspec/session-start"><img src="https://agentmods.dev/badge/hooks/zts0hg/codexspec/session-start/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for SessionStart

Your own site · 80×15
<a href="https://agentmods.dev/hooks/zts0hg/codexspec/session-start"><img src="https://agentmods.dev/badge/hooks/zts0hg/codexspec/session-start.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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 4d 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.

.claude/commands/codexspec/hooks/hooks.json · 17 lines

How it starts

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

{
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "git",
          "args": [
            "-c",
            "alias.codexspec-commit-guidance=!printf '%s\\n' '<!-- CODEXSPEC COMMITS START -->\n## Commit Messages\n\nBefore creating an authorized Git commit, invoke `/codexspec:commit-staged` to analyze staged\nchanges and generate the message. This applies in plain conversation and SDD\nworkflows, including auto-dev feature commits and blueprint commits. Command\navailability alone is not an invocation.\n\nThe calling workflow prepares staging. `commit-staged` must not choose or stage\nfiles, and must not describe unstaged changes or conversation-only intent. Use a\nbody when needed to cover material staged changes accurately and completely.\n\nFor helper-owned commits, prepare the helper'\"'\"'s explicit index first, invoke\n`/codexspec:commit-staged -p` against that index, and pass the full message and analyzed tree\nto the helper'\"'\"'s finalization action. Keep ownership, path, locking, and recovery\nchecks. If content changes, prepare and analyze again before committing; never\nfall back to a fixed message or direct Git execution to bypass a failed check.\nThis rule does not grant authorization to stage, commit, or push.\n<!-- CODEXSPEC COMMITS END -->\n\n<!-- CODEXSPEC SPECS START -->\n## CodexSpec Historical Specs\n\nBefore substantive requirements, behavior, design, implementation, debugging, or\nreview judgments, actively recall relevant history under `.codexspec/specs/`.\nThis applies in ordinary conversation and SDD workflows. Prepare background before\nquestioning the user. Purely mechanical edits, such as spelling or formatting\nwith no substantive judgment, may omit recall.\n\nSelect related features by the task'\"'\"'s capabilities, affected modules, interfaces,\nand terminology; use directory names, artifact headings, and targeted text search\nto find candidates. Read relevant requirements and follo

Read the full file on GitHub · 17 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. 4d ago Changed 82f05c234281
  2. 5d ago First seen · 17 lines scan A 9ecb57678439

Subscribe to this mod's changes

SessionStart is a hook published in the GitHub repository Zts0hg/codexspec (5 stars, last pushed today), 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-10-11.