Guide · Agent skill
How to use the Correlation Regime Detection agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The correlation-regime skill teaches an AI agent to track whether a group of assets has become highly correlated, so diversification has weakened. It turns that into an on/off regime state with two thresholds so the flag does not flicker, and it smooths only with past data. This guide explains what the skill does, how to install it, how to ask for it in plain language, and what it needs and does not do.
Quick start
- 1Download and unzip. Download the ZIP from this skill's page and unzip it into ~/.claude/skills/ or your project's .claude/skills/ folder.
- 2Or upload in the Claude apps. Open Settings, go to Capabilities, then Skills, and upload the skill package.
- 3Prepare your return data. Assemble a multi-asset return history with one column per symbol. Make sure Python with numpy and pandas is available.
- 4Ask in plain language. Describe the question, such as whether your assets have become one correlated bloc, and point the agent at your return data.
- 5Review the regime output. Check the FUSED or not-fused state, the transition timestamps and whether smoothing was trailing-only.
- 6Use it for context only. Treat the result as monitoring or risk context, not as a buy or sell signal.
What is an agent skill, and what does this one do?
An agent skill is a folder with a SKILL.md file that gives an AI agent instructions and code for a specific task. When a request matches the skill, the agent follows its method instead of improvising.
This skill covers four questions a single correlation snapshot cannot answer. It tells you when a market became one correlated bloc and when it released. It describes what a fused regime means for risk context. It attributes a crisis to the asset that moved first, with verdicts of NAME, MACRO, AMBIGUOUS or ABSTAIN. It also ranks assets whose correlations are rewiring, which can reveal slow declines without a violent move.
- Regime detection: edge density (the share of asset pairs whose absolute correlation clears a threshold), smoothed with a trailing window and passed through a hysteresis state machine.
- Risk context: translating the FUSED state into portfolio-risk language, such as de-grossing rather than liquidating.
- First-mover crisis attribution with explicit NAME, MACRO, AMBIGUOUS and ABSTAIN verdicts.
- Correlation-rewiring leaderboard for assets whose relationship to the rest of the market is shifting.
How do you install the correlation-regime skill?
Download the ZIP from the skill's page on this directory and unzip it. For a personal install, place the resulting folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder.
You can also upload the skill in the Claude apps. Open Settings, go to Capabilities, then Skills, and upload the package there.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload
What do you need before you start?
The skill's code is written in Python and uses numpy and pandas. You also need a multi-asset return history supplied by you, with one column per symbol. The skill does not fetch market data itself, and its methods are described as market-agnostic even though the source's validation tape is crypto.
The skill runs scripts and does not use the network.
- Python with numpy and pandas installed
- A multi-asset return history, one column per asset
- Scripts run locally; the skill makes no network calls
How do you trigger the skill with a natural request?
You do not need special syntax. Describe the question in plain terms about diversification, correlation clustering or crisis timing, and mention your assets and your return data. The agent should match the request to the skill's description.
Good requests name the goal and the input. For example, ask whether your basket has become one correlated bloc over the last few years, or ask which asset moved first in a past sell-off. Be specific about the return data you are providing.
- "Using my daily returns for these ten ETFs, has my portfolio become one correlated bloc in the last two years?"
- "Here is a multi-asset return history. When did the market enter and exit a fused correlation regime?"
- "Which asset moved first during the March sell-off in my data, and is the verdict clear or ambiguous?"
- "Rank my assets by how much their correlation to the rest of the basket has changed recently."
How does the regime detector work?
The method computes rolling pairwise correlations, reduces each matrix to one edge-density number, smooths that series with a trailing window, and runs a Schmitt-trigger state machine. The market enters FUSED when smoothed density reaches the enter threshold and stays FUSED until it falls to the exit threshold. The gap between the two thresholds is what prevents chatter.
The skill's defaults are a 60-bar correlation window, an edge threshold of 0.5, a 5-bar smoothing window, an enter threshold of 0.65 and an exit threshold of 0.45. The source notes that the edge threshold does not transfer to partial or residual correlations and must be recalibrated for those estimators.
- Edge density = fraction of pairs with absolute correlation at or above edge_threshold
- Smoothing must be trailing, never centered, to avoid reading future data
- Set enter and exit thresholds from the calm-period density distribution, with a wide dead band
def detect_regimes(density: pd.Series, smooth_window: int = 5, enter_threshold: float = 0.65, exit_threshold: float = 0.45) -> pd.DataFrame:What are the safety limits and honest caveats?
The skill is explicitly not a trade-timing signal. The source states that regime-based exits lost to a plain price stop in the author's head-to-head tests, so present these modes as risk context, monitoring and post-hoc attribution, never as buy or sell triggers.
The source also reports headline results from the author's internal replays, including counts of regime cycles and crisis-attribution accuracy. The source says these are not independently verifiable, so do not treat them as verified performance. Its replay regression is historical, not live.
- Do not use the output to generate buy or sell trades
- Do not cite the unpublished headline numbers as verified results
- Re-check any claimed onset lead time after making every smoothing step causal
- Review the scripts before running them on sensitive data
What tips help you get reliable output?
Check for look-ahead bias first. Centered smoothing, such as a rolling window with center=True, silently makes regime onsets look earlier than a live system could have detected them. The source says that after switching to causal filters, onsets moved later by one to two days and the detector still passed.
Choose window lengths for your data frequency. The source suggests 30 to 90 bars for daily data and hundreds of bars for intraday data. Keep the smoothing window short, just enough to remove single-bar spikes, because oversmoothing delays onsets.
- Verify causality: every smoothing step should look only backwards
- Match corr_window to bar frequency: 30–90 for daily, hundreds for intraday
- Keep a wide dead band between enter and exit thresholds
- Recalibrate the edge threshold if you use partial or residual correlations
What people use it for
- Monitoring whether a set of ETFs or equities has become highly correlated, weakening diversification.
- Labeling historical periods of correlation fusion for a research study on market regimes.
- Writing a risk report section that explains a fused regime in portfolio-risk terms.
- Post-hoc review of a past sell-off to see which asset moved first, with an explicit AMBIGUOUS or ABSTAIN verdict when evidence is weak.
- Scanning a basket for assets whose correlations are shifting slowly over time.
Frequently asked questions
How do I install the correlation-regime agent skill?
Download the ZIP from the skill's page and unzip it into ~/.claude/skills/ for a personal install, or into a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings, then Capabilities, then Skills.
What does the correlation-regime skill need to run?
It needs Python with numpy and pandas, plus a multi-asset return history that you supply. It runs scripts locally and does not use the network.
Is the correlation-regime skill free and what is its licence?
The source lists the licence as MIT. The source does not state any price, so check the skill's page for current terms before relying on it.
Can I use this skill to decide when to buy or sell?
No. The skill's own documentation says it is not a trade-timing signal, and its author's tests found that regime-based exits lost to a plain price stop. Use it for risk context, monitoring and post-hoc attribution.
Why does my regime flag flicker on and off?
A single threshold causes chatter. The skill uses separate enter and exit thresholds with a dead band between them. If you still see flicker, widen the gap between the thresholds and check your smoothing window.
How does this compare with a plain correlation matrix or the correlation-analysis skill?
A correlation snapshot answers how correlated assets are at one moment. This skill adds time: it tracks when a regime starts and ends, attributes crises and ranks rewiring. The source names the separate correlation-analysis skill for snapshot questions.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a quant, risk analyst, researcher or pipeline developer who needs a causal, hysteresis-based flag for how correlated a group of assets has become, and who can supply the return data. Pick something else if you need trade signals or verified performance figures, since the source explicitly warns against both.
Download the skill