hyperframes: Hook for Claude Code

.claude/settings.json

PreToolUse is a hook for Claude Code from heygen-com/hyperframes. Its token cost is not measured, scanned A, original, Apache-2.0.

An automatic check that runs before Bash tool calls containing a Git commit. Bash is a command-line shell, and Git is the system used to record code changes.

In plain words
What is it for?
Use it to enforce pre-commit checks for projects with a build, code-style checks, and type checking. It can identify the actual target directory when the command starts by changing directories.
Why use it?
It makes build, lint, and type-check results available before a commit is created. This helps catch problems before they are saved to the project's history.

Hook for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions Claude Code.

This is heygen-com/hyperframes's own configuration. It tells Claude Code how to work on hyperframes 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 hyperframes configures →

Part of the hyperframes plugin — 34 skills, 1 hook shipped together

One of 2 entries in settings.json upstream. Installing this one merges just its entry into your config; the other 1 are separate, each on its own page.

About the project

HyperFrames is an open-source framework that turns HTML, CSS, media, and timed animations into deterministic MP4 videos. It is used locally, by coding agents, and in hosted authoring workflows to create rendered videos from web-based designs. Its catalogue add-ons provide skills, agents, instructions, hooks, settings, and a plugin for agent-driven video production.

heygen-com/hyperframes · 65,314 stars · on GitHub · hyperframes.dev

Reuse

Borrowing it

Nothing to install: this file belongs to heygen-com/hyperframes. 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/heygen-com/hyperframes/main/.claude/settings.json
Clone the repo
git clone --depth 1 https://github.com/heygen-com/hyperframes

Made for: Claude Code.

Or install hyperframes, the plugin that ships this one along with the rest of its 34 skills, 1 hook.

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 PreToolUse

README.md
[![agentmods](https://agentmods.dev/badge/hooks/heygen-com/hyperframes/pre-tool-use/github.svg)](https://agentmods.dev/hooks/heygen-com/hyperframes/pre-tool-use)
Your own site
<a href="https://agentmods.dev/hooks/heygen-com/hyperframes/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/heygen-com/hyperframes/pre-tool-use/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 PreToolUse

Your own site · 80×15
<a href="https://agentmods.dev/hooks/heygen-com/hyperframes/pre-tool-use"><img src="https://agentmods.dev/badge/hooks/heygen-com/hyperframes/pre-tool-use.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 1 finding. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Fable 5.1 · 7 Sept 2026 📄 Read the review
Origin original No closer match found in the catalogue.
Security

Grade A, and why

PreToolUse scanned grade A with 1 finding 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 1mo 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

"command": "node -e \"\nconst chunks = [];\nprocess.stdin.on('data', d => chunks.push(d));\nprocess.stdin.on('end', () => {\n const input = JSON.parse(Buffer.concat(chunks).toString());\n const cmd = input.tool_input?.co
.claude/settings.json · 15 lines

How it starts

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

{
  "PreToolUse": [
    {
      "matcher": "Bash",
      "hooks": [
        {
          "type": "command",
          "timeout": 180,
          "statusMessage": "Running build + lint + typecheck before commit…",
          "command": "node -e \"\nconst chunks = [];\nprocess.stdin.on('data', d => chunks.push(d));\nprocess.stdin.on('end', () => {\n  const input = JSON.parse(Buffer.concat(chunks).toString());\n  const cmd = input.tool_input?.command || '';\n  if (!/git\\s+commit\\b/.test(cmd)) process.exit(0);\n  const { execSync } = require('child_process');\n  const fs = require('fs');\n  const path = require('path');\n  const os = require('os');\n  // A leading 'cd <path>' in the command is the real target directory:\n  // Claude Code prefixes this whenever the session's tracked cwd differs\n  // from this hook process's own cwd (e.g. a sibling repo worktree) — the\n  // hook process itself always inherits the primary working directory,\n  // never the command's actual target.\n  function resolveTargetDir() {\n    const m = cmd.match(/^\\s*cd\\s+('([^']+)'|(\\S+))\\s*(?:&&|;|\\n|$)/);\n    if (m) {\n      let dir = m[2] || m[3];\n      if (dir.startsWith('~')) dir = path.join(os.homedir(), dir.slice(1));\n      dir = path.resolve(process.cwd(), dir);\n      if (fs.existsSync(dir)) return dir;\n    }\n    return process.cwd();\n  }\n  const targetDir = resolveTargetDir();\n  let repoRoot;\n  try {\n    repoRoot = execSync('git rev-parse --show-toplevel', { cwd: targetDir, encoding: 'utf8' }).trim();\n  } catch {\n    process.exit(0);\n  }\n  // Only this repo's own bun build/lint/typecheck applies — skip silently\n  // for any other repo (e.g. a sibling Go/Python repo touched in the same session).\n  const pkgPath = path.join(repoRoot, 'package.json');\n  if (!fs.existsSync(pkgPath)) process.exit(0);\n  let pkg;\n  try {\n    pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));\n  } catch {\n    process.exit(0);\n  }\n  if (pkg.name !== 'hyperframes-monorepo') process.e

Read the full file on GitHub · 15 lines

Same file

What else settings.json configures

This page is one entry in a file that holds 2. 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. 1mo ago First seen · 15 lines scan A 8eff150d1739

Subscribe to this mod's changes

PreToolUse is a hook published in the GitHub repository heygen-com/hyperframes (65,314 stars, last pushed today), licensed Apache-2.0. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.