modscode JA

modscode / Gallery / autoscience

autoscience

Autonomous optimize-measure-keep/discard loop: skill, run/log/stats tools, and a live experiment dashboard

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /autoresearch-dash
  • Watches mcp__autoscience__run, mcp__autoscience__log, mcp__autoscience__stats, mcp__autoscience__tail calls
  • Hooks session.start, ui.close
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like autoscience by Miles McGuire (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/minuteman3-autoscience/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Autoresearch" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const headline = '…'
    const progress = '…'
    const fmt = '…'
    const sparkline = '…'
    const SPIN = '…'
    const repeats = '…'
    const ago = '…'
    const last = '…'
    const metric = '…'
    const start = '…'
    const run = '…'
    const label = '…'
    const signed = '…'
    const confidence = '…'
    const commit = '…'
    const desc = '…'
    const run2 = '…'
    const label2 = '…'
    const fmt2 = '…'
    const signed2 = '…'
    const commit2 = '…'
    const desc2 = '…'
    const run3 = '…'
    const label3 = '…'
    const fmt3 = '…'
    const signed3 = '…'
    const commit3 = '…'
    const desc3 = '…'
    const run4 = '…'
    const label4 = '…'
    const desc4 = '…'
    const why = '…'
    const k = '…'
    const confWord = '…'
    const map = '…'
    const ts = '…'
    const seconds = '…'
    return (
      <Box flexDirection="column">
        <Text bold>
          {headline}
        </Text>
        <Text dimColor>
          {progress}
          {" · "}
          lower
          {" is better"}
          {` · noise ±${fmt}`}
        </Text>
        <Text color="cyan">
          {sparkline}
        </Text>
        <Text color="magenta">
          {SPIN}
          {" measuring"}
          {` ×${repeats}`}
          {" + checks"}
          {" · "}
          {ago}
        </Text>
        <Text dimColor wrap="truncate">
          {" "}
          {last}
        </Text>
        <Text>
          {" "}
        </Text>
        <Text dimColor>
          {`   #   status         ${metric}Δ best   conf   commit   experiment`}
        </Text>
        <Text dimColor>
          {" … "}
          {start}
          {" earlier"}
        </Text>
        <Text wrap="truncate">
          <Text>
            {" › "}
          </Text>
          <Text>
            {run}
          </Text>
          <Text>
            {label}
          </Text>
          <Text>
            {fmt}
          </Text>
          <Text>
            {signed}
          </Text>
          <Text>
            {`${confidence}×`}
          </Text>
          <Text dimColor>
            {commit}
          </Text>
          <Text>
            {desc}
          </Text>
        </Text>
        <Text wrap="truncate">
          <Text>
            {" › "}
          </Text>
          <Text>
            {run2}
          </Text>
          <Text>
            {label2}
          </Text>
          <Text>
            {fmt2}
          </Text>
          <Text>
            {signed2}
          </Text>
          <Text>
            {`${confidence}×`}
          </Text>
          <Text dimColor>
            {commit2}
          </Text>
          <Text>
            {desc2}
          </Text>
        </Text>
        <Text wrap="truncate">
          <Text>
            {" › "}
          </Text>
          <Text>
            {run3}
          </Text>
          <Text>
            {label3}
          </Text>
          <Text>
            {fmt3}
          </Text>
          <Text>
            {signed3}
          </Text>
          <Text>
            {`${confidence}×`}
          </Text>
          <Text dimColor>
            {commit3}
          </Text>
          <Text>
            {desc3}
          </Text>
        </Text>
        <Box flexDirection="row" gap={2}>
          <Button hotkey="k" plain>
            up
          </Button>
          <Button hotkey="j" plain>
            down
          </Button>
          <Button hotkey="l" plain>
            latest
          </Button>
          <Button hotkey="g" plain>
            first
          </Button>
        </Box>
        <Text>
          {" "}
        </Text>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Text bold>
            Experiment #
            {run4}
            {" · "}
            <Text>
              {label4}
            </Text>
            <Text color="green">
              {" · current best"}
            </Text>
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"idea       "}
            </Text>
            {desc4}
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"why        "}
            </Text>
            {why}
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {k}
            </Text>
            {`${fmt}  (${signed} vs best at the time)`}
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"confidence "}
            </Text>
            <Text>
              {confidence}
              {"× noise · "}
              {confWord}
            </Text>
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"samples    "}
            </Text>
            {map}
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"checks     "}
            </Text>
            <Text color="green">
              passed
            </Text>
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"commit     "}
            </Text>
            {`${commit}`}
          </Text>
          <Text wrap="wrap">
            <Text dimColor>
              {"when       "}
            </Text>
            {`${ts} · took ${seconds}s`}
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const run = '…'
    const desc = '…'
    await $.ui.toast(`autoresearch: kept #${run} ${desc}`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

hooks/register.tsx lines 221–285 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const s = await read($, snap)
    if (!s.active) return <Text dimColor>No .auto/ session yet. It appears when an autoresearch run starts.</Text>
    const live = await read($, running)
    const t = await read($, now)
    const sel = await read($, selected)
    const cols = e.props.bodyColumns || e.viewport?.columns || 60
    const rows = e.viewport?.rows ?? 24
    const runs = s.runs
    const cur: Run | undefined = runs.find(r => r.run === sel) ?? runs[runs.length - 1]
    const idx = cur ? runs.indexOf(cur) : -1
    const pick = (i: number) => update($, selected, () => runs[Math.max(0, Math.min(runs.length - 1, i))]?.run ?? null)

    // List window: keep the selected row in view, newest at the bottom like a log.
    const listRows = Math.max(3, rows - 22)
    const start = Math.max(0, Math.min(idx - Math.floor(listRows / 2), runs.length - listRows))
    const window = runs.slice(start, start + listRows)
    const vals = runs.map(r => r.value).filter((v): v is number => v != null)
    const descW = Math.max(8, cols - 44)

    return (
      <Box flexDirection="column">
        <Text bold>{headline(s)}</Text>
        <Text dimColor>
          {progress(s)} · {s.direction === 'min' ? 'lower' : 'higher'} is better{s.noise != null ? ` · noise ±${fmt(s.noise)}` : ''}
        </Text>
        {vals.length > 1 && <Text color="cyan">{sparkline(vals, Math.max(10, cols - 2))}</Text>}
        {live && (
          <Text color="magenta">
            {SPIN[Math.floor((t - live.startedAt) / 1000) % SPIN.length]} measuring{live.repeats > 1 ? ` ×${live.repeats}` : ''}
            {live.checks ? ' + checks' : ''} · {ago(Math.max(0, t - live.startedAt))}
          </Text>
        )}
        {live?.last && <Text dimColor wrap="truncate">  {live.last}</Text>}
        <Text> </Text>
        <Text dimColor>{'   #   status         ' + (s.metric || 'value').padEnd(9) + 'Δ best   conf   commit   experiment'}</Text>
        {start > 0 && <Text dimColor>   … {start} earlier</Text>}
        {window.map(r => {
          const st = STATUS[r.status] ?? { color: 'white', label: r.status }
          const isSel = r === cur
          return (
            <Text key={`row-${r.run}`} inverse={isSel} wrap="truncate">
              <Text>{isSel ? ' › ' : '   '}</Text>
              <Text>{String(r.run).padEnd(4)}</Text>
              <Text color={st.color}>{st.label.padEnd(15)}</Text>
              <Text>{fmt(r.value).padEnd(9)}</Text>
              <Text>{(r.deltaPct != null ? signed(r.deltaPct) : '').padEnd(9)}</Text>
              <Text color={confColor(r.confidence)}>{(r.confidence != null ? `${r.confidence.toFixed(1)}×` : '').padEnd(7)}</Text>
              <Text dimColor>{r.commit.padEnd(9)}</Text>
              <Text>{r.desc.slice(0, descW)}</Text>
            </Text>
          )
        })}
        <Box flexDirection="row" gap={2}>
          <Button key="prev" hotkey="k" plain onPress={() => pick(idx - 1)}>up</Button>
          <Button key="next" hotkey="j" plain onPress={() => pick(idx + 1)}>down</Button>
          <Button key="latest" hotkey="l" plain onPress={() => update($, selected, () => null)}>latest</Button>
          <Button key="first" hotkey="g" plain onPress={() => pick(0)}>first</Button>
        </Box>
        <Text> </Text>
        {cur && detail({ r: cur, s, Box, Text, cols })}
      </Box>
    )
  })
hooks/register.tsx lines 288–314 · Pane
function detail({ r, s, Box, Text, cols }: { r: Run; s: ReturnType<typeof snapshot>; Box: any; Text: any; cols: number }) {
  const st = STATUS[r.status] ?? { color: 'white', label: r.status }
  const m = s.metric || 'value'
  const row = (k: string, children: unknown) => (
    <Text wrap="wrap"><Text dimColor>{k.padEnd(11)}</Text>{children}</Text>
  )
  return (
    <Box flexDirection="column" borderStyle="round" paddingX={1} width={Math.min(cols, 100)}>
      <Text bold>
        Experiment #{r.run} · <Text color={st.color}>{st.label}</Text>
        {r.run === s.bestRun ? <Text color="green"> · current best</Text> : ''}
      </Text>
      {row('idea', r.desc || '—')}
      {r.why ? row('why', r.why) : null}
      {row(m, `${fmt(r.value)}${r.deltaPct != null ? `  (${signed(r.deltaPct)} vs best at the time)` : ''}`)}
      {r.confidence != null
        ? row('confidence', <Text color={confColor(r.confidence)}>{r.confidence.toFixed(1)}× noise · {confWord(r.confidence)}</Text>)
        : null}
      {r.samples.length ? row('samples', r.samples.map(fmt).join(', ')) : null}
      {r.checksOk != null
        ? row('checks', <Text color={r.checksOk ? 'green' : 'yellow'}>{r.checksOk ? 'passed' : 'failed'}</Text>)
        : null}
      {row('commit', (r.commit || '—') + (r.status === 'keep' || r.status === 'baseline' ? '' : ' (changes reverted)'))}
      {row('when', r.ts.replace('T', ' ') + (r.seconds != null ? ` · took ${r.seconds}s` : ''))}
    </Box>
  )
}
Licence text (MIT)
MIT License

Copyright (c) 2026 Miles McGuire

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

runs programswrites filestool calls

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit 8fa040d117bb on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.hooks/register.tsx:129 bash (a shell or interpreter); hooks/register.tsx:144 bash (a shell or interpreter)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add minuteman3/claude-autoresearch
/plugin install autoscience@claude-autoresearch

This installs the marketplace's latest commit, which may not be the one read here (8fa040d117bb). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "minuteman3-autoscience" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs