MarkdownLLM: Hook for Claude Code

.claude/settings.json

PostToolUse is a hook for Claude Code from JanoshMoshiri/MarkdownLLM. Its token cost is not measured, scanned A, a copy of SessionStart, MIT.

An automated check that runs after an AI coding tool finishes a file-writing or file-editing action.

In plain words
What is it for?
It is for running a shell command after Write or Edit operations, such as checking project files with the MarkdownLLM framework's tool.
Why use it?
It helps catch problems immediately after changes are made, without requiring a separate manual check each time.

Hook for Claude Code

Written for Claude Code: ${CLAUDE_PROJECT_DIR variable.

This is JanoshMoshiri/MarkdownLLM's own configuration. It tells Claude Code how to work on MarkdownLLM itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything MarkdownLLM configures →

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

Reuse

Borrowing it

Nothing to install: this file belongs to JanoshMoshiri/MarkdownLLM. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JanoshMoshiri/MarkdownLLM/main/.claude/settings.json
Clone the repo
git clone --depth 1 https://github.com/JanoshMoshiri/MarkdownLLM

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 PostToolUse

README.md
[![agentmods](https://agentmods.dev/badge/hooks/janoshmoshiri/markdownllm/post-tool-use.svg)](https://agentmods.dev/hooks/janoshmoshiri/markdownllm/post-tool-use)
Your own site
<a href="https://agentmods.dev/hooks/janoshmoshiri/markdownllm/post-tool-use"><img src="https://agentmods.dev/badge/hooks/janoshmoshiri/markdownllm/post-tool-use.svg" alt="Measured on agentmods" 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. Scan, not verified.
Origin 97% copy Near-identical to another mod in the catalogue.
Security

Grade A, and why

PostToolUse 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 6d 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.

Origin

This is a copy

97% identical to SessionStart — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/settings.json · 14 lines

How it starts

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

{
  "PostToolUse": [
    {
      "matcher": "Write|Edit",
      "hooks": [
        {
          "type": "command",
          "command": "ROOT=\"${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel)}\"\nMDLLM=\"$ROOT/\"'./tools/mdllm.py'\nFW=\"${MDLLM%/*/*}\"\nPY=\"\"\nPY_PREFIX=\"\"\nMDLLM_LAUNCH_DEADLINE=\"\"\nMDLLM_DATE=\"\"\nMDLLM_TIMEOUT=\"\"\nif [ -x /usr/bin/date ] && [ -x /usr/bin/timeout ]; then\n  MDLLM_DATE=/usr/bin/date\n  MDLLM_TIMEOUT=/usr/bin/timeout\nelif timeout --version >/dev/null 2>&1 && date +%s >/dev/null 2>&1; then\n  MDLLM_DATE=date\n  MDLLM_TIMEOUT=timeout\nfi\nif [ -n \"$MDLLM_DATE\" ] && [ -n \"$MDLLM_TIMEOUT\" ]; then\n  MDLLM_LAUNCH_DEADLINE=$(( $(\"$MDLLM_DATE\" +%s) + 10 ))\nfi\nmdllm_probe() {\n  [ -n \"$MDLLM_LAUNCH_DEADLINE\" ] || return 1\n  mdllm_remaining=$(( MDLLM_LAUNCH_DEADLINE - $(\"$MDLLM_DATE\" +%s) ))\n  [ \"$mdllm_remaining\" -gt 0 ] || return 1\n  \"$MDLLM_TIMEOUT\" \"$mdllm_remaining\" \"$@\" -c \"import yaml\" >/dev/null 2>&1\n}\nMDLLM_WINDOWS_SH=\"${MSYSTEM:-}\"\nif [ -z \"$PY\" ] && mdllm_probe \"$ROOT/.venv/bin/python\"; then\n  PY=\"$ROOT/.venv/bin/python\"\nfi\nif [ -z \"$PY\" ] && [ -n \"$MDLLM_WINDOWS_SH\" ] && mdllm_probe \"$ROOT/.venv/Scripts/python.exe\"; then\n  PY=\"$ROOT/.venv/Scripts/python.exe\"\nfi\nif [ -z \"$PY\" ] && mdllm_probe \"$FW/.venv/bin/python\"; then\n  PY=\"$FW/.venv/bin/python\"\nfi\nif [ -z \"$PY\" ] && [ -n \"$MDLLM_WINDOWS_SH\" ] && mdllm_probe \"$FW/.venv/Scripts/python.exe\"; then\n  PY=\"$FW/.venv/Scripts/python.exe\"\nfi\nif [ -z \"$PY\" ] && mdllm_probe python3; then\n  PY=\"python3\"\nfi\nif [ -z \"$PY\" ] && mdllm_probe python; then\n  PY=\"python\"\nfi\nif [ -z \"$PY\" ] && [ -n \"$MDLLM_WINDOWS_SH\" ] && mdllm_probe py \"-3\"; then\n  PY=\"py\"\n  PY_PREFIX=\"-3\"\nfi\nmdllm_python() {\n  if [ -n \"$PY_PREFIX\" ]; then\n    \"$PY\" \"$PY_PREFIX\" \"$@\"\n  else\n    \"$PY\" \"$@\"\n  fi\n}\nif [ -z \"$PY\" ] || [ ! -f \"$MDLLM\" ]; then\n  printf '%s\\n' '{\"hookSpecificOutput\"

Read the full file on GitHub · 14 lines

Same file

What else settings.json configures

This page is one entry in a file that holds 3. 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. 6d ago First seen · 14 lines scan A 227d974c3318

Subscribe to this mod's changes

PostToolUse is a hook published in the GitHub repository JanoshMoshiri/MarkdownLLM (5 stars, last pushed 4d 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. It is 97% identical to SessionStart, differing in 5 lines, and is treated as a copy.