finlab — Claude Code skill: what it does, how to install
Provides guidelines for quant trading and backtesting with the FinLab library. Useful when building stock and ETF strategies for US and Asian markets.
npx skills add koreal6803/finlab-ai --skill finlab -a claude-codeWhat finlab does
The skill guides coding assistants in using the FinLab package (version 2.0.0 or newer). It defines patterns for data retrieval and backtest execution using the sim module. Supported instruments include equities and ETFs across US and Asian exchanges.
Prerequisites include Python 3.10+ and the uv package manager. Authentication on desktop uses python -m finlab login. For headless servers and Docker, users configure three variables: FINLAB_REFRESH_TOKEN, FINLAB_SESSION_ID, and FINLAB_API_KEY. The legacy token is deprecated.
Market scope is switched using data.set_market(). If a requested dataset does not exist in the active foreign market, FinLab silently falls back to Taiwan tables. This behavior can quietly corrupt backtest calculations if left unchecked. Free accounts get a 500 MB daily quota that resets at 8:00 AM UTC+8.
What it helps with
- run backtests on equities or ETFs using the sim runner
- fetch historical market data for US or Asian tickers
- configure headless environment tokens for Docker or cron
- inspect remaining daily data quota through the CLI
Example prompts for the agent
- Write a backtest script for US ETFs using USFundMarket.
- How do I set up FinLab credentials for a headless Docker container?
- Show how to switch data market to us and query closing prices.
How to install finlab
1Skills CLI (Vercel)
npx skills add koreal6803/finlab-ai --skill finlab -a claude-code2Manually: put the files in place
~/.claude/skills/finlab/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/finlab/
1Skills CLI (Vercel)
npx skills add koreal6803/finlab-ai --skill finlab -a codex2Manually: put the files in place
.agents/skills/finlab/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add koreal6803/finlab-ai --skill finlab -a cursor2Manually: put the files in place
.cursor/skills/finlab/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install koreal6803/finlab-ai finlab2Manually: put the files in place
.github/skills/finlab/SKILL.md1Skills CLI (Vercel)
npx skills add koreal6803/finlab-ai --skill finlab -a gemini-cli2Platform CLI
gemini skills install https://github.com/koreal6803/finlab-ai --path skills/finlabManually: put the files in place
.devin/skills/finlab/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add koreal6803/finlab-ai --skill finlab -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about finlab
How to install finlab in Claude Code?
Run npx skills add koreal6803/finlab-ai --skill finlab -a claude-code. This registers the skill for Claude Code.
What does finlab do?
It guides AI assistants in developing quantitative strategies using the FinLab framework. It details data retrieval rules, factor analysis, and backtesting defaults across international stock exchanges.
What are the data limits for FinLab accounts?
Free accounts receive a 500 MB daily allowance, while VIP accounts have 5000 MB. The quota resets every day at 8:00 AM UTC+8 and can be verified by running python -m finlab status.