modscode JA

modscode / Gallery / cc-idle

cc-idle

An idle game that runs beside Claude Code, fed only by the work Claude does for you

Code you can checkTerminal + desktopPaneStatus lineToastBoxText

What it does

  • Draws a pane, toasts
  • Adds /idle
  • Watches tool calls
  • Hooks session.end, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Handles errors
  • Writes no files

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 cc-idle by RichardAtCT (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/richardatct-cc-idle/
// 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: "cc-idle" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const NEEDS_YOU_TEXT = '…'
    const generation = '…'
    const resourceLine = '…'
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    return (
      <Box flexDirection="column">
        <Text color="yellow" bold wrap="truncate">
          {"▶ "}
          {NEEDS_YOU_TEXT}
          {" — Esc to answer"}
        </Text>
        <Text wrap="wrap">
          <Text bold>
            GEN-
            {generation}
          </Text>
          {" "}
          <Text color="cyan">
            {resourceLine}
          </Text>
        </Text>
        <Box flexDirection="column" marginTop={1} />
        <Box flexDirection="column" marginTop={1}>
          <Text wrap="wrap">
            {text}
          </Text>
          <Text wrap="wrap">
            {text2}
          </Text>
          <Text wrap="wrap">
            {text3}
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`cc-idle is installed: type /idle to play`)
    await $.ui.toast(`Claude finished — your turn (Esc)`)
    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.

plugins/cc-idle/hooks/register.js lines 5526–5685 · Pane
  on("ui.render", { component: "Pane", requestId: "cc-idle" }, async ($, e) => {
    const elements = $.ui.resolve(e);
    const { Box, Text, Button } = elements;
    const Input = "Input" in elements ? elements.Input : null;
    await read($, rev);
    await read($, boardRev);
    const screen = await read($, view);
    const waiting = await read($, needsYou);
    const selected = await read($, regionIndex);
    paneFocused = e.props.isFocused === true;
    const width = Math.max(24, e.props.bodyColumns ?? 48);
    if (!sync) return /* @__PURE__ */ h(Text, { dimColor: true }, "cc-idle is loading\u2026");
    const game = sync.state;
    const actionButton = (action, onPress) => /* @__PURE__ */ h(
      Button,
      {
        key: `act-${action.hotkey}`,
        label: action.label,
        hotkey: action.hotkey,
        plain: true,
        dimColor: !action.isReady,
        onPress
      }
    );
    const setView = (next) => () => update($, view, () => next);
    const banner = waiting !== "" && /* @__PURE__ */ h(Text, { key: "needs-you", color: "yellow", bold: true, wrap: "truncate" }, "\u25B6 ", NEEDS_YOU_TEXT[waiting], paneFocused ? " \u2014 Esc to answer" : "");
    const header = /* @__PURE__ */ h(Text, { key: "resources", wrap: "wrap" }, /* @__PURE__ */ h(Text, { bold: true }, "GEN-", game.generation), " ", /* @__PURE__ */ h(Text, { color: "cyan" }, resourceLine(game)));
    let body;
    if (screen === "help") {
      body = [
        /* @__PURE__ */ h(Text, { key: "help-title", bold: true, color: "magenta" }, onboarded ? "HOW TO PLAY" : "WELCOME TO CC-IDLE"),
        ...HELP_LINES.map((line, i) => /* @__PURE__ */ h(
          Text,
          {
            key: `help-${i}`,
            color: TONE_COLOR[line.tone],
            dimColor: line.tone === "dim",
            wrap: "wrap"
          },
          line.text
        )),
        /* @__PURE__ */ h(
          Button,
          {
            key: "help-done",
            label: onboarded ? "back" : "got it, start playing",
            hotkey: "i",
            plain: true,
            onPress: async () => {
              if (!onboarded) {
                onboarded = true;
                await $.store.set(ONBOARDED_KEY, true);
              }
              await update($, view, () => "main");
            }
          }
        ),
        !paneFocused && /* @__PURE__ */ h(Text, { key: "help-focus", dimColor: true, wrap: "wrap" }, "Type /idle to give the pane the keyboard.")
      ];
    } else if (screen === "tree") {
      body = [
        /* @__PURE__ */ h(Text, { key: "tree-title", bold: true, color: "magenta" }, "BREAKTHROUGHS"),
        ...breakthroughRows(game).map((row) => /* @__PURE__ */ h(Box, { key: `node-${row.nodeId}`, flexDirection: "column" }, actionButton(row, () => act($, { type: "buy-breakthrough", nodeId: row.nodeId })), /* @__PURE__ */ h(Text, { dimColor: true, wrap: "truncate" }, "   ", row.detail))),
        /* @__PURE__ */ h(Button, { key: "tree-back", label: "back", hotkey: "v", plain: true, onPress: setView("main") })
      ];
    } else if (screen === "chat") {
      const game2 = sync.state;
      const leaveBoard = async () => {
        stopBoard();
        await update($, view, () => "main");
      };
      body = [
        /* @__PURE__ */ h(Text, { key: "board-title", bold: true, color: "magenta" }, "THE BOARD"),
        ...boardLines.length === 0 ? [
          /* @__PURE__ */ h(Text, { key: "board-empty", dimColor: true, wrap: "wrap" }, "A board member is listening. Keep it short.")
        ] : boardLines.map((line, i) => /* @__PURE__ */ h(
          Text,
          {
            key: `board-${i}`,
            color: line.who === "board" ? "magenta" : void 0,
            dimColor: line.who === "system",
            wrap: "wrap"
          },
          line.who === "you" ? "\u203A " : line.who === "board" ? "\u261E " : "",
          line.text
        )),
        boardStop && /* @__PURE__ */ h(Text, { key: "board-thinking", dimColor: true }, "the board is thinking\u2026"),
        Input ? /* @__PURE__ */ h(
          Input,
          {
            key: "board-input",
            placeholder: `say something (max ${MAX_INPUT_CHARS} chars)`,
            submitLabel: "send",
            value: boardDraft,
            autoFocus: true,
            onInput: (value) => {
              boardDraft = value;
            },
            onSubmit: (value) => {
              const line = clipInput(value);
              boardDraft = "";
              if (!line) return void leaveBoard();
              boardLines = appendLine(boardLines, { who: "you", text: line });
              void askBoard($, chatPrompt(game2, line));
            }
          }
        ) : /* @__PURE__ */ h(Text, { key: "board-input", dimColor: true, wrap: "wrap" }, "Chat needs the terminal or desktop app."),
        /* @__PURE__ */ h(Text, { key: "board-keys", dimColor: true, wrap: "wrap" }, "Enter on an empty line goes back to the game."),
        /* @__PURE__ */ h(Button, { key: "board-back", label: "back", hotkey: "c", plain: true, onPress: leaveBoard })
      ];
    } else if (screen === "confirm-ship") {
      body = [
        /* @__PURE__ */ h(Text, { key: "ship-warn", color: "magenta", bold: true, wrap: "wrap" }, "Ship Gen-", game.generation, "? Infrastructure and lab staff reset; Reputation and Breakthroughs stay."),
        /* @__PURE__ */ h(Box, { key: "ship-choices", flexDirection: "row", columnGap: 3 }, /* @__PURE__ */ h(
          Button,
          {
            key: "ship-yes",
            label: "yes, ship it",
            hotkey: "y",
            plain: true,
            onPress: async () => {
              await update($, view, () => "main");
              await act($, { type: "ship-generation" });
            }
          }
        ), /* @__PURE__ */ h(Button, { key: "ship-no", label: "cancel", hotkey: "n", plain: true, onPress: setView("main") }))
      ];
    } else {
      const focus = focusedRegion(game, selected);
      const lab = labView(game, Math.min(24, Math.max(8, width - 24)));
      const regionBlock = focus ? /* @__PURE__ */ h(Box, { key: "region", flexDirection: "column" }, /* @__PURE__ */ h(Text, { wrap: "truncate" }, /* @__PURE__ */ h(Text, { bold: true, color: "cyan" }, focus.region.name), " ", /* @__PURE__ */ h(Text, { dimColor: true }, focus.position, "/", focus.count), " ", /* @__PURE__ */ h(Text, { color: TONE_COLOR[REGION_STATUS[focus.region.status].tone] }, REGION_STATUS[focus.region.status].text)), regionLines(focus.region).map((line, i) => /* @__PURE__ */ h(Text, { key: `region-line-${i}`, dimColor: i > 0, wrap: "truncate" }, line)), /* @__PURE__ */ h(Text, { wrap: "truncate" }, rackDiagram(focus.region, width)), focus.region.incidents.map((incident) => /* @__PURE__ */ h(Text, { key: incident.id, color: "red", wrap: "truncate" }, "\u21AF ", incident.title)), /* @__PURE__ */ h(Box, { flexDirection: "row", columnGap: 2, flexWrap: "wrap" }, infraActions(game, focus.region).map(
        (action) => actionButton(
          action,
          () => act($, { type: "buy", regionId: focus.region.id, tierId: action.tierId })
        )
      ), focus.region.incidents.length > 0 && actionButton(
        { hotkey: "a", label: "acknowledge", isReady: true },
        () => act($, { type: "ack-incident", regionId: focus.region.id })
      ), focus.count > 1 && /* @__PURE__ */ h(
        Button,
        {
          key: "next-region",
          label: "next region",
          hotkey: "n",
          plain: true,
          onPress: () => update($, regionIndex, (i) => i + 1)
        }
      ))) : /* @__PURE__ */ h(Text, { key: "region", dimColor: true, wrap: "wrap" }, "No region yet.");
      body = [
        regionBlock,
        /* @__PURE__ */ h(Box, { key: "lab", flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ h(Text, { wrap: "truncate" }, /* @__PURE__ */ h(Text, { bold: true }, "FRONTIER LAB"), " ", /* @__PURE__ */ h(Text, { dimColor: true }, lab.researchers)), /* @__PURE__ */ h(Text, { wrap: "truncate" }, /* @__PURE__ */ h(Text, { color: lab.isShippable ? "green" : "cyan" }, lab.progressBar), " ", lab.progress), /* @__PURE__ */ h(Box, { flexDirection: "row", columnGap: 2, flexWrap: "wrap" }, lab.actions.map(
          (action) => actionButton(action, async () => {
            if (action.hotkey === "h") return act($, { type: "hire" });
            if (action.hotkey === "e") return act($, { type: "experiment" });
            if (lab.isShippable) await update($, view, () => "confirm-ship");
            else await act($, { type: "ship-generation" });
          })
        ), /* @__PURE__ */ h(Button, { key: "open-tree", label: "breakthroughs", hotkey: "v", plain: true, onPress: setView("tree") }), /* @__PURE__ */ h(Button, { key: "open-board", label: "board", hotkey: "c", plain: true, onPress: setView("chat") }), /* @__PURE__ */ h(Button, { key: "open-help", label: "how to play", hotkey: "i", plain: true, onPress: setView("help") })))
      ];
      const said = boardLines.findLast((line) => line.who === "board");
Licence text (MIT)
MIT License

Copyright (c) 2026 RichardAtCT

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 c4d2712d7e3b 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.plugins/cc-idle/hooks/register.js
ParsesEvery file parses as TypeScript or JavaScript.1 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 RichardAtCT/cc-idle
/plugin install cc-idle@cc-idle

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

Search them from Claude: the MCP connector

Similar designs