truecourse-hooks

truecourse-hooks is a skill for Claude Code from truecourse-ai/truecourse. It costs 17 tokens per session (1,022 once invoked), scanned A, original, MIT.

A setup tool for a TrueCourse pre-commit hook, which checks code changes before Git records a commit.

In plain words
What is it for?
Use it to install, configure, check, or remove the TrueCourse hook and its repository configuration.
Why use it?
It helps stop newly introduced rule violations before they enter the repository. It also documents the baseline and shared settings the hook needs.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

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 skills/truecourse-ai/truecourse/truecourse-hooks
Any agent
npx skills add truecourse-ai/truecourse --skill truecourse-hooks
Clone the repo
git clone --depth 1 https://github.com/truecourse-ai/truecourse

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 truecourse-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/truecourse-ai/truecourse/truecourse-hooks.svg)](https://agentmods.dev/skills/truecourse-ai/truecourse/truecourse-hooks)
Your own site
<a href="https://agentmods.dev/skills/truecourse-ai/truecourse/truecourse-hooks"><img src="https://agentmods.dev/badge/skills/truecourse-ai/truecourse/truecourse-hooks.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,022 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.01022
Opus 5 $0.00009 $0.00511
Sonnet 5 $0.00003 $0.00204
Haiku 4.5 $0.00002 $0.00102

Measured 6d ago against content hash 764c33121279, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

truecourse-hooks 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 body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

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.

tools/cli/skills/truecourse/truecourse-hooks/SKILL.md · 87 lines

How it starts

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

TrueCourse Hooks

Install, configure, and manage the pre-commit hook that blocks new violations before they land in git.

Important

  • Always invoke via npx -y — without -y, npx will hang on the "Ok to proceed?" prompt whenever the user hasn't cached the latest truecourse version.
  • The hook makes commits slower. Every commit runs truecourse analyze --diff. On large repos that can be tens of seconds per commit. Make sure the user knows before you install.
  • Baseline required. The hook diffs against .truecourse/LATEST.json. The user needs truecourse analyze to have run at least once. On main, they should also commit the resulting LATEST.json so the hook works in fresh clones and git worktree add checkouts without a per-checkout cold-start. If no baseline exists yet, suggest /truecourse-analyze first.
  • hooks.yaml is the single source of truth. Installation creates <repo>/.truecourse/hooks.yaml with defaults; edit it to change policy. The file is meant to be committed so the whole team shares one hook config.

Instructions

1. Figure out what the user wants

  • "install", "set up", "enable" → Install flow
  • "status", "is the hook active", "what does it block" → Status flow
  • "uninstall", "remove", "disable" → Uninstall flow
  • "change what blocks", "make it stricter/looser", "add/remove severities", "enable LLM" → Configure flow

2. Install flow

  1. Tell the user the tradeoff upfront: commits will be slower; the hook needs a .truecourse/LATEST.json baseline (run analyze on main and commit the file so it propagates to clones and worktrees); policy lives in .truecourse/hooks.yaml which they should also commit.
  2. Run:
    npx -y truecourse hooks install
    
  3. Relay the output. Two files get created:
    • .git/hooks/pre-commit (the script git invokes)
    • .truecourse/hooks.yaml (starter policy, blocks critical and high by default, LLM off)
  4. If the user hasn't run a full analysis in this repo, suggest /truecourse-analyze — without a baseline, the hook has nothing to diff against. After analyze on main, also remind them to commit .truecourse/LATEST.json so fresh worktrees/clones inherit it.

Read the full file on GitHub · 87 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. 6d ago First seen · 87 lines · 17 tokens per session scan A 764c33121279

Subscribe to this mod's changes

truecourse-hooks is a skill published in the GitHub repository truecourse-ai/truecourse (527 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 1,022 once invoked, about $0.0001 per session on Opus 5. 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-08-30.