uniswap-v4-hooks

uniswap-v4-hooks is a skill for Claude Code, Codex from ccashwell/evm-cortex. It costs 69 tokens per session (4,720 once invoked), scanned A, original, MIT.

A guide to building Uniswap V4 hooks, which are custom contracts called during pool actions to add behavior such as fees, access rules, or oracle data. It explains callback permissions, deployment addresses, accounting, and hook-specific testing.

In plain words
What is it for?
Use it when creating or reviewing V4 hooks for custom fees, trading rules, oracle data, access control, or return-delta behavior.
Why use it?
It helps developers avoid incompatible dependencies, invalid hook deployments, and mistakes in callback permissions or balance accounting.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or reviewing V4 hooks for custom fees, trading rules, oracle data, access control, or return-delta behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ccashwell/evm-cortex/uniswap-v4-hooks
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.

Any agent
npx skills add ccashwell/evm-cortex --skill uniswap-v4-hooks
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Made for: Claude Code, Codex.

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 uniswap-v4-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccashwell/evm-cortex/uniswap-v4-hooks/github.svg)](https://agentmods.dev/skills/ccashwell/evm-cortex/uniswap-v4-hooks)
Your own site
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/uniswap-v4-hooks"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/uniswap-v4-hooks/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 uniswap-v4-hooks

Your own site · 80×15
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/uniswap-v4-hooks"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/uniswap-v4-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,720 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 394
    Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.
    Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
How audits are shown
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.00069 $0.04720
Opus 5.5 $0.00028 $0.01888
Sonnet 5.5 $0.00014 $0.00944
Haiku 4.5 $0.00007 $0.00472

Measured 17d ago against content hash 0a5087667469, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

uniswap-v4-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 17d 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.

skills/uniswap-v4-hooks/SKILL.md · 412 lines

How it starts

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

Uniswap V4 Hook Development

Build against one pinned, compatible dependency graph. Start from a pinned revision of the Uniswap V4 template or pin v4-core, v4-periphery, and the hook library to known-compatible revisions. Do not combine examples from different releases.

As of 2026-02-06 v4-periphery no longer contains BaseHook or HookMiner (PR #510). Use @openzeppelin/uniswap-hooks (what Uniswap/v4-template pins) or Uniswap/v4-hooks-public; both expose the same _before*/_after* internal-override API. HookMiner also remains at v4-periphery/test/shared/HookMiner.sol.

Before editing, inspect the project's foundry.lock, .gitmodules, and remappings. Read Hooks.sol, IHooks.sol, PoolOperation.sol, BaseHook.sol, and HookMiner.sol at those installed revisions. The links at the end are for discovery; the project's pinned dependency graph is the source of truth.

Architecture

Uniswap V4 keeps pools in a singleton PoolManager. A PoolKey selects one hook contract or no hook. The same hook contract can serve multiple pools.

The least significant 14 bits of the hook address encode callback permissions. PoolManager.initialize rejects an invalid hook address, and a maintained BaseHook validates the deployed address against getHookPermissions() in its constructor. Deploy a production hook with CREATE2 and a salt mined for the required low-bit pattern.

In a callback:

  • msg.sender is PoolManager.
  • The callback's sender argument is the immediate caller of the PoolManager operation. It is commonly a router, not the end user.
  • hookData is caller-controlled unless a trusted integration authenticates and binds it to the operation.

An authentic PoolManager callback does not prove that the pool is authorized. Anyone can attempt to initialize a PoolKey that names the hook. A hook must either support permissionless pool creation or validate the complete intended PoolKey or PoolId. Initialization-sensitive hooks must also validate the initial price and every other required pool parameter.

Read the full file on GitHub · 412 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. 17d ago Changed · +13 lines 0a5087667469
  2. 1mo ago First seen · 399 lines · 69 tokens per session scan A 72d1dc882c46

Subscribe to this mod's changes

uniswap-v4-hooks is a skill published in the GitHub repository ccashwell/evm-cortex (131 stars, last pushed 18d ago), licensed MIT. It adds 69 tokens to every session and 4,720 once invoked, about $0.0003 per session on Opus 5.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-09-03.