Wrap a command; later, ask how any file was made. A minimal experiment & lineage tracker.
Project description
ntrk
Wrap a command. Later, ask how any file was made.
ntrk records how each output was produced — the exact command, the git commit, and md5 hashes of every input and output — so you can point at a file weeks later and see its full lineage, back to the raw inputs. Pure Python standard library, no dependencies, two commands.
Install
uv tool install ntrk
Commands: nt (alias ntrk). Run uv tool update-shell once if nt isn't on your PATH.
Add to Claude
This repo is also a Claude Code plugin marketplace shipping the ntrk skill, so your coding
agent knows when to record runs and trace outputs:
/plugin marketplace add tim-hudelmaier/ntrk
/plugin install ntrk@ntrk
Use
Two commands, no flags.
nt track python main.py -i in.csv -o out.csv # run it, record how
nt trace out.csv # how was this made?
nt track refuses to run on a dirty repo, so every result maps to a real commit. nt trace
prints one line per step — raw inputs first, the file you asked about last — so you can pipe it
through head / grep / awk. A [modified] marker appears if a file changed since it was made:
$ nt trace out_final.csv
in.csv -> step1.py @ 9c4b2a1 -> out.csv
out.csv -> step2.py @ 3a1f9c8 -> out_final.csv
Inputs and outputs are detected from the conventional flags
-i -o --in --out --input --output (repeated, space-, or comma-separated lists work). If your
scripts use other flag names, add a small ntrk.toml:
[flags]
inputs = ["--source"]
outputs = ["--dest"]
How it works
Each run is appended as one JSON line to .ntrk/runs.jsonl (commit it — it's your lineage
history), and each output also gets an invisible self-contained sidecar (.NAME.ntrk) so a file
stays traceable even when copied outside the repo. trace walks the chain by content hash, so it
still works after intermediate files are renamed or deleted.
Development
uv sync # set up the environment
uv run pytest # run the tests
Releasing (maintainer)
CI (.github/workflows/ci.yml) runs the test matrix on every push/PR and publishes to PyPI on
push to main via trusted publishing (OIDC, no API token), using skip-existing so an
unchanged version is a no-op. One-time PyPI setup (a pending publisher, since the project is not
yet on PyPI):
- PyPI → Your account → Publishing → add a pending GitHub publisher:
- Project:
ntrk· Owner:tim-hudelmaier· Repo:ntrk - Workflow:
ci.yml· Environment:pypi
- Project:
- In GitHub → Settings → Environments, create an environment named
pypi. - Bump the version in
pyproject.tomland push tomain— the first successful publish creates the project and converts the pending publisher.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ntrk-0.1.0.tar.gz.
File metadata
- Download URL: ntrk-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dd1bceef79ab9dfd2d82b503da3251afbe0d29c9ce8f0ad53a96442d6158566
|
|
| MD5 |
bbddd2bb279a40e548abaaf6c774db89
|
|
| BLAKE2b-256 |
43871d0a72ccce6120a56f8156001898bd298bf1360839d500517e22bf922d00
|
Provenance
The following attestation bundles were made for ntrk-0.1.0.tar.gz:
Publisher:
ci.yml on tim-hudelmaier/ntrk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ntrk-0.1.0.tar.gz -
Subject digest:
5dd1bceef79ab9dfd2d82b503da3251afbe0d29c9ce8f0ad53a96442d6158566 - Sigstore transparency entry: 1959273377
- Sigstore integration time:
-
Permalink:
tim-hudelmaier/ntrk@c9b06736dbcfb6b47a60458004c5368a78b216e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tim-hudelmaier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c9b06736dbcfb6b47a60458004c5368a78b216e8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ntrk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ntrk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0b1f04f4284e4cb5ea4a679a829036eaac5b8e55964dec2cc740b77f5f85cfb
|
|
| MD5 |
2b50dc77f1cc8caef704416cc1a5ff30
|
|
| BLAKE2b-256 |
da349703bcc74c086fad196e712d7c0cab0765ce520a5258455c2e7d62ccbd19
|
Provenance
The following attestation bundles were made for ntrk-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on tim-hudelmaier/ntrk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ntrk-0.1.0-py3-none-any.whl -
Subject digest:
d0b1f04f4284e4cb5ea4a679a829036eaac5b8e55964dec2cc740b77f5f85cfb - Sigstore transparency entry: 1959273680
- Sigstore integration time:
-
Permalink:
tim-hudelmaier/ntrk@c9b06736dbcfb6b47a60458004c5368a78b216e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tim-hudelmaier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c9b06736dbcfb6b47a60458004c5368a78b216e8 -
Trigger Event:
push
-
Statement type: