exchange-session-detector

exchange-session-detector is a skill for Claude Code from terrylica/cc-skills. It costs 32 tokens per session (2,377 once invoked), scanned A, original, MIT.

A trading-session detector that determines whether a timestamp falls within an exchange's open hours, while accounting for daylight-saving changes, holidays, and lunch breaks. An exchange session is the period when a market is open for trading.

In plain words
What is it for?
Use it to label time-series data with exchange-session flags and to classify trading hours for exchanges such as NYSE, LSE, Tokyo, Hong Kong, or Singapore.
Why use it?
Simple hour checks can misclassify timestamps when markets close for holidays, shift clocks, or pause during a midday break.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the quant-research plugin — 8 skills shipped together , and of cc-skills

Good fit Use it to label time-series data with exchange-session flags and to classify trading hours for exchanges such as NYSE, LSE, Tokyo, Hong Kong, or Singapore.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/terrylica/cc-skills/exchange-session-detector
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 terrylica/cc-skills --skill exchange-session-detector
Clone the repo
git clone --depth 1 https://github.com/terrylica/cc-skills

Made for: Claude Code.

Or install quant-research, the plugin that ships this one along with the rest of its 8 skills.

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 exchange-session-detector

README.md
[![agentmods](https://agentmods.dev/badge/skills/terrylica/cc-skills/exchange-session-detector/github.svg)](https://agentmods.dev/skills/terrylica/cc-skills/exchange-session-detector)
Your own site
<a href="https://agentmods.dev/skills/terrylica/cc-skills/exchange-session-detector"><img src="https://agentmods.dev/badge/skills/terrylica/cc-skills/exchange-session-detector/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 exchange-session-detector

Your own site · 80×15
<a href="https://agentmods.dev/skills/terrylica/cc-skills/exchange-session-detector"><img src="https://agentmods.dev/badge/skills/terrylica/cc-skills/exchange-session-detector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,377 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 high

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 →

  • high Rogue Agent · line 185
    Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
    Fix: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.
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.00032 $0.02377
Opus 5 $0.00016 $0.01189
Sonnet 5 $0.00006 $0.00475
Haiku 4.5 $0.00003 $0.00238

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

Security

Grade A, and why

exchange-session-detector 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 5d 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.

plugins/quant-research/skills/exchange-session-detector/SKILL.md · 188 lines

How it starts

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

Exchange Session Detector

Production-grade pattern for detecting exchange trading sessions with full DST, holiday, and lunch break support. Validated in exness-data-preprocess across 10 global exchanges.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use

  • Adding session flags (is_nyse_session, is_lse_session, etc.) to time-series DataFrames
  • Detecting whether a timestamp falls within trading hours for any major exchange
  • Checking for holidays (NYSE, LSE, or "major" when both are closed)
  • Handling lunch breaks for Asian exchanges (Tokyo, Hong Kong, Singapore)
  • Upgrading from simplified hour-range checks to production accuracy
  • Building ClickHouse materialized columns for session classification

Architecture Overview

ExchangeConfig registry (exchanges.py)     SessionDetector (session_detector.py)
┌──────────────────────────────────┐      ┌──────────────────────────────────────┐
│ 10 frozen dataclasses            │      │ Wraps exchange_calendars library     │
│ ISO 10383 MIC codes              │─────▶│ Pre-computes trading minutes (sets)  │
│ IANA timezones for DST           │      │ Vectorized .isin() lookup (2.2x)    │
│ Local open/close hours           │      │ Holiday detection (NYSE + LSE)       │
└──────────────────────────────────┘      └──────────────────────────────────────┘

Quick Start

import exchange_calendars as xcals
import pandas as pd

# Single-exchange check
cal = xcals.get_calendar("XNYS")  # NYSE via ISO 10383 MIC
cal.is_open_on_minute(pd.Timestamp("2024-07-04 14:30", tz="UTC"))  # False (July 4th)
cal.is_open_on_minute(pd.Timestamp("2024-07-05 14:30", tz="UTC"))  # True

# Full session detection across 10 exchanges
from session_detector import SessionDetector
detector = SessionDetector()
df = detector.detect_sessions_and_holidays(dates_df)
# Adds: is_us_holiday, is_uk_holiday, is_major_holiday, is_{exchange}_session

Read the full file on GitHub · 188 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 188 lines · 32 tokens per session scan A a65ebd1f0702

Subscribe to this mod's changes

exchange-session-detector is a skill published in the GitHub repository terrylica/cc-skills (72 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 2,377 once invoked, about $0.0002 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-09-05.

Related

Other skills, from other repositories

finance

Financial analysis expertise for financial modeling (DCF, LBO, M&A), valuation, financial statement analysis, capital allocation, treasury management, and corporate finance decisions. Use when building financial models, analyzing statements, or making investment decisions.

travisjneuman/.claude · 48 tokens

financial-scenario-planner

Stress-test financial plans across scenarios (bull/bear/base), sensitivity tables, and Monte Carlo-style analysis. Use when evaluating financial assumptions, modeling risk scenarios, or building scenario-based financial plans.

travisjneuman/.claude · 44 tokens

investment-memo-generator

Investment memo creation combining financial analysis, document generation, and structured templates. Use when creating investment memos, pitch decks, deal summaries, or investment committee materials.

travisjneuman/.claude · 37 tokens

debug-systematic

Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.

travisjneuman/.claude · 33 tokens

embedded-iot

Embedded systems firmware, microcontrollers (ESP32, STM32, Arduino, Raspberry Pi), RTOS (FreeRTOS, Zephyr), IoT protocols (MQTT, CoAP, BLE), bare-metal C/C++, and hardware peripheral interfaces (I2C, SPI, UART, GPIO). Use when developing firmware, working with microcontrollers, or building IoT devices.

travisjneuman/.claude · 80 tokens

generic-code-reviewer

Review code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Supports any tech stack - HTML/CSS/JS, React, TypeScript, Node.js, Python, NestJS, Next.js, and more. Use when completing features, before commits, or reviewing pull requests.

travisjneuman/.claude · 70 tokens