heurist-finance: Skill for Claude Code

.claude/skills/pairs-relative-value/SKILL.md

pairs-relative-value is a skill for Claude Code from heurist-network/heurist-finance. It costs 76 tokens per session (1,230 once invoked), scanned A, original, MIT.

A pairs and relative-value analysis compares two related investments, usually by buying one and selling the other. It tests whether their price relationship is stable enough to support a trade instead of simply assuming that similar prices will move together.

In plain words
What is it for?
Use it to assess long/short pairs, hedge a view on one company with another, test cointegration, estimate spread half-life, and set entry and exit ranges.
Why use it?
Two assets can have high correlation without reliably returning to their usual relationship. This helps identify relationships that may break and estimate how long a trade might take to work.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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

Reuse

Borrowing it

Nothing to install: this file belongs to heurist-network/heurist-finance. 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/heurist-network/heurist-finance/main/.claude/skills/pairs-relative-value/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/heurist-network/heurist-finance

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 pairs-relative-value

README.md
[![agentmods](https://agentmods.dev/badge/skills/heurist-network/heurist-finance/pairs-relative-value/github.svg)](https://agentmods.dev/skills/heurist-network/heurist-finance/pairs-relative-value)
Your own site
<a href="https://agentmods.dev/skills/heurist-network/heurist-finance/pairs-relative-value"><img src="https://agentmods.dev/badge/skills/heurist-network/heurist-finance/pairs-relative-value/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 pairs-relative-value

Your own site · 80×15
<a href="https://agentmods.dev/skills/heurist-network/heurist-finance/pairs-relative-value"><img src="https://agentmods.dev/badge/skills/heurist-network/heurist-finance/pairs-relative-value.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,230 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.
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.00076 $0.01230
Opus 5.5 $0.00030 $0.00492
Sonnet 5.5 $0.00015 $0.00246
Haiku 4.5 $0.00008 $0.00123

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

Security

Grade A, and why

pairs-relative-value 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 13d 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.

.claude/skills/pairs-relative-value/SKILL.md · 36 lines

How it starts

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

Pairs & Relative Value

Shared plumbing and output contract: ../_shared/analyst-core.md. A pair converts a market-direction bet into a relationship bet. That removes beta and adds two new ways to lose: the relationship breaks, or it mean-reverts slower than the capital can wait. Both are testable before entry — so test them.

Qualify the pair (compute, don't assert)

Pull both legs: hf_tool.py prices A B --period 3y --out FILE, then a Python block for the statistics. The gates, in order:

  1. Economic linkage first. Same demand driver, same input costs, or substitute products — stated in one sentence. Data-mined pairs with no economic reason are the ones that break. (KO/PEP yes; "these two cointegrated in-sample" no.)
  2. Cointegration, not correlation. Correlation 0.9 says they wiggle together; cointegration says the spread is stationary — only the second supports mean-reversion trading. Engle–Granger on log prices (regress, ADF-test the residual) over a ~3y lookback, demand p < 0.05 — and require sub-sample stability: re-run on each half of the window and the most recent year; a pair that only cointegrates over the full window is regime-dependent, treat it as failed. High correlation with failed cointegration = trending spread = the classic slow bleed. Failed cointegration with a real economic link and a directional relative view downgrades to the fallback structure: a return-beta-hedged overlay (hedge ratio from a return regression), traded as directional relative value on a thesis falsifier — no bands, no mean-reversion logic, and say it's not a pair.
  3. Half-life of the spread (fit OU / AR(1) on the residual: half-life = −ln(2)/ln(φ)). Reject > ~30 trading days — beyond that, capital lock-up and break risk dominate the convergence P&L, and it exceeds the user's multi-week horizon anyway. 5–20 days is the sweet spot.
  4. Hedge ratio from the cointegrating regression (not 1:1 shares, not equal dollars unless β≈1): position legs so the traded unit is the stationary spread. Then check residual beta — sector-neutral pairing (both legs same sector) removes ~60% of market beta by construction; cross-sector "pairs" are usually a hidden factor bet (long tech / short energy is a rates trade wearing a pairs costume — say so).
  5. Short-leg reality check: borrow availability and fee (equity_overview, short-interest context via equity_screen screen_name=most_shorted_stocks). A pair whose short leg is > 10–15% borrow fee or squeeze-listed has asymmetric blow-up risk — the short leg gets recalled precisely when it's ripping.

Read the full file on GitHub · 36 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. 13d ago First seen · 36 lines · 76 tokens per session scan A de6f2fffa569

Subscribe to this mod's changes

pairs-relative-value is a skill published in the GitHub repository heurist-network/heurist-finance (11 stars, last pushed 14d ago), licensed MIT. It adds 76 tokens to every session and 1,230 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-10-24.

Related

pairs-relative-value compared with skills from other repositories

pairs-relative-value next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pairs-relative-valueheurist-network/heurist-financeSkill1114d agoMITA76Claude Code
sector-rotationHKUDS/Vibe-TradingSkill38kyesterdayMITA39Claude Code, Codex
twitter-readerhimself65/finance-skillsSkill3.5k2d agoMITA110Claude Code
strategy-pivot-designertradermonty/claude-trading-skillsSkill3.7k2d agoMITA28Claude Code, Codex
energy-procurementhashgraph-online/awesome-codex-pluginsSkill1.5kyesterdayApache-2.0A93Claude Code, Codex
airdrop-hunting-guidenirholas/three.wsSkill269yesterdayApache-2.0A54Claude Code, Codex
multi-expert-analyzerdigoal/blogSkill8.6k2d agoGPL-2.0A292Codex