darwinia: Skill for Claude Code

.claude/SKILL.md

darwinia is a skill for Claude Code from 0xSanei/darwinia. It costs 28 tokens per session (827 once invoked), scanned A, original, MIT.

A Python trading-strategy system evolves candidates through natural selection using Bitcoin data and tests the strongest result against several attacks.

In plain words
What is it for?
Use it to evolve or stress-test a strategy, run the evolution or attack arena, inspect system information, or launch the Streamlit dashboard.
Why use it?
It helps search for trading rules while checking whether they survive difficult patterns such as rug pulls, fake breakouts, and whipsaws.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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

Reuse

Borrowing it

Nothing to install: this file belongs to 0xSanei/darwinia. 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/0xSanei/darwinia/main/.claude/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/0xSanei/darwinia

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 darwinia

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xsanei/darwinia/claude/github.svg)](https://agentmods.dev/skills/0xsanei/darwinia/claude)
Your own site
<a href="https://agentmods.dev/skills/0xsanei/darwinia/claude"><img src="https://agentmods.dev/badge/skills/0xsanei/darwinia/claude/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 darwinia

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xsanei/darwinia/claude"><img src="https://agentmods.dev/badge/skills/0xsanei/darwinia/claude.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 827 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.00028 $0.00827
Opus 5 $0.00014 $0.00413
Sonnet 5 $0.00006 $0.00165
Haiku 4.5 $0.00003 $0.00083

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

Security

Grade A, and why

darwinia 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 11d 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/SKILL.md · 90 lines

How it starts

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

Darwinia — Self-Evolving Trading Agent Ecosystem

Evolves trading strategies through natural selection. 50 agents with random DNA compete on BTC data. Weak die, strong breed. Survivors handle rug pulls, fake breakouts, whipsaws.

When to use

  • User asks to find, optimize, or evolve a trading strategy
  • User wants adversarial stress-testing of trading logic
  • User mentions "darwinia", "evolve strategy", or "adversarial test"

Setup

git clone https://github.com/0xSanei/darwinia.git && cd darwinia && pip install -e ".[dev]"

Commands

Command Time Purpose
python -m darwinia evolve -g 10 --json ~30s Quick demo
python -m darwinia evolve -g 50 --json ~3min Full evolution + adversarial arena
python -m darwinia arena --json ~30s Test champion against 6 attacks
python -m darwinia info --json instant Version and capabilities
python -m darwinia dashboard Streamlit interactive dashboard

Always use --json for programmatic calls.

Key output fields

  • champion.fitness: >1.0 = outperforms buy-and-hold
  • champion.genes: 17 floats [0,1] encoding full strategy
  • evolution_summary.patterns_discovered: count of emergent rules
  • patterns: Emergent rules discovered by agents (not pre-programmed)

17-gene DNA

Signal (5): momentum, volume, volatility, mean_reversion, trend Threshold (4): entry, exit, stop_loss, take_profit Personality (5): risk_appetite, time_horizon, contrarian_bias, patience, position_sizing Adaptation (3): regime_sensitivity, memory_length, noise_filter

6 adversarial attacks

rug_pull, fake_breakout, slow_bleed, whipsaw, volume_mirage, pump_and_dump Arena reads agent DNA to find weaknesses and generates targeted scenarios.

Composability

Darwinia provides a two-way composability interface for cross-skill interop.

Inbound: other skills call Darwinia (SkillBridge)

from darwinia.integrations import SkillBridge

bridge = SkillBridge()
result = bridge.evolve({"generations": 20, "population_size": 30, "data_path": "data/btc_1h.csv"})
champion = bridge.get_champion()
score = bridge.evaluate_strategy([0.5] * 17)
regime = bridge.get_market_regime()

Read the full file on GitHub · 90 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. 11d ago First seen · 90 lines · 28 tokens per session scan A 43efbac44186

Subscribe to this mod's changes

darwinia is a skill published in the GitHub repository 0xSanei/darwinia (87 stars, last pushed 5mo ago), licensed MIT. It adds 28 tokens to every session and 827 once invoked, about $0.0001 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-08-30.