hypothesis-evolution-loop

hypothesis-evolution-loop is a skill for Claude Code, Codex from panjose/Co-Scientist. It costs 20 tokens per session (4,141 once invoked), scanned A, original, Apache-2.0.

An iterative research process that repeatedly improves hypotheses using the project's saved state until it reaches a stopping condition. It also records the rounds, comparisons, statistics, and convergence state.

In plain words
What is it for?
Use it to continue a hypothesis-evolution project from its current state or resume an interrupted run. It updates the hypotheses, tournament records, similarity graph, counters, and pipeline status.
Why use it?
It removes the need to run each evolution round manually and keeps the research run's progress in consistent files.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/panjose/co-scientist/hypothesis-evolution-loop
Any agent
npx skills add panjose/Co-Scientist --skill hypothesis-evolution-loop
Clone the repo
git clone --depth 1 https://github.com/panjose/Co-Scientist

Made for: Claude Code, Codex.

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 hypothesis-evolution-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/panjose/co-scientist/hypothesis-evolution-loop.svg)](https://agentmods.dev/skills/panjose/co-scientist/hypothesis-evolution-loop)
Your own site
<a href="https://agentmods.dev/skills/panjose/co-scientist/hypothesis-evolution-loop"><img src="https://agentmods.dev/badge/skills/panjose/co-scientist/hypothesis-evolution-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00020 $0.04141
Opus 5 $0.00010 $0.02070
Sonnet 5 $0.00004 $0.00828
Haiku 4.5 $0.00002 $0.00414

Measured 4d ago against content hash 6b6eebab4697, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hypothesis-evolution-loop 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 4d 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.

skills/hypothesis-evolution-loop/SKILL.md · 147 lines

How it starts

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

hypothesis-evolution-loop

Goal:

  • Run the iterative evolution loop from the current persisted run state until convergence.

Inputs:

  • current persisted run artifacts
  • active state/STRATEGY_PLAN.json
  • optional resume flag

Outputs:

  • updated hypotheses
  • updated island statistics
  • updated proximity receipt/status artifacts, plus state/PROXIMITY_GRAPH.json when the embedding bridge succeeds
  • updated tournament artifacts
  • updated convergence counters
  • updated state/EVOLUTION_STATE.json
  • appended state/EVOLUTION_ROUNDS.jsonl
  • updated state/PIPELINE_STATE.json
  • updated state/CURRENT_STAGE.json

Context Loading:

  • Open skills/shared-references/schema-index.md.
  • Read packages/agent_contracts/pipeline_control.py before updating state/EVOLUTION_STATE.json or state/COMPLETION_DECISION.json.
  • Read packages/agent_contracts/pipeline_runtime.py before updating state/PIPELINE_STATE.json or state/CURRENT_STAGE.json.
  • Read packages/agent_contracts/hypothesis.py before writing any evolved hypotheses/<id>/HYPOTHESIS.json artifact.
  • Read packages/agent_contracts/state.py before any island state validation, and read packages/run_artifacts/island_state.py before invoking the run-level island persistence helper.
  • Read packages/agent_contracts/ranking.py when the round will write tournament artifacts through downstream ranking work.
  • Read packages/agent_contracts/evolution_round.py before appending state/EVOLUTION_ROUNDS.jsonl.
  • Read the active state/STRATEGY_PLAN.json, state/PIPELINE_STATE.json, state/CURRENT_STAGE.json, state/EVOLUTION_STATE.json, the selected parent hypotheses, and the latest parent review bundles before starting or resuming a round.

Execution Contract:

  • Resume decisions must come from artifact state, not hidden process memory.
  • The active evolution route must be consistent with state/STRATEGY_PLAN.json.
  • Refresh state/STRATEGY_PLAN.json through python -m tools.policy.plan_strategy <run_dir> before every evolution round that is resuming from persisted state.
  • Use an explicit phase override only when the caller is intentionally forcing a new stage transition instead of restoring the current persisted round or substage.
  • Use from tools import sync_pipeline_stage_artifacts as the canonical paired write surface when entering Evolution, Reflection, Insights from Reviews, Proximity, or Ranking.
  • The stage-sync helper is implemented in packages/run_artifacts/stage_sync.py.
  • Before resuming or starting an evolution round, call tools.sync_pipeline_stage_artifacts(...) for Evolution.
  • Before dispatching review, insights, proximity, or ranking work for the active child, call tools.sync_pipeline_stage_artifacts(...) for the exact substage being entered so dashboard state reflects the live round status.
  • Read state/RESOLVED_RUN_CONFIG.json before deciding whether the loop is capped or completion-driven:
    • convergence.max_iterations > 0 means a user-visible capped run.
    • convergence.max_iterations == 0 means completion-driven mode; do not invent a small hard iteration cap.
    • convergence.safety_max_iterations is still a hard safety ceiling and must be recorded if reached.
    • Persist EVOLUTION_STATE.safetyMaxIterations exactly from RESOLVED_RUN_CONFIG.convergence.safety_max_iterations; never rewrite it from the current iteration count.
  • Treat iteration_policy = completion_driven together with human_checkpoint = auto as an autonomous loop contract: after one round closes, refresh routing and continue automatically instead of returning to the user for per-round confirmation.
  • human_checkpoint can still intentionally pause the loop, but only at the configured checkpoint boundary (before_overview, before_completion, or every_major_stage).
  • If the host-agent turn stops before a terminal route is reached, the handoff must state that convergence has not been reached, state is persisted, and the recommended next action is continue evolution through resume or an explicit continue request.
  • One evolution round may create only one new child hypothesis. Do not batch-refine every seed candidate once and then stop.
  • Do not synthesize placeholder hypotheses, reviews, tournaments, proximity receipts, embeddings, or evolution-round receipts to make progress.
  • If an evolve, review, proximity, ranking, convergence, or round-receipt substage cannot run through its canonical skill or tool, stop and report a resumable blocked state instead of writing low-information artifacts.
  • When state/STRATEGY_PLAN.json reports next_action: continue_evolution, use signals.selected_parent_ids as the parent set for the next child hypothesis and persist the resulting parent linkage in HYPOTHESIS.json and ORIGIN.json.
  • Before generating that child, run evolution-strategy-supervisor and choose exactly one concrete evolution strategy allowed by:
    • signals.selection_strategy
    • selected_evolution_strategies
    • the parent hypotheses and their latest review bundles
  • For single-island rounds, use from tools import update_run_single_island_reward as the canonical run-level island reward / decay update and persistence surface after the child has finished review and ranking update receipt coverage.
  • For seed island initialization and multi-island child island creation, use from tools import ensure_run_islands_for_hypotheses as the canonical run-level island initialization surface.
  • The run-level helper is implemented in packages/run_artifacts/island_state.py and delegates the deterministic reward mechanics to packages/agent_mechanics/island_reward_update.py.
  • Do not hand-edit islands/ISLANDS.json, and never write state/ISLANDS.json. The run-level helper must load hypotheses, apply decay/reward, and persist the canonical islands/ISLANDS.json artifact.
  • After the run-level helper returns, reload canonical islands/ISLANDS.json and confirm the selected island now has nonzero visit_count and nonzero decayed_visits; the selected island visit_count must also cover the completed single-island round receipts that selected it.
  • If the selected island metrics do not validate after a single-island closeout, stop before the next routing refresh, run python -m tools.validation.contract_validation <run_dir> --skill hypothesis-evolution-loop, and report a resumable blocked state instead of continuing on stale UCB state.
  • Newly created islands must remain unvisited until they are later selected by a completed single-island round: verify decayed_reward = 0.0, decayed_visits = 0.0, and visit_count = 0 after calling the initialization helper.
  • Persist only canonical island fields. Do not add dashboard-derived or router-derived fields such as hypothesis_ids, ucb_score, or strategy_label to islands/ISLANDS.json.
  • The lower-level tools.update_single_island_reward(...), tools.compute_single_island_reward(...), and tools.apply_decayed_island_update(...) surfaces are internal/testing fallbacks only for in-memory mechanics; do not use them as the host-agent evolution-loop persistence path.
  • Use from tools import evaluate_convergence as the canonical convergence-counter update surface after the child's final top-k membership is known.
  • The convergence helper is implemented in packages/agent_mechanics/convergence_check.py.
  • Use from tools import append_evolution_round_record as the canonical append-only write surface for state/EVOLUTION_ROUNDS.jsonl after the child has completed review, proximity, ranking, and convergence updates.
  • state/EVOLUTION_ROUNDS.jsonl is the completed round receipt. It does not replace state/STRATEGY_DECISIONS.jsonl, and it must not be used to rewrite prior routing decisions.
  • The round receipt's placement_match_ids and ranked_match_ids must be child-owned closeout refs for that round only:
    • placement refs require match_strategy = placement_tournament and hypothesis_1_id = child_hypothesis_id
    • ranked refs require match_strategy = ranked_tournament and hypothesis_1_id = child_hypothesis_id
    • duplicate match IDs are invalid
    • later matches where the child appears as hypothesis_2_id may remain in the child's lifetime HYPOTHESIS.json refs, but they must not be copied into this earlier round receipt
  • After appending a completed round receipt, update state/EVOLUTION_STATE.json from the same convergence helper output and refresh state/STRATEGY_PLAN.json; do not leave pre-round router signals as the current plan.
  • The referenced continue_evolution decision must be a canonical router record from python -m tools.policy.plan_strategy <run_dir> with router-level signals. Do not add child IDs, chosen concrete strategies, proximity statuses, tournament IDs, top-k entry results, or convergence transitions to state/STRATEGY_DECISIONS.jsonl.
  • Treat the referenced router signals as a replayable pre-round state contract:
    • signals.hypothesis_count and signals.viable_hypothesis_count are the counts before the child is created.
    • signals.convergence_count is the value before the child is created and must become the round receipt's convergence_count_before.
    • signals.entered_top_k_last_round must reflect the prior completed round when one exists.
    • signals.top_hypothesis_ids must become the round receipt's previous_top_k_ids.
    • signals.selected_parent_ids must reference viable hypotheses already persisted before the child is created.
    • signals.selected_island_ids must match the selected parents' persisted island_id values.
  • A completed evolution round must be replayable from exactly one router decision, one evolved child, one review bundle, one proximity receipt, completed ranking artifacts with ranking update receipt coverage, one convergence update, and one appended round receipt.
  • After emitting the child hypothesis, you must:
    • run hypothesis-review-pipeline
    • run insights-from-reviews when the child is viable
    • run hypothesis-proximity-update for each viable child hypothesis
    • run hypothesis-ranking-pipeline
    • for signals.selection_strategy == single_island, call tools.update_run_single_island_reward(run_dir, selected_island_id, candidate_hypothesis.id, decay_factor) exactly once after the child's final Elo and viability state are known, and use the helper-persisted canonical islands/ISLANDS.json artifact as the source of truth
    • after that single-island reward update, verify the helper-persisted selected island has nonzero visit_count and decayed_visits; do not append a completed round receipt or refresh routing if the selected island metrics are stale
    • for signals.selection_strategy == multi_island, assign the child a new non-empty island_id, call tools.ensure_run_islands_for_hypotheses(run_dir, [candidate_hypothesis.id]), verify the created island remains unvisited, and do not apply the single-island reward helper to that cross-island child
    • call tools.evaluate_convergence(candidate_hypothesis.id, previous_top_k_ids, current_top_k_ids, current_convergence_count) exactly once after the final ranked frontier is known, then persist both enteredTopKLastRound and convergenceCount exactly as returned
    • call tools.append_evolution_round_record(run_dir, record) exactly once with an EvolutionRoundRecordContract that records the decision index, selected parent IDs, selected island IDs, chosen concrete evolution strategy, child hypothesis ID, child island ID, proximity receipt status, child-owned placement/ranked tournament match IDs, previous/current top-k IDs, entered_top_k, and convergence counts before and after the round
    • update state/EVOLUTION_STATE.json
  • When next_action: return_to_generation, leave the evolution loop, run the requested generation pass, then refresh the evolution plan again.
  • Do not skip proximity because no embedding vector is already present. The bridge owns provider invocation and records a receipt/status when the provider is disabled, unavailable, invalid, or failed.
  • Do not generate, infer, or fabricate embeddings in prompt output. Let ranking use its documented receipt-gated missing-graph fallback only after hypothesis-proximity-update has recorded a skipped or failed receipt/status.
  • The evolution-round proximity_receipt_status must be copied from the persisted per-child state/proximity_receipts/<child_hypothesis_id>.json receipt. Do not infer this field from environment variables, provider availability, or dashboard state.
  • The loop is complete only when state/EVOLUTION_STATE.json records a terminal stop reason and the routing audit log contains one decision record per evolved hypothesis.
  • When writing state/EVOLUTION_STATE.json, persist the active stopPolicy, iterationPolicy, iterationBand, and safetyMaxIterations metadata from the effective run configuration and policy artifacts.
  • Only record stopReason: safety_iteration_limit_reached when iterationCount >= RESOLVED_RUN_CONFIG.convergence.safety_max_iterations and safetyLimitHit is true.
  • When consumed by a host agent, run python -m tools.validation.contract_validation <run_dir> --skill hypothesis-evolution-loop after each evolved hypothesis is persisted.
  • When the loop reports status: completed, run python -m tools.validation.verify_pipeline_completion <run_dir> --skill hypothesis-evolution-loop.
  • The final research overview remains a separate step in research-overview-pipeline.
  • Treat complete as a completion-verifier outcome after overview, not as a state/STRATEGY_PLAN.json route.

Read the full file on GitHub · 147 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. 4d ago First seen · 147 lines · 20 tokens per session scan A 6b6eebab4697

Subscribe to this mod's changes

hypothesis-evolution-loop is a skill published in the GitHub repository panjose/Co-Scientist (5 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 20 tokens to every session and 4,141 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-31.

Related

Other skills, from other repositories

figure-style

Publication-grade correctness and legibility rules for final-deliverable scientific figures, not exploratory plots. Use for a figure that will ship in a report, paper, export, or kept artifact. Covers data fidelity, label economy, color threading, chart choice, layout, and render-then-verify QA without imposing a…

aipoch/open-science · 91 tokens

paper-narrative

Judge and reshape the story told by an entire paper figure deck. Use when writing or revising a paper to derive a grounded brief from the manuscript and captions, review the full deck as a handling editor, and hand an ordered figure arc to figure-composer.

aipoch/open-science · 58 tokens

remote-compute-ssh

Evaluate and use SSH Remote Compute before choosing where to run GPU, high-memory, parallel, batch, model-inference, bioinformatics, or other long-running scientific work; supports short remote commands and asynchronous jobs with automatic harvest and analysis.

aipoch/open-science · 53 tokens

scvi-tools

Probabilistic single-cell RNA-seq with scvi-tools — scVI for a batch-corrected latent space, scANVI for semi-supervised label transfer, and Bayesian differential expression. Reach for this skill to integrate scRNA-seq batches, embed cells for clustering, transfer annotations from a reference onto a query, or score…

aipoch/open-science · 100 tokens

customize

Use when the user wants to create or manage a Specialist agent or create, revise, publish, or delete a Skill through the conversational /Customize entry. Routes Skill work to the internal skill-creator and handles Specialist work through the JavaScript host.agents SDK.

aipoch/open-science · 56 tokens

esmfold2

Biohub ESMFold2 / ESMFold2-Fast all-atom co-folding (Candido et al. 2026, github.com/Biohub/esm). Single-sequence and MSA modes; protein, DNA, RNA, ligand (CCD/SMILES), modified residues. FoldBench Ab-Ag 50-55%, PPI 70-77% DockQ-pass. Also covers the ESMC-{300M,600M,6B} protein language models from the same release…

aipoch/open-science · 223 tokens