medsci-agent: Command for Claude Code

.opencode/commands/ace-learn.md

ace-learn is a command for Claude Code, OpenCode from omar-A-hassan/medsci-agent. It costs 23 tokens per session (683 once invoked), scanned A, original, MIT.

A command for running ACE post-run learning after a completed task. It uses the task question, answer, and execution details to assess whether there is enough evidence for learning.

In plain words
What is it for?
It helps record lessons from completed research-agent tasks, including tool use, failures, and the quality of the outcome.
Why use it?
It creates a controlled review of what happened instead of learning from incomplete or placeholder results. It also loads prior learning before adding new feedback.

Command for Claude CodeOpenCode

Written for Claude Code and OpenCode: $ARGUMENTS substitution, but also installed under .opencode/. Also seen: agent in frontmatter; mentions OpenCode.

This is omar-A-hassan/medsci-agent's own configuration. It tells Claude Code and OpenCode how to work on medsci-agent 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 medsci-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to omar-A-hassan/medsci-agent. 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/omar-A-hassan/medsci-agent/main/.opencode/commands/ace-learn.md
Clone the repo
git clone --depth 1 https://github.com/omar-A-hassan/medsci-agent

Made for: Claude Code, OpenCode.

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 ace-learn

README.md
[![agentmods](https://agentmods.dev/badge/commands/omar-a-hassan/medsci-agent/ace-learn.svg)](https://agentmods.dev/commands/omar-a-hassan/medsci-agent/ace-learn)
Your own site
<a href="https://agentmods.dev/commands/omar-a-hassan/medsci-agent/ace-learn"><img src="https://agentmods.dev/badge/commands/omar-a-hassan/medsci-agent/ace-learn.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 683 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.00023 $0.00683
Opus 5 $0.00012 $0.00342
Sonnet 5 $0.00005 $0.00137
Haiku 4.5 $0.00002 $0.00068

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

Security

Grade A, and why

ace-learn 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 8d 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.

.opencode/commands/ace-learn.md · 64 lines

What it actually says

Use ACE MCP to perform controlled post-run learning for this completed task.

Task context (JSON-encoded): $ARGUMENTS

Parse $ARGUMENTS as a JSON object. It contains exactly three fields:

  • question — the user's task description
  • answer — the medsci agent's final response
  • telemetry — execution telemetry (tool_calls, failures, last_tool, etc.)

Example: {"question":"Find KRAS inhibitors","answer":"Found 3 hits...","telemetry":"tool_calls=8 | failures=0 | ..."}

Extract these three values before calling any tools.

Workflow (strictly sequential — wait for each result before the next step):

Step 1 — Load prior skillbook Call ace.skillbook.load with:

  • session_id: "medsci:multidomain"
  • path: ".opencode/ace/skillbooks/medsci_multidomain.json"

If the file does not exist yet, the load will fail — that is expected on first run. Continue to Step 2.

Step 2 — Assess evidence quality Before calling ace.learn.feedback, assess:

  • Is there a real question and answer (not the "(unknown)" placeholder)?
  • Were at least 2 domain tool calls made (from telemetry)?
  • Is the outcome meaningful (partial success, failure, or clear success)?

If evidence is too weak (e.g. question is placeholder AND no failures), skip Steps 3–4 and explain why.

Step 3 — Learn from feedback Call ace.learn.feedback with:

  • session_id: "medsci:multidomain"
  • question: <extracted question — the user's actual scientific task>
  • answer: <extracted answer — what the medsci agent actually did and concluded>
  • context: "MedSci multi-domain scientific research agent: drug discovery, protein structure, literature synthesis, omics analysis"
  • feedback: <telemetry field — failures, tool outcomes, what succeeded or failed>

The Reflector will analyze what worked and what failed. The SkillManager will generate atomic imperative strategy updates (ADD/UPDATE/TAG/REMOVE). Skills must be concrete and actionable — e.g. "Use search_type='molecule' not 'target' for ChEMBL inhibitor queries."

Step 4 — Persist Call ace.skillbook.save with:

  • session_id: "medsci:multidomain"
  • path: ".opencode/ace/skillbooks/medsci_multidomain.json"

Step 5 — Report delta Call ace.skillbook.get with session_id: "medsci:multidomain", limit: 5. Report:

  • Skills before / after counts
  • Top new or updated skills
  • Any stale/harmful skills flagged for future removal

Rules:

  • Do not invent outcomes or feedback.
  • Skip Steps 3–4 if evidence quality is too weak; explain why.
  • Keep feedback specific, testable, and tied to observed tool behavior.
  • Strategies must be imperative commands under 15 words (e.g. "Retry ChEMBL with synonym if target search returns no compounds").
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. 8d ago First seen · 64 lines · 23 tokens per session scan A c36a52e4aeb1

Subscribe to this mod's changes

ace-learn is a command published in the GitHub repository omar-A-hassan/medsci-agent (18 stars, last pushed yesterday), licensed MIT. It adds 23 tokens to every session and 683 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.