Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / cs

cs

cs's in-session mod: the rotate band above the prompt, forced rotation past CS_ROTATE_FORCE_CTX, and the wrap key

Code you can checkTerminal + desktopPaneBandToastBoxButtonMarkdownText
writes files, runs programs, draws

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /queue, /clear
  • Hooks prompt.submit, session.start, skill.prompt, turn.complete and 1 more
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors

Code to start from

A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.

Starter (register.tsx)

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

// Drawn like cs by cs (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/hex-cs/
// 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 band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const cutTask = '…'
    const gateElapsed = '…'
    const chords = '…'
    const chords2 = '…'
    const left = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column">
          <Box marginTop={1}>
            <Box paddingX={1}>
              <Text>
                {`finishing ${cutTask} · gate ${gateElapsed}`}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box marginTop={1}>
          <Box marginLeft={2}>
            <Text>
              
            </Text>
            <Box paddingX={1}>
              <Text bold>
                cs
              </Text>
            </Box>
            <Box paddingX={1}>
              <Box marginRight={1}>
                <Text bold>
                  {chords}
                </Text>
              </Box>
              <Button action="strip:jump1" plain label="/clear and continue from the handoff" />
              <Text dimColor>
                {"  ·  "}
              </Text>
              <Box marginRight={1}>
                <Text bold>
                  {chords2}
                </Text>
              </Box>
              <Button action="strip:jump2" plain label="wrap up this session" />
              <Text dimColor>
                {"  ·  "}
              </Text>
              <Text bold>
                {`/clear in ${left}s`}
              </Text>
            </Box>
            <Text>
              
            </Text>
          </Box>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Handoff" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Markdown } = $.ui.resolve(e)
    const text = '…'
    const left = '…'
    return (
      <Box flexDirection="column" paddingX={1}>
        <Text bold>
          Handoff
        </Text>
        <Box flexDirection="column" marginTop={1}>
          <Markdown text={`${text}`} />
          <Text dimColor>
            … the rest of the step is in the handoff
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box>
            <Text>
              ████████░░░░░░░░
            </Text>
            <Text>
              {"  "}
            </Text>
            <Text bold>
              {`/clear in ${left}s`}
            </Text>
          </Box>
          <Text dimColor>
            press 1 to clear now, or send a prompt to stay
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const cutTask = '…'
    const force = '…'
    const startPercent = '…'
    await $.ui.toast(`cs: queued: ${cutTask}`)
    await $.ui.toast(`cs: CS_ROTATE_FORCE_CTX=${force} is below this conversation's starting context (${startPercent}%); not forcing a rotation`)
    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.

mods/cs/hooks/register.tsx lines 333–404 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const drawn = await withGateBand($, e, await next(e))
    // The band draws in a new conversation before any of its turns end, so
    // the birth is settled here: a later /resume is not mistaken for it.
    noteConversation(await $.session.id())
    // A survey owns the band; a running turn cannot be rotated out of.
    turnRunning = e.props.isWorking
    bandIdle = !e.props.hasSurvey && !e.props.isWorking
    if (!bandIdle) return drawn
    const armed = await handoffArmed($)
    const { context } = await $.session.usage()
    const percent = context.percent
    if (!armed && (percent === undefined || percent < (await threshold($)))) return drawn
    if (!(await ownsRotation($))) return drawn
    const wrapped = !armed && (await wrapFinished($))
    const fill = surfaceColor(await $.env.get("CS_TERM_BG_RGB"))
    const chords = await boundChords($)
    const own = paletteColor(await sessionColor($))
    // The chip is the band's identity, as the session name is the bar's: on
    // the session colour, Claude coral once a handoff is armed so the /clear
    // reads apart, and on the surface in the terminal's own ink for a session
    // with no colour. The body keeps the surface either way, where the count's
    // ramp keeps its contrast.
    const chipFill = armed ? `rgb(${BRAND})` : own ?? fill
    const chipInk = chipFill === fill
      ? undefined
      : `rgb(${(await $.env.get("CS_TERM_THEME")) === 'dark' ? WHITE_DARK : WHITE_LIGHT})`
    // Caps close a fill on the terminal's own background, so they need both a
    // fill and this machine's consent to the glyph.
    const caps = fill !== undefined && chipFill !== undefined && (await capsWanted($))
    const { Box, Text, Button } = await $.ui.resolve(e)
    // The Buttons carry no hotkey: a bare digit pressed them from an empty
    // composer, where a digit typed as the answer to a numbered question
    // belongs. A chord bound to each Button's action presses it instead, and
    // the engine draws a Button with no hotkey as its label alone, so the key
    // is spelled beside it, and only when keybindings.json binds one.
    const key = (action: string) => chords[action] !== undefined &&
      <Box marginRight={1}><Text bold color={own}>{chords[action]}</Text></Box>
    // One capsule in the status bar's idiom: the cs chip, then the keys on the
    // bar's own fill, a blank line above them so the band reads apart from the
    // transcript. The context percentage is the bar's to carry; the band does
    // not repeat it. The keyed box lights coral under the pointer; the engine
    // restyles it without running the hook. It starts two columns in, where
    // Claude Code draws the bar and the mode line under the prompt.
    return (
      <Box flexDirection="column">
        {drawn}
        <Box marginTop={1}>
          <Box key="cs-rotate-band" marginLeft={2}>
            {caps && <Text color={chipFill}>{CAP_LEFT}</Text>}
            <Box paddingX={1} backgroundColor={chipFill}><Text bold color={chipInk}>cs</Text></Box>
            <Box key="cs-rotate-band-body" paddingX={1} backgroundColor={fill}>
            {key(ROTATE_ACTION)}
            {armed
              ? <Button key="cs-rotate" action={ROTATE_ACTION} plain label="/clear and continue from the handoff"
                        onPress={() => clearAndContinue($)} />
              : <Button key="cs-rotate" action={ROTATE_ACTION} plain label="rotate this conversation"
                        onPress={() => rotate($)} />}
            {/* a Button is a block: nested in a Text the engine refuses the whole tree (measured), so the separator stands beside it */}
            {!armed && !wrapped && <Text dimColor>{'  \u00b7  '}</Text>}
            {!armed && !wrapped && key(WRAP_ACTION)}
            {!armed && !wrapped && <Button key="cs-wrap" action={WRAP_ACTION} plain label="wrap up this session" onPress={() => askToWrap($)} />}
            {/* the forced rotation's grace: the seconds left before the mod runs the /clear itself */}
            {armed && left !== undefined && <Text dimColor>{'  \u00b7  '}</Text>}
            {armed && left !== undefined && <Text bold color={await rampColor($, left)}>{`/clear in ${left}s`}</Text>}
            </Box>
            {caps && <Text color={fill}>{CAP_RIGHT}</Text>}
          </Box>
        </Box>
      </Box>
    )
  })
mods/cs/hooks/register.tsx lines 996–1011 · Band
async function withGateBand($: EngineInterface, e: Parameters<EngineInterface['ui']['resolve']>[0], drawn: unknown) {
  if (finishGate === undefined) return drawn
  const { Box, Text } = await $.ui.resolve(e)
  const fill = surfaceColor(await $.env.get("CS_TERM_BG_RGB"))
  const secs = Math.max(0, Math.floor((await $.clock.now()) / 1000) - finishGate.since)
  return (
    <Box flexDirection="column">
      {drawn}
      <Box marginTop={1}>
        <Box paddingX={1} backgroundColor={fill}>
          <Text>{`finishing ${cutTask(finishGate.task)} · gate ${gateElapsed(secs)}`}</Text>
        </Box>
      </Box>
    </Box>
  )
}
mods/cs/hooks/register.tsx lines 408–434 · Pane
  on('ui.render', { component: 'Pane' }, async ($, e, next) => {
    if (e.requestId !== PREVIEW_PANE || preview === undefined) return next(e)
    const { Box, Text, Markdown } = await $.ui.resolve(e)
    // With one pane open the engine draws no title, so the pane carries its
    // own, in the session's colour; the step is drawn as a reply's markdown is.
    const own = paletteColor(await sessionColor($))
    const color = left === undefined ? undefined : await rampColor($, left)
    return (
      <Box flexDirection="column" paddingX={1}>
        <Text key="header" bold color={own}>Handoff</Text>
        <Box flexDirection="column" marginTop={1}>
          <Markdown key="step" text={preview.text} />
          {preview.cut && <Text key="cut" dimColor>… the rest of the step is in the handoff</Text>}
        </Box>
        {left !== undefined && (
          <Box flexDirection="column" marginTop={1}>
            <Box>
              <Text key="bar" color={color}>{countdownBar(left)}</Text>
              <Text>{'  '}</Text>
              <Text key="count" bold color={color}>{`/clear in ${left}s`}</Text>
            </Box>
            <Text dimColor>press 1 to clear now, or send a prompt to stay</Text>
          </Box>
        )}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2025 cs-tool contributors

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.

How to build this: Pane (panel), Rewrite the prompt

What its code calls

runs programswrites filesenv varsdrives Claudecalls tools

What its code shows

Read from the source at commit 3620edbfe335 on 2026-10-11. 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.mods/cs/hooks/register.tsx
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.its repository's .claude-plugin/marketplace.json does not list it: no marketplace line to give; the page shows how to try the commit read
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).mods/cs/hooks/register.tsx:974 kill (not on Windows)
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.mods/cs/hooks/register.tsx:265 a program named at run time; mods/cs/hooks/register.tsx:844 a program named at run time
Reads and sendsWhether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files, but reaches nothing outside
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
Settings hooksHooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone
Servers it shipsMCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/
Skills, commands, agentsWhat its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows
Tools and MCPWhether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).command.run: /rotate; command.run: /wrap; command.run: /clear
Asks of the modelCompletions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command queue, prompt.submit (as the person)
Events it hooksBy what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (queue, clear), prompt.submit · shapes: skill.prompt · also: session.start, turn.complete, turn.start, ui.render (AbovePrompt, Pane) · timers: clock.after, clock.every
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: CS_BIN, CS_TERM_BG_RGB, CS_TERM_THEME, CS_ROTATE_FORCE_CTX, CS_ROTATE_BUTTON_CTX (+5); files: a path computed at run time, …/…, …/…/…, …/cs/statusline-caps, …/keybindings.json (+4)
Writes, by nameThe files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.files: …/…, a path computed at run time

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 its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository's .claude-plugin/marketplace.json does not list it, so there is no marketplace line to give.

Try the commit ModsCode read

No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:

git clone https://github.com/hex/claude-sessions
git -C claude-sessions checkout 3620edbfe33539364dda645fbb9242b95c4170d9
claude plugin validate claude-sessions/mods/cs
claude --plugin-dir claude-sessions/mods/cs

The validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.

Ask Claude about it

With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:

Read the ModsCode mod "hex-cs" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More from this repository

Badge for your README

If this is your mod, paste this into your README. It links to this page.

README.md
[![ModsCode](https://modscode.com/badge/hex-cs.svg)](https://modscode.com/claude-mods/mods/hex-cs/)