hook-tick

hook-tick is a command for coding agents from omrikais/cctally. It costs 0 tokens per session (588 once invoked), scanned A, original, Apache-2.0.

An internal hook command that runs automatically when Claude Code reaches certain assistant-message events. It reads hook data, stores new transcript usage in a local database, and periodically refreshes rate-limit information.

In plain words
What is it for?
Use it as part of Claude Code’s automatic hooks; use its debugging options to inspect decisions or skip the online rate-limit refresh.
Why use it?
It keeps local usage records and rate-limit data updated without requiring a manual command.

Command

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 commands/omrikais/cctally/hook-tick
Clone the repo
git clone --depth 1 https://github.com/omrikais/cctally

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 hook-tick

README.md
[![agentmods](https://agentmods.dev/badge/commands/omrikais/cctally/hook-tick.svg)](https://agentmods.dev/commands/omrikais/cctally/hook-tick)
Your own site
<a href="https://agentmods.dev/commands/omrikais/cctally/hook-tick"><img src="https://agentmods.dev/badge/commands/omrikais/cctally/hook-tick.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 588 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 $0.00000 $0.00588
Opus 5 $0.00000 $0.00294
Sonnet 5 $0.00000 $0.00118
Haiku 4.5 $0.00000 $0.00059

Measured 3d ago against content hash b2370640db07, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hook-tick 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 3d 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.

docs/commands/hook-tick.md · 50 lines

How it starts

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

cctally hook-tick

Internal — invoked automatically by Claude Code hooks. Users normally don't run this directly. Hidden from cctally --help.

What it does

On every assistant-message boundary (PostToolBatch, Stop, SubagentStop):

  1. Reads the CC hook payload from stdin (JSON: hook_event_name, session_id, transcript_path, cwd).
  2. Detaches stdout/stderr to ~/.local/share/cctally/logs/hook-tick.log.
  3. Tail-ingests new JSONL entries into the local SQLite cache.
  4. If ~/.local/share/cctally/hook-tick.last-fetch is older than the throttle threshold (default 30s), refreshes 7-day / 5-hour rate limits from the Anthropic OAuth usage API and writes via the same record-usage path.
  5. Writes one log line. Returns 0 unconditionally.

Useful flags (manual / debugging)

  • --explain — synchronous, prints decision tree to stdout, exits informative code.
  • --no-oauth — skip OAuth refresh entirely (local sync only).
  • --throttle-seconds N — override the 30s default.
  • --event NAME — override the event name written to the log line (rare).

Log format

<UTC ISO ts> event=<E> session=<sid8> ingested=<N> oauth=<status> dur_ms=<D>

oauth= values:

  • ok(7d=N,5h=M) / ok(7d=N) — fetched successfully (5h optional)
  • throttled(age=Ns) — last fetch was less than the throttle threshold ago
  • skipped-no-oauth--no-oauth flag set
  • skipped-no-token — no Claude OAuth token found in keychain or credentials file
  • err(network) / err(parse) — fetch or parse failed
  • err(record-usage=K) / err(record-usage=exc)record-usage returned exit code K or raised
  • err(internal:<TypeName>) — uncaught exception class within the hook (rare; signals a bug)

Rotation: when the log file exceeds 1 MB, it's atomic-renamed to hook-tick.log.1 (single-generation; older .1 is overwritten).

See also

  • setup — installs the hook entries that fire hook-tick
  • refresh-usage — manual variant that busts the status-line cache
  • record-usage — direct status-line integration (alternative to hooks)

Read the full file on GitHub · 50 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. 3d ago First seen · 50 lines · 0 tokens per session scan A b2370640db07

Subscribe to this mod's changes

hook-tick is a command published in the GitHub repository omrikais/cctally (5 stars, last pushed 5d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 588 tokens. 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-31.