tickcheck · collection manual
Startup hooks, keyed out
without starting Python.
tickcheck is one Go binary. It finds every Python environment on a machine, lists each file that runs automatically when that interpreter starts (.pth lines beginning with import, sitecustomize.py, usercustomize.py), says which package put it there and whether it belongs. It reads files only. It never runs python, pip, uv or anything that would.
01Install
Linux and macOS, into ~/.local/bin (or $TICKCHECK_BIN). The script is under 50 lines: it picks the release archive for your OS and CPU, checks it against checksums.txt and copies the binary. Read it first.
curl -fsSL https://blackman99.github.io/tickcheck/install.sh | sh
With Go 1.22 or newer:
go install github.com/Blackman99/tickcheck/cmd/tickcheck@latest
Windows: download tickcheck_windows_amd64.zip (or _arm64) from the latest release and put tickcheck.exe on your PATH. Archives exist for linux, darwin and windows on amd64 and arm64.
02Usage
Try it on a generated home first. --demo builds a fake user with seven environments and a defanged LiteLLM 1.107.0 drop (the real 12-byte cook.pth; the modules it would load are inert stand-ins). Nothing on your machine is read.
tickcheck --demo
tickcheck · 7 Python environments · Python was never started · 5ms
DEMO generated home /tmp/tickcheck-demo/home/dana — nothing on this machine was read
BAD 2 SUSPECT 1 REVIEW 2 OK 7 startup hooks in 7 environments
BAD ~/proj/agent-proxy/.venv venv · python3.12
installed: litellm 1.107.0 (litellm-2026-10-21)
▸ cook.pth runs import cook
loads cook.py · 2.5 KB · sha256 5450c401…
owner litellm 1.107.0 · uv · 2026-10-21 19:52 CST · RECORD hash ✓
✗ cook.pth is byte-identical to cook.pth (import cook) in litellm-2026-10-21
✗ litellm 1.107.0 is listed in litellm-2026-10-21 (it installed cook.pth, cook.py)
✗ cook.py: encoded blob → exec, long encoded literal, detaches (fork/setsid)
installed by Claude Code · 2026-10-21 19:51 CST · ~/proj/agent-proxy · uv add litellm[proxy]
~/.claude/projects/-home-dana-proj-agent-proxy/5b1e2c90-demo.jsonl:2
compiled copies cook.cpython-312.pyc
▸ sitecustomize.py imported on every start · 338 B
owner litellm 1.107.0 · uv · 2026-10-21 19:52 CST · RECORD hash ✓
✗ litellm 1.107.0 is listed in litellm-2026-10-21 (it installed sitecustomize.py)
✗ sitecustomize.py: network, detaches (fork/setsid)
installed by Claude Code · 2026-10-21 19:51 CST · ~/proj/agent-proxy · uv add litellm[proxy]
~/.claude/projects/-home-dana-proj-agent-proxy/5b1e2c90-demo.jsonl:2
compiled copies sitecustomize.cpython-312.pyc
+ 2 known: _virtualenv.pth, distutils-precedence.pth
SUSPECT ~/work/scraper/.claude/worktrees/agent-7c1e/.venv venv · agent worktree · python3.12
▸ fastjsonx_rt.pth runs import fastjsonx_rt; fastjsonx_rt.boot()
loads fastjsonx_rt.py · 308 B · sha256 736f9cd0…
owner fastjsonx 0.4.1 · pip · 2026-10-20 17:52 CST · RECORD hash ✓
✗ fastjsonx_rt.py: network, reads credentials
installed by Codex · 2026-10-20 17:33 CST · ~/work/scraper/.claude/worktrees/agent-7c1e · pip install fastjsonx
~/.codex/sessions/2026/10/20/rollout-2026-10-20T09-31-12-demo.jsonl:1
+ 1 known: _virtualenv.pth
… 5 more environments: REVIEW, REVIEW, OK, OK, OK
Then the real machine. With no flags tickcheck walks your home directory and the usual system install locations:
tickcheck # every env it can find
tickcheck --all # also list OK hooks one by one
tickcheck --root . # only this folder
Only environments with something above OK are expanded. OK hooks are folded into a + N known line; --all unfolds them.
Commands
| Command | What it does |
|---|---|
tickcheck | Census (the default command). Same as tickcheck scan. |
tickcheck pull | Move BAD hooks aside into a quarantine folder. §05 |
tickcheck restore <dir> | Put a quarantined set back, byte for byte. |
tickcheck image <ref|file|dir> | Census of a container image without running it. §10 |
tickcheck ioc | Print the built-in IOC feed as JSON. §08 |
tickcheck version | Print the version. |
03Where it looks
Every site-packages or dist-packages folder under the roots it walks is one site dir. Site dirs are grouped into environments by their nearest pyvenv.cfg or install prefix, and each gets a kind:
| Kind | Found at |
|---|---|
| venv | any folder with a pyvenv.cfg under your home, including .venv folders inside agent worktrees (.claude/worktrees, .codex), marked agent worktree |
| pipx, uv tool, uvx env | ~/.local/pipx/venvs, ~/.local/share/uv/tools, environments in the uv cache |
| pyenv, uv python, conda | ~/.pyenv/versions, uv-managed interpreters, conda / mamba / miniforge envs |
| pre-commit | hook environments in ~/.cache/pre-commit |
| user site | ~/.local/lib/python3.X/site-packages, the AppData equivalent on Windows |
| system, homebrew | /usr/lib/python3*, /usr/local/lib/python3*, Homebrew, the python.org framework, /opt/conda, /opt/venv, /app, C:\Python3X. Skip with --no-system. |
The stdlib folder itself is checked too, because Debian and Ubuntu ship a sitecustomize.py there (the apport hook, which keys out OK).
Besides site dirs, tickcheck checks three more places for known incidents:
- Package caches. uv, pip and poetry caches holding a distribution named in the IOC feed (one
uv syncaway from coming back). Wheels are hashed only when their file name matches a listed distribution, so a large cache stays fast. - Host markers. Files in the temp dir that an incident is known to write (for LiteLLM 1.107.0:
.pc_once_*,remote_code_loader.lock,.pc_sq_*,.pc_e_*). - Processes (Linux only). Any process holding an incident's lock file open or carrying its environment marker, read from
/proc. Nothing is killed. On macOS and Windows the report prints thelsofcommand to run instead.
It skips node_modules, VCS folders, browser profiles, Rust/Gradle/Maven caches, model caches (huggingface, torch), its own demo home and quarantine, and anything deeper than --max-depth (12) below a root.
04Verdicts
A .pth line runs at startup only if it starts with import followed by a space or tab; every other line is a path added to sys.path. Files with no such line are not listed at all. Each executable hook is keyed out from the file alone:
| Verdict | When |
|---|---|
| BAD | Its sha256 (or the sha256 of a module it loads) is in the IOC feed, or its owning package's name and version are listed there. Host markers and live processes also count as BAD. |
| SUSPECT | Payload signals in the hook or the module it imports: an encoded blob passed to exec/eval, a very long encoded literal, spawning processes, network calls, fork/setsid, reading credential paths. Or the file no longer matches the sha256 its package's RECORD lists. Or the hook's name has nothing to do with the package that installed it (litellm installing cook.pth). A poisoned cache entry is at least SUSPECT. |
| REVIEW | Runs at startup and tickcheck can't vouch for it: dropped into the site dir without being in any package's RECORD, or plain code from a package with no known pattern. |
| OK | A known pattern from its own package, with a matching RECORD hash: the setuptools distutils-precedence.pth shim, editable installs (__editable__.*.pth), -nspkg.pth namespace packages, the virtualenv / uv venv patch, pywin32, coverage, the Debian apport and Homebrew sitecustomize.py. |
The signals are regular-expression matches over the text. Nothing is decoded, imported or run. A known name hiding a payload (a _virtualenv.py that calls subprocess) still keys out as SUSPECT, because the signal check runs before the known-pattern check.
The worst verdict in an environment is the environment's verdict; the worst overall sets the exit code.
05Pull & restore
Don't uninstall an infected package with pip or uv: starting that env's interpreter runs the hook first. Pull the hook instead:
tickcheck pull --dry-run # list what would move
tickcheck pull # asks once, then moves
tickcheck pull --suspect # BAD and SUSPECT
For each BAD hook, pull moves the hook file, every module its import lines load from that site dir, and their compiled __pycache__ copies into ~/.tickcheck/quarantine/<time>/. A manifest.json there lists each original path, its sha256 and mode. The census then runs again and prints what is left. Python is not started before, during or after.
$ tickcheck pull --demo --yes
tickcheck pull · 3 files + 2 compiled copies from 1 environment · Python was never started
~/proj/agent-proxy/.venv
cook.pth cook.py cook.cpython-312.pyc sitecustomize.py sitecustomize.cpython-312.pyc
moved 3 files + 2 compiled copies → ~/.tickcheck/quarantine/20261022-104512/
manifest.json lists every file and its sha256; `tickcheck restore ~/.tickcheck/quarantine/20261022-104512` puts them back
re-check: 0 BAD hooks left in 7 environments.
note: litellm 1.107.0 (litellm-2026-10-21) is still installed in ~/proj/agent-proxy/.venv: rebuild that env, don't run its pip.
Pulling stops the hook from running next time. It doesn't remove the package (rebuild the env from a pinned lockfile) and it doesn't undo anything the hook already did. If it ran with network access, rotate what that machine could read: on a BAD result the census lists credential files of the kinds such stealers target that exist under your home. tickcheck checks existence only and never opens them.
tickcheck restore <dir> puts every file back to its original path and mode. It refuses to overwrite a file that has reappeared, and running it twice does nothing the second time.
When stdin is not a terminal (CI, a script, an agent), pull moves nothing without --yes.
06Who installed it
For every BAD or SUSPECT hook with an owning package, tickcheck reads the package's INSTALLER and RECORD time, then searches local agent transcripts and shell history, as text, for the command that installed it:
- Claude Code:
~/.claude/projects/**/*.jsonl - Codex:
~/.codex/sessions,~/.codex/archived_sessions - OpenCode:
~/.local/share/opencode/storage - Gemini CLI:
~/.gemini/tmp - Shell:
.bash_history,.zsh_history, fish history
A line counts when it holds pip install, python -m pip install, uv add, uv pip install, uv tool install, uvx, pipx install, poetry add, conda install or mamba install followed by that package's name. The newest three are shown with their file and line number, plus the working directory when the transcript records one. Transcripts stay on the machine; nothing is uploaded. Turn this off with --no-attrib.
07Configuration
There is no config file. Everything is a flag; flags may come before or after the command.
| Flag | Default | Meaning |
|---|---|---|
--root DIR | your home + system | Scan only DIR. Repeatable. A project, a CI workspace, an unpacked container rootfs. Suggested pull commands repeat it. |
--home DIR | $HOME | Home dir to walk and to read transcripts from. |
--no-system | off | Skip system-wide installs. |
--ioc FILE | built-in feed | Extra IOC feed, merged with the built-in one. Repeatable. |
--all | off | List OK hooks and clean environments too. |
--json | off | JSON report on stdout. §09 |
--no-color | auto | Plain text. NO_COLOR is honoured; colour is off when stdout is not a terminal. |
--no-attrib | off | Don't search transcripts or shell history. |
--max-depth N | 12 | Directory depth to walk below each root. |
--demo | off | Run on a generated home in the temp dir. |
--suspect | off | pull only: also pull SUSPECT hooks. |
--dry-run | off | pull only: list, move nothing. |
--yes | off | pull only: don't ask. |
--quarantine-dir DIR | ~/.tickcheck/quarantine | pull only: where pulled files go. |
08IOC feed
The feed is embedded in the binary; tickcheck ioc prints it. When the next incident lands before a tickcheck release does, write the same shape to a file and pass it with --ioc:
{
"schema": 1,
"incidents": [{
"id": "litellm-2026-10-21",
"title": "LiteLLM 1.107.0 on PyPI and Docker (cook.pth + sitecustomize.py stealer/loader)",
"sources": ["https://docs.litellm.ai/blog/security-incident-oct-21-2026",
"https://github.com/BerriAI/litellm/issues/47826"],
"dists": [{"name": "litellm", "versions": ["1.107.0"]}],
"fix": "pin litellm==1.106.2 and rebuild the env from scratch",
"file_sha256": {
"7f191632e7320705d154b85204f1ae546b543acbd7e8861229b76f5042b92bdb": "cook.pth (import cook)",
… cook.py, sitecustomize.py (Linux/macOS and Windows variants), the decoded payloads and 7 wheels
},
"host_globs": [".pc_once_*", "remote_code_loader.lock", ".pc_sq_*", ".pc_e_*"],
"lock_files": ["remote_code_loader.lock"],
"env_markers": ["PRIVCOLLECT_ACTIVE=1"]
}]
}
| Field | Used for |
|---|---|
dists | Package name (normalised like pip does) and exact versions. A hook owned by one is BAD; a cache entry holding one is reported. |
file_sha256 | sha256 of a hook, a module it loads, or a wheel in a cache → label. |
host_globs | File name globs looked for in the temp dir. |
lock_files, env_markers | Linux: processes holding the file open, or with the KEY=value in their environment. |
fix, sources | Printed in the next steps. |
The built-in hashes come from the incident write-up and issue linked in sources; the cook.pth hash was also checked locally (it is sha256("import cook\n"); the Windows wheel's CRLF copy is sha256("import cook\r\n")).
09JSON & exit codes
tickcheck --json prints one object. Main fields:
{
"version": "0.1.0", "scanned_at": "…", "took": "5ms", "home": "…", "roots": ["…"],
"counts": {"envs": 7, "hooks": 12, "bad": 2, "suspect": 1, "review": 2, "ok": 7},
"envs": [{
"root": "…/proj/agent-proxy/.venv", "kind": "venv", "python": "3.12", "verdict": "BAD",
"site_dirs": ["…/site-packages"], "bad_dists": ["litellm 1.107.0 (litellm-2026-10-21)"],
"hooks": [{
"kind": "pth", // pth | sitecustomize | usercustomize
"file": {"path": "…/cook.pth", "size": 12, "sha256": "7f19…",
"owner": {"name": "litellm", "version": "1.107.0", "installer": "uv",
"installed_at": "…", "record_hash_ok": true},
"ioc": "litellm-2026-10-21"},
"exec_lines": ["import cook"],
"loads": [{"path": "…/cook.py", "sha256": "…"}],
"verdict": "BAD", "reasons": ["cook.pth is byte-identical to …"],
"installed_by": [{"harness": "Claude Code", "file": "…", "line": 2,
"cwd": "…", "command": "uv add litellm[proxy]"}]
}]
}],
"caches": [{"path": "…", "tool": "uv", "ioc": "…", "detail": "…"}],
"host": [{"what": "loader lock file", "path": "/tmp/remote_code_loader.lock", "ioc": "…"}],
"exposed_files": ["~/.aws/credentials", "…"]
}
| Exit | Meaning |
|---|---|
0 | Nothing above REVIEW. |
3 | At least one SUSPECT (or a poisoned cache). |
4 | At least one BAD hook, host marker or process. |
64 | Usage error. |
1 | Anything else went wrong. |
10CI & containers
A CI job
- run: curl -fsSL https://blackman99.github.io/tickcheck/install.sh | sh
- run: ~/.local/bin/tickcheck --root "$GITHUB_WORKSPACE" --no-attrib
# fails the step on 3 (SUSPECT) or 4 (BAD); use `|| [ $? -lt 4 ]` to fail on BAD only
tickcheck's own CI runs it on the GitHub runner images (Ubuntu, macOS, Windows) every push and fails only on BAD.
A container image
Don't docker run an image you suspect: its entrypoint starts Python, and so does docker run … pip list. Scan the image instead:
tickcheck image ghcr.io/berriai/litellm:main-stable # public registry, pulled anonymously
tickcheck image ghcr.io/berriai/litellm:main-stable --platform linux/arm64
docker save myapp:latest -o myapp.tar && tickcheck image myapp.tar # private or local images
tickcheck image ./oci-layout/ --tag myapp:latest # an OCI layout folder (skopeo, buildah, crane)
tickcheck reads the image itself. It needs no Docker daemon and never runs a container. It accepts docker save archives (the classic layout and the OCI layout Docker 25+ writes, gzipped or not), OCI image layouts as a tarball or folder, and public registry references (Docker Hub, GHCR and any registry with anonymous pull through the standard token flow). Layers are applied bottom to top. A .wh.<name> whiteout deletes that file from lower layers, and a .wh..wh..opq marker hides a directory's lower contents, so a hook removed in a later layer is not reported. Each layer's sha256 is checked against its digest.
Only what the census reads is written to a temporary folder: files at the top of each site-packages/dist-packages, package metadata, top-level package __init__ files, stdlib-level sitecustomize, pyvenv.cfg, package caches and /tmp markers. Everything else is streamed past. The folder is deleted afterwards. Paths in the report are paths inside the image.
Multi-arch images default to linux/amd64 (the report lists the others); --platform os/arch picks one. An archive holding several images needs --tag. Limits: no credentials for private registries (use docker save), no zstd-compressed layers (Go's standard library has no zstd decoder), no Windows container layers, and symlinked files inside Python dirs are not followed (the report counts them). No pull or restore: an image can't be changed in place, so rebuild it.
An exported filesystem
An unpacked rootfs (docker export, a chroot, a mounted disk) is scanned as a folder:
tickcheck --root rootfs
With --root or image, the report doesn't list your own home's credential files, because they are not on the scanned machine.
11FAQ
- Why can't I just run
pip show litellm? pipis a Python program. Starting it in the affected env makessiteprocesscook.pth, which runs the payload, before pip prints anything. The same goes forpython -c,uv run, IDE interpreter discovery, and most "scan my env" tools written in Python.- Isn't this what pip-audit / OSV scanners do?
- Those match installed versions against advisories, and most of them run inside Python. tickcheck is narrower: it lists the code that runs at interpreter start, whether or not any advisory exists yet, and it doesn't start the interpreter. Use both.
- Does a REVIEW mean I'm compromised?
- No. It means a file runs at startup and tickcheck can't tie it to a known pattern from its own package. Profilers, debuggers and corporate proxies do this legitimately. Read it with
less, not withpython. - Does it send anything anywhere?
- No. There is no network code in the binary; the IOC feed is embedded. The demo and the landing page's drop zone run locally too.
- Is it fast on a big home directory?
- It walks directories and reads only site dirs,
.pthfiles, startup modules,RECORD/METADATA/INSTALLERfiles and matching cache entries. It prunesnode_modules, VCS, browser and model caches.--max-depthand--rootnarrow it further. - Will it catch the next one?
- If the next drop uses a
.pthorsitecustomize, it shows up as a hook whether or not it is in the feed. Whether it keys out SUSPECT or REVIEW depends on what the payload looks like as text. Exact detection needs its hashes in a feed, which you can add with--iocthe same day. - What doesn't it cover?
- Code that runs only when a package is imported (that's every package), entry-point console scripts,
PYTHONSTARTUP, and.pthfiles outside site dirs. Those are listed on the roadmap. - Something is wrong or missing.
- Open an issue. Please attach
tickcheck --jsonoutput with paths you are happy to share.
tickcheck v0.1.0 · MIT · source · the drawer