modscode JA

modscode / Gallery / jev-precommit

jev-precommit

A commit gate that reads the staged diff in a blink: Jev flags debug output, commented-out code, TODOs, machine paths, secrets and off-message changes before Claude's git commit runs.

Code you can checkTerminal + desktopPaneToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /precommit
  • Watches tool calls and can refuse them
  • Hooks session.start
  • Calls the network

Good points

  • Written in TypeScript
  • 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 jev-precommit by mako-code (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/mako-code-jev-precommit/
// 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: "Precommit" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const mode = '…'
    const threshold = '…'
    const ledgerLine = '…'
    const hhmmss = '…'
    const OUTCOME = '…'
    const probBar = '…'
    const label = '…'
    const excerpt = '…'
    const probBar2 = '…'
    const label2 = '…'
    const excerpt2 = '…'
    const probBar3 = '…'
    const label3 = '…'
    const excerpt3 = '…'
    const reply = '…'
    const scope = '…'
    const hunks = '…'
    const files = '…'
    const omitted = '…'
    const questions = '…'
    const hhmmss2 = '…'
    const OUTCOME2 = '…'
    const probBar4 = '…'
    const label4 = '…'
    const excerpt4 = '…'
    const probBar5 = '…'
    const label5 = '…'
    const excerpt5 = '…'
    const probBar6 = '…'
    const label6 = '…'
    const excerpt6 = '…'
    const scope2 = '…'
    const hunks2 = '…'
    const files2 = '…'
    const questions2 = '…'
    const hhmmss3 = '…'
    const OUTCOME3 = '…'
    const probBar7 = '…'
    const label7 = '…'
    const excerpt7 = '…'
    const probBar8 = '…'
    const label8 = '…'
    const excerpt8 = '…'
    const probBar9 = '…'
    const label9 = '…'
    const excerpt9 = '…'
    const scope3 = '…'
    const hunks3 = '…'
    const files3 = '…'
    const questions3 = '…'
    return (
      <Box flexDirection="column">
        <Text bold>
          Jev precommit
          {" "}
          <Text dimColor>
            {"· mode "}
            {mode}
            {" · flags at p ≥ "}
            {threshold}
          </Text>
        </Text>
        <Text color="yellow">
          TYPESAFE_API_KEY is not set, so jev-precommit is idle. Get a key at console.typesafe.ai, set TYPESAFE_API_KEY in the en…
        </Text>
        <Text dimColor>
          {ledgerLine}
        </Text>
        <Text>
          {" "}
        </Text>
        <Text dimColor>
          No commit reviewed yet. Each `git commit` Claude runs is read here first.
        </Text>
        <Box flexDirection="column" marginBottom={1}>
          <Text wrap="wrap">
            {hhmmss}
            {" "}
            <Text bold>
              (no message)
            </Text>
            {" "}
            <Text>
              {OUTCOME}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar}
            {" "}
            {label}
            <Text dimColor>
              {" "}
              {excerpt}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar2}
            {" "}
            {label2}
            <Text dimColor>
              {" "}
              {excerpt2}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar3}
            {" "}
            {label3}
            <Text dimColor>
              {" "}
              {excerpt3}
            </Text>
          </Text>
          <Text dimColor wrap="wrap">
            {`  you said: "${reply}"`}
          </Text>
          <Text dimColor wrap="wrap">
            {"  "}
            {scope}
            {" · "}
            {hunks}
            {" hunk"}
            {" in "}
            {files}
            {" file"}
            {` (+${omitted} not read)`}
            {" · "}
            {questions}
            {" questions"}
          </Text>
        </Box>
        <Box flexDirection="column" marginBottom={1}>
          <Text wrap="wrap">
            {hhmmss2}
            {" "}
            <Text bold>
              (no message)
            </Text>
            {" "}
            <Text>
              {OUTCOME2}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar4}
            {" "}
            {label4}
            <Text dimColor>
              {" "}
              {excerpt4}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar5}
            {" "}
            {label5}
            <Text dimColor>
              {" "}
              {excerpt5}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar6}
            {" "}
            {label6}
            <Text dimColor>
              {" "}
              {excerpt6}
            </Text>
          </Text>
          <Text dimColor wrap="wrap">
            {`  you said: "${reply}"`}
          </Text>
          <Text dimColor wrap="wrap">
            {"  "}
            {scope2}
            {" · "}
            {hunks2}
            {" hunk"}
            {" in "}
            {files2}
            {" file"}
            {` (+${omitted} not read)`}
            {" · "}
            {questions2}
            {" questions"}
          </Text>
        </Box>
        <Box flexDirection="column" marginBottom={1}>
          <Text wrap="wrap">
            {hhmmss3}
            {" "}
            <Text bold>
              (no message)
            </Text>
            {" "}
            <Text>
              {OUTCOME3}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar7}
            {" "}
            {label7}
            <Text dimColor>
              {" "}
              {excerpt7}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar8}
            {" "}
            {label8}
            <Text dimColor>
              {" "}
              {excerpt8}
            </Text>
          </Text>
          <Text wrap="wrap">
            {"  "}
            {probBar9}
            {" "}
            {label9}
            <Text dimColor>
              {" "}
              {excerpt9}
            </Text>
          </Text>
          <Text dimColor wrap="wrap">
            {`  you said: "${reply}"`}
          </Text>
          <Text dimColor wrap="wrap">
            {"  "}
            {scope3}
            {" · "}
            {hunks3}
            {" hunk"}
            {" in "}
            {files3}
            {" file"}
            {` (+${omitted} not read)`}
            {" · "}
            {questions3}
            {" questions"}
          </Text>
        </Box>
        <Box gap={1}>
          <Button hotkey="m" label={`Mode: ${mode}`} />
          <Button hotkey="c" label="Clear" />
          <Button hotkey="x" role="dismiss" label="Close" />
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const error = '…'
    await $.ui.toast(`Off: ${error}`)
    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/jev/jev-precommit/hooks/register.tsx lines 369–424 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const reports = await read($, reportsAtom)
    const ledger = await read($, ledgerAtom)
    const override = await read($, modeAtom)
    const mode = override ?? configuredMode()
    const keyed = await hasKey($)
    const width = Math.max(30, e.props.bodyColumns - 2)

    return (
      <Box flexDirection="column">
        <Text bold>
          Jev precommit{' '}
          <Text dimColor>
            · mode {mode}
            {override === null ? '' : ' (this session)'} · flags at p ≥ {threshold().toFixed(2)}
          </Text>
        </Text>
        {!keyed && <Text color="yellow">{NO_KEY}</Text>}
        <Text dimColor>{ledgerLine(ledger)}</Text>
        <Text> </Text>
        {reports.length === 0 && <Text dimColor>No commit reviewed yet. Each `git commit` Claude runs is read here first.</Text>}
        {reports
          .slice()
          .reverse()
          .map((r, i) => (
            <Box key={`report-${i}`} flexDirection="column" marginBottom={1}>
              <Text wrap="wrap">
                {hhmmss(r.at)} <Text bold>{r.subject === null ? '(no message)' : `"${r.subject}"`}</Text>{' '}
                <Text color={OUTCOME_COLOR[r.outcome]}>{OUTCOME[r.outcome]}</Text>
              </Text>
              {r.findings.map((f, j) => (
                <Text key={`finding-${i}-${j}`} wrap="wrap">
                  {'  '}
                  {probBar(f.p, 6)} {f.label}
                  {f.excerpt === null ? '' : <Text dimColor> {f.excerpt}</Text>}
                </Text>
              ))}
              {r.reply !== null && <Text dimColor wrap="wrap">{`  you said: "${clip(r.reply.replace(/\s+/g, ' '), width * 2)}"`}</Text>}
              <Text dimColor wrap="wrap">
                {'  '}
                {r.scope} · {r.hunks} hunk{r.hunks === 1 ? '' : 's'} in {r.files} file{r.files === 1 ? '' : 's'}
                {r.omitted > 0 ? ` (+${r.omitted} not read)` : ''} · {r.questions} questions
                {r.ms === null ? '' : ` · ${r.ms} ms`}
                {r.error === null ? '' : ` · ${r.error}`}
              </Text>
            </Box>
          ))}
        <Box gap={1}>
          <Button key="mode" hotkey="m" label={`Mode: ${mode}`} onPress={() => void cycleMode($)} />
          <Button key="clear" hotkey="c" label="Clear" onPress={() => void update($, reportsAtom, () => [])} />
          <Button key="close" hotkey="x" role="dismiss" label="Close" onPress={() => void $.ui.close({ id: PANE })} />
        </Box>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 mako-code

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

networkruns programsreads filesenv varstool 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 ec6ea2383749 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.mods/jev/jev-precommit/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.5 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.mods/jev/jev-precommit/hooks/register.tsx:94 fetch(JEV_URL)
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.git (reaches the network)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and 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 mako-code/gobworks
/plugin install jev-precommit@gobworks

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

Search them from Claude: the MCP connector

Similar designs