SessionStart

A hook that runs an inline shell check whenever a coding session starts. A hook is an automatic action triggered by an event.

In plain words
What is it for?
Use it to run a shell-based startup check in supported projects.
Why use it?
It can check something at the beginning of each session without requiring a manual command.

Hook for Claude Code

One of 4 entries in settings.json — they are configured in one file and arrive together.

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/thammasok/sample-mcp-and-hook/session-start
Clone the repo
git clone --depth 1 https://github.com/Thammasok/sample-mcp-and-hook

Made for: Claude Code.

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 C 3 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Security

Grade C, and why

SessionStart scanned grade C with 3 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

"command": "INPUT=$(cat); _m=$(jq -r '.model // empty' .claude/settings.json 2>/dev/null); _m=${_m:-$(jq -r '.model // empty' ~/.claude/settings.json 2>/dev/null)}; _m=${_m:-claude-code}; echo \"$INPUT\" | jq --arg m \"$

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

"command": "INPUT=$(cat); _m=$(jq -r '.model // empty' .claude/settings.json 2>/dev/null); _m=${_m:-$(jq -r '.model // empty' ~/.claude/settings.json 2>/dev/null)}; _m=${_m:-claude-code}; echo \"$INPUT\" | jq --arg m \"$

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

"command": "INPUT=$(cat); _m=$(jq -r '.model // empty' .claude/settings.json 2>/dev/null); _m=${_m:-$(jq -r '.model // empty' ~/.claude/settings.json 2>/dev/null)}; _m=${_m:-claude-code}; echo \"$INPUT\" | jq --arg m \"$
.claude/settings.json · 13 lines

The source is not reproduced here

No licence file

A repository with no LICENSE is all rights reserved by default, so the body is not copied here. The metadata, the measurements and the link are.

Read it on GitHub

Same file

What else settings.json configures

This page is one entry in a file that holds 4. Installing the file brings all of them; each is measured and scanned on its own page.

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 · 13 lines scan C 2dfda37e0fa8

Subscribe to this mod's changes

SessionStart is a hook published in the GitHub repository Thammasok/sample-mcp-and-hook (0 stars, last pushed 2mo ago), with no licence file. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it C with 3 findings (sends data to an external url, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.