Skip to content

When something breaks

Check before you push

A malicious package is cheapest to stop before it leaves your laptop. Kiyesi’s git hook runs the rules of its pull-request check on each push, on your own computer. Free, with no account.

In a repository, with kiyesi 0.50.1 or later (no sign-in needed):

Terminal window
kiyesi hook install

Install also downloads the list of malicious packages (about 2.5 MB). From then on, each git push from that repository is checked first. For another repository, run it there, or name it:

Terminal window
kiyesi hook install --path ~/code/shop

kiyesi hook status says whether pushes are checked and how old the list is. kiyesi hook uninstall removes the hook.

The five pull-request rules, on what the push adds:

Rule On a push
Malicious package, in all eight languages Stops it
Lockfile tampering Stops it
Hidden code Stops it
Install script that downloads and runs Shown; the push goes on
Risky workflow Shown; the push goes on

A stopped push looks like this:

✗ Kiyesi stopped this push: 1 problem to fix first.
STOP Malicious package added: left-pad-x ^1.0.1
package.json:4
│ "left-pad-x": "^1.0.1"
Why: This change adds left-pad-x ^1.0.1 to package.json, and the malicious-package list reports it (MAL-2025-1).
Fix: Remove left-pad-x from package.json, run npm install, and check any machine that installed it: see MAL-2025-1.
Fix the problems above, commit, and push again.
To push anyway, skipping this check: git push --no-verify

git push --no-verify skips the check for one push. The pull-request check still sees the change on GitHub.

A push is compared with what the remote already has; a new branch, with the remote’s default branch. A deleted branch is not checked.

Kiyesi reads the push with git, on your computer: each changed dependency file and workflow in full, and the changed lines of everything else, up to 300 files, 5 MB and 20 seconds. Nothing from your repository is sent anywhere or run.

Apart from the counts, the only contact with Kiyesi is the list of malicious packages, kept in your cache folder (or KIYESI_CACHE) and refreshed when over 6 hours old. A push waits at most 3 seconds for an answer, then up to 30 seconds for a new list. To refresh it now:

Terminal window
kiyesi hook update

Offline, the copy you have is used, and the check says how old it is. Without any copy, the other rules still run and the push goes through. Kiyesi’s own trouble never stops a push: only a problem it found does.

To know how many people the hook helps, it sends anonymous counts at most once a day, waiting at most 2 seconds:

  • how many pushes it checked and stopped, and findings of each rule;
  • the name and version of each known malicious package it stopped, such as flatmap-stream 0.1.1;
  • the kiyesi version and the kind of computer, such as macOS on arm64;
  • a random number made on your computer, to count installs.

Never your code, repository, file or branch names, your name or your email. Kiyesi does not keep the address the counts came from, and keeps them for 400 days. Install says so once. To turn it off:

Terminal window
kiyesi hook usage off

or set KIYESI_NO_USAGE=1 or DO_NOT_TRACK=1. Off forgets the random number and the counts. kiyesi hook status says whether it is on.

A pre-push hook already in the repository is kept, runs after Kiyesi’s check, and is put back as it was by kiyesi hook uninstall.

When the repository keeps its hooks in its own folder (core.hooksPath, as Husky sets it), Kiyesi changes nothing and prints the line to add to that hook, such as .husky/pre-push:

Terminal window
if command -v kiyesi >/dev/null 2>&1; then kiyesi hook run "$@" || [ $? -ne 1 ] || exit 1; fi

Teammates without kiyesi push as before. When core.hooksPath is your own folder outside the repository, the hook goes there and checks every repository that uses it.

The hook works with Git for Windows, which runs hooks with its own sh.