MedClaw: Heuristic Agent Harness
for Long-Horizon Surgical Video Reasoning

Improving by evolving context rather than optimizing weights.

Yingying Fan1,2,*, Penghui Du3,*, Leyan Zhu3, Runze He3, Zimeng Wu3, Yuxuan Zhang5, Liang Chen3, Jiahao Xie3, Jiangtang Wang4, Shuai Shao4, Anchao Yang6, Yutong Bai6, Yan Wang1

1Beijing Jiaotong University   2University of Maryland, College Park   3UniPat.ai
4Suzhou Institute for Advanced Research, USTC   5University of British Columbia
6Department of Neurosurgery, Beijing Tiantan Hospital, Capital Medical University

* Equal contribution  ·  Corresponding authors: Anchao Yang, Yutong Bai, Yan Wang


Abstract

Understanding tens-of-minutes surgical videos requires long-horizon temporal reasoning: answering what happens before, after, or across stages of a procedure by grounding the question in visual evidence spread across time. Existing approaches handle this poorly. A one-shot vision–language model compresses the whole procedure to fit its context window and loses the detail a “before” or “after” question depends on, while video agents that train the model where to look are data-hungry and transfer poorly to out-of-domain surgery.

We build an agent harness that separates reasoning from perception and improves by evolving context rather than optimizing weights. A text-only orchestrator plans which evidence to gather and issues an auditable sequence of tool calls, while frozen vision–language sub-agents execute each call over the pixels — viewing, cropping, inspecting frames, and retrieving external knowledge. We further propose a gradient-free, reward-gated Heuristic Skill Distillation loop that mines the agent's own low-scoring traces and keeps a candidate skill only when it raises a validation reward, yielding reusable retrieval skills, notably directed re-look. Growing an external skill library rather than tuning weights, the loop adapts from only about one hundred labeled examples.

To evaluate this agent we introduce MedClawBench, a de-leaked, doctor-grounded benchmark of 1,123 questions over self-built long neurosurgery recordings and a held-out public lecture-video test split. Across both datasets and all four evaluation dimensions, our agent consistently outperforms one-shot VLMs and general video-agent frameworks, with the largest gains on the long, out-of-domain neurosurgery videos.


Three approaches to a long surgical video question. A one-shot VLM samples sparse keyframes and misses the evidence; SFT-based agents need massive training data and generalize poorly; MedClaw keeps every model frozen and distills reusable skills from about one hundred examples.
Figure 1. Long-horizon temporal reasoning on a long surgery video, where an “after” question is answered by evidence lying outside the window that depicts the named event. (a) A one-shot VLM reads the whole procedure in a single pass, losing the detail the question needs. (b) SFT-based agents learn where to look through supervised or reinforcement fine-tuning, which needs massive data and transfers poorly out of domain. (c) MedClaw keeps every model frozen and instead distills reusable skills through Heuristic Skill Distillation, collecting failure traces, diagnosing the gap, and retaining a skill only when it passes a reward gate.

Method

No weights are updated anywhere in the system. A text-only orchestrator (Opus-4.8) decides where to look but never sees a pixel; frozen vision sub-agents execute each call and return text. Competence accrues in an external skill library.