modscode JA

modscode / Gallery / agent-cats

agent-cats

A dashboard of the session's agents as coloured cats: their tasks, skills and run time, their questions answered in place with a meow, and the skills each task uses

Code you can checkTerminal + desktopPaneToastBoxButtonInputSelectSvgText

What it does

  • Draws a pane, toasts
  • Adds /cats
  • Watches AskUserQuestion calls and can refuse them
  • Hooks agent.spawn, classic.PermissionRequest, prompt.submit, session.start and 3 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • 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 agent-cats by anthonyzng (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/anthonyzng-agent-cats/
// 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: "Agent Cats" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input, Select } = $.ui.resolve(e)
    const working = '…'
    const sleeping = '…'
    const length = '…'
    const name = '…'
    const filterPlaceholder = '…'
    const filter = '…'
    const waited = '…'
    const header = '…'
    const question = '…'
    const label = '…'
    const question2 = '…'
    const question3 = '…'
    const name2 = '…'
    const question4 = '…'
    const question5 = '…'
    const question6 = '…'
    const name3 = '…'
    const question7 = '…'
    const question8 = '…'
    const question9 = '…'
    const taskLabel = '…'
    const status = '…'
    const elapsed = '…'
    const type = '…'
    const usingTool = '…'
    const skillsUsed = '…'
    const status2 = '…'
    const elapsed2 = '…'
    const type2 = '…'
    const status3 = '…'
    const elapsed3 = '…'
    const type3 = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" gap={2}>
          <Text bold>
            {"🐾 "}
            Agent Cats
          </Text>
          <Text color="#2A9D8F">
            Working
            {" "}
            {working}
          </Text>
          <Text color="#8E7DBE">
            Asleep
            {" "}
            {sleeping}
          </Text>
          <Text color="#E76F51">
            Waiting for you
            {" "}
            {length}
          </Text>
        </Box>
        <Box flexDirection="column" gap={1} borderStyle="round" borderColor="#4D96FF" paddingX={1}>
          <Box flexDirection="row" gap={2} alignItems="center" flexWrap="wrap">
            <Text bold color="#4D96FF">
              Skills for this task
            </Text>
            <Button label="Mode: only the chosen ones" variant="primary" />
            <Button label="Refresh list" plain />
          </Box>
          <Box flexDirection="row" flexWrap="wrap" gap={1}>
            <Button label={`${name} ✕`} />
            <Button label={`${name} ✕`} />
            <Button label={`${name} ✕`} />
            <Button label="Clear all" plain />
          </Box>
          <Input placeholder={`${filterPlaceholder}`} value={`${filter}`} submitLabel="Filter" />
          <Select label="Add a skill: " value="__pick__" />
          <Text dimColor>
            No installed skills found. Try "Refresh list".
          </Text>
          <Input placeholder="Find a new skill: say what you need, Enter asks the main agent to search" submitLabel="Search" />
        </Box>
        <Box flexDirection="column" gap={1} borderStyle="round" borderColor="#E76F51" paddingX={1}>
          <Text bold color="#E76F51">
            Needs your reply
          </Text>
          <Box flexDirection="column" gap={1}>
            <Box flexDirection="row" gap={1} alignItems="center">
              <Text>
                ᓚᘏᗢᶻ
              </Text>
              <Text bold>
                {name}
              </Text>
              <Text dimColor>
                {`${waited}`}
              </Text>
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question2}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question3}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="row" gap={1}>
              <Button label="Send answers" variant="primary" />
              <Button label="Use the native dialog" />
            </Box>
          </Box>
          <Box flexDirection="column" gap={1}>
            <Box flexDirection="row" gap={1} alignItems="center">
              <Text>
                ᓚᘏᗢᶻ
              </Text>
              <Text bold>
                {name2}
              </Text>
              <Text dimColor>
                {`${waited}`}
              </Text>
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question4}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question5}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question6}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="row" gap={1}>
              <Button label="Send answers" variant="primary" />
              <Button label="Use the native dialog" />
            </Box>
          </Box>
          <Box flexDirection="column" gap={1}>
            <Box flexDirection="row" gap={1} alignItems="center">
              <Text>
                ᓚᘏᗢᶻ
              </Text>
              <Text bold>
                {name3}
              </Text>
              <Text dimColor>
                {`${waited}`}
              </Text>
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question7}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question8}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="column">
              <Text>
                {`[${header}] `}
                {question9}
              </Text>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
                <Button label={`✓ ${label}`} variant="primary" />
              </Box>
              <Input placeholder="Other (type your own, Enter to confirm)" value="" submitLabel="Confirm" />
            </Box>
            <Box flexDirection="row" gap={1}>
              <Button label="Send answers" variant="primary" />
              <Button label="Use the native dialog" />
            </Box>
          </Box>
        </Box>
        <Text dimColor>
          No agents yet.
        </Text>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" gap={1} alignItems="center">
            <Text>
              ᓚᘏᗢᶻ
            </Text>
            <Text bold wrap="truncate-end">
              Main agent
            </Text>
            <Button label="✎ Rename" plain />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`${taskLabel}`}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Input placeholder="New name (empty: back to the task name)" value="" submitLabel="Rename" autoFocus />
            <Button label="Cancel" plain />
          </Box>
          <Box flexDirection="row" gap={2} flexWrap="wrap">
            <Text>
              {status}
            </Text>
            <Text dimColor>
              {"⏱ "}
              {elapsed}
            </Text>
            <Text dimColor>
              {type}
            </Text>
            <Text color="#4D96FF">
              {`${usingTool}`}
            </Text>
          </Box>
          <Text>
            {`${skillsUsed}`}
          </Text>
          <Select label="+Skill: " value="__pick__" />
          <Box flexDirection="column">
            <Input placeholder="Give it a new task, Enter wakes it" submitLabel="Wake" />
            <Button label="No need to wake it again: close" plain />
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" gap={1} alignItems="center">
            <Text>
              ᓚᘏᗢᶻ
            </Text>
            <Text bold wrap="truncate-end">
              Main agent
            </Text>
            <Button label="✎ Rename" plain />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`${taskLabel}`}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Input placeholder="New name (empty: back to the task name)" value="" submitLabel="Rename" autoFocus />
            <Button label="Cancel" plain />
          </Box>
          <Box flexDirection="row" gap={2} flexWrap="wrap">
            <Text>
              {status2}
            </Text>
            <Text dimColor>
              {"⏱ "}
              {elapsed2}
            </Text>
            <Text dimColor>
              {type2}
            </Text>
            <Text color="#4D96FF">
              {`${usingTool}`}
            </Text>
          </Box>
          <Text>
            {`${skillsUsed}`}
          </Text>
          <Select label="+Skill: " value="__pick__" />
          <Box flexDirection="column">
            <Input placeholder="Give it a new task, Enter wakes it" submitLabel="Wake" />
            <Button label="No need to wake it again: close" plain />
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" gap={1} alignItems="center">
            <Text>
              ᓚᘏᗢᶻ
            </Text>
            <Text bold wrap="truncate-end">
              Main agent
            </Text>
            <Button label="✎ Rename" plain />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`${taskLabel}`}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Input placeholder="New name (empty: back to the task name)" value="" submitLabel="Rename" autoFocus />
            <Button label="Cancel" plain />
          </Box>
          <Box flexDirection="row" gap={2} flexWrap="wrap">
            <Text>
              {status3}
            </Text>
            <Text dimColor>
              {"⏱ "}
              {elapsed3}
            </Text>
            <Text dimColor>
              {type3}
            </Text>
            <Text color="#4D96FF">
              {`${usingTool}`}
            </Text>
          </Box>
          <Text>
            {`${skillsUsed}`}
          </Text>
          <Select label="+Skill: " value="__pick__" />
          <Box flexDirection="column">
            <Input placeholder="Give it a new task, Enter wakes it" submitLabel="Wake" />
            <Button label="No need to wake it again: close" plain />
          </Box>
        </Box>
        <Button label="Hide the finished cats" plain />
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const text = '…'
    const skillNotGiven = '…'
    await $.ui.toast(`🐱 ${text}`)
    await $.ui.toast(`🐱 ${skillNotGiven}`)
    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 540–699 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    renders += 1
    const table = $.ui.resolve(e)
    const { Box, Text, Button } = table
    const Svg = 'Svg' in table ? table.Svg : undefined
    const Input = 'Input' in table ? table.Input : undefined
    const Select = 'Select' in table ? table.Select : undefined
    const installed = await read($, skills)
    const active = await read($, activeSkills)
    const mode = await read($, skillMode)
    const filter = await read($, skillFilter)
    const editing = await read($, renaming)
    const rows = await read($, agents)
    const waits = await read($, pending)
    const now = Math.max(await read($, clockNow), ...rows.map(r => r.endedAt ?? r.startedAt))
    const nativeIds = await read($, native)
    const byId = (id: string) => rows.find(r => r.id === id)

    const cat = (color: string, isAsleep: boolean, key: string) =>
      Svg ? (
        <Svg key={key} source={catSvg(color, isAsleep)} alt={isAsleep ? 'sleeping cat' : 'cat'} width={28} height={28} />
      ) : (
        <Text color={color}>{isAsleep ? 'ᓚᘏᗢᶻ' : 'ᓚᘏᗢ'}</Text>
      )

    const setPending = (id: string, change: (p: CatPending) => CatPending) =>
      update($, pending, list => (list ?? []).map(p => (p.id === id ? change(p) : p)))

    const pick = (p: CatPending, index: number, label: string) =>
      setPending(p.id, cur => {
        const q = cur.questions[index]
        const had = cur.picks[index] ?? []
        const chosen = q?.isMulti
          ? had.includes(label)
            ? had.filter(l => l !== label)
            : [...had, label]
          : [label]
        const others = q?.isMulti ? cur.others : cur.others.map((o, i) => (i === index ? '' : o))

        return { ...cur, picks: cur.picks.map((l, i) => (i === index ? chosen : l)), others }
      })

    const typeOther = (p: CatPending, index: number, text: string) =>
      setPending(p.id, cur => {
        const isMulti = cur.questions[index]?.isMulti
        const picks = isMulti ? cur.picks : cur.picks.map((l, i) => (i === index ? [] : l))

        return { ...cur, picks, others: cur.others.map((o, i) => (i === index ? text : o)) }
      })

    const send = (p: CatPending) => {
      const answers: Answers = {}
      p.questions.forEach((q, i) => {
        answers[q.question] = answerOf(p, i)
      })
      resolvers.get(p.id)?.(answers)
    }

    const working = rows.filter(r => r.status === 'working').length
    const sleeping = rows.filter(r => r.status === 'sleeping').length
    const visible = rows.filter(r => !r.isHidden)
    const hiddenClosed = rows.some(r => r.status === 'closed' && !r.isHidden)

    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" gap={2}>
          <Text bold>🐾 {t.title}</Text>
          <Text color={STATUS_COLOR.working}>
            {t.counts.working} {working}
          </Text>
          <Text color={STATUS_COLOR.sleeping}>
            {t.counts.sleeping} {sleeping}
          </Text>
          <Text color={waits.length > 0 ? '#E76F51' : '#888888'}>
            {t.counts.waiting} {waits.length}
          </Text>
        </Box>

        <Box flexDirection="column" gap={1} borderStyle="round" borderColor="#4D96FF" paddingX={1}>
          <Box flexDirection="row" gap={2} alignItems="center" flexWrap="wrap">
            <Text bold color="#4D96FF">{t.skillsHeading}</Text>
            <Button
              key="skill-mode"
              label={mode === 'only' ? t.modeOnly : t.modePrefer}
              variant={mode === 'only' ? 'primary' : 'secondary'}
              onPress={() => update($, skillMode, m => (m === 'only' ? 'prefer' : 'only'))}
            />
            <Button
              key="skills-reload"
              label={t.reloadList}
              plain
              onPress={async () => {
                $.ui.toast(`🐱 ${await loadSkills($)}`)
              }}
            />
          </Box>
          {active.length === 0 ? (
            <Text dimColor>{t.noneChosen}</Text>
          ) : (
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              {active.map(name => (
                <Button
                  key={`active-${name}`}
                  label={`${name} ✕`}
                  onPress={() => update($, activeSkills, list => (list ?? []).filter(n => n !== name))}
                />
              ))}
              <Button key="active-clear" label={t.clearAll} plain onPress={() => update($, activeSkills, () => [])} />
            </Box>
          )}
          {Input && installed.length > MAX_SKILL_OPTIONS && (
            <Input
              key="skill-filter"
              placeholder={t.filterPlaceholder(installed.length)}
              value={filter}
              submitLabel={t.filterSubmit}
              onSubmit={value => update($, skillFilter, () => value)}
            />
          )}
          {Select && installed.length > 0 && (
            <Select
              key="active-add"
              label={t.addSkill}
              value={PICK_HINT}
              options={skillOptions(
                installed.filter(n => !active.includes(n)),
                filter,
                t.pickInstalled,
              )}
              onSelect={value => {
                if (value !== PICK_HINT) {
                  void update($, activeSkills, list => [...new Set([...(list ?? []), value])])
                }
              }}
            />
          )}
          {installed.length === 0 && <Text dimColor>{t.noSkillsFound}</Text>}
          {Input && (
            <Input
              key="skill-search"
              placeholder={t.searchPlaceholder}
              submitLabel={t.searchSubmit}
              onSubmit={value => {
                const need = value.trim()
                if (need) {
                  void $.prompt.submit({
                    text:
                      `From the Agent Cats dashboard, the user wants a new skill for: "${need}". ` +
                      'Search the skill and plugin catalogs (SearchSkills, SearchPlugins), then show the fitting results ' +
                      'as install cards (SuggestSkills, SuggestPluginInstall) so the user approves the install. Do not install anything yourself.',
                  })
                  $.ui.toast(`🐱 ${t.searchToast}`)
                }
              }}
            />
          )}
        </Box>

        {waits.length > 0 && (
          <Box flexDirection="column" gap={1} borderStyle="round" borderColor="#E76F51" paddingX={1}>
Licence text (MIT)
MIT License

Copyright (c) 2026 anthonyzng

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

drives Claudetool callsremembers

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 ea3f43d0e514 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.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no 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 anthonyzng/agent-cats
/plugin install agent-cats@agent-cats

This installs the marketplace's latest commit, which may not be the one read here (ea3f43d0e514). 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 "anthonyzng-agent-cats" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs