Skip to main content

stalecrate

Tell your coding agent which Rust crates changed after its training cutoff, and what changed.

Claude Opus 5.5 learned Rust from data that stops in June 2026. Bevy 0.19 shipped on June 19 and 0.20 on October 8. Ask Opus for a Bevy 0.20 observer and it writes On<Add, Health>. That form stopped compiling in 0.20, where the component moved into the event: On<Add<Health>>.

stalecrate reads your Cargo.lock, finds the dependencies released after the model's cutoff, and diffs their public APIs between the version the model knows and the version you pin. It then checks which of the changed items your code uses and writes short notes into CLAUDE.md or AGENTS.md. Each note quotes the crate's own migration guide where one exists.

Usage

uvx stalecrate scan --model claude-opus-5-5
uvx stalecrate sync --model claude-opus-5-5

sync downloads a prebuilt API index for each crate version from this repo's api-index-v1 release. A crate version without one gets built locally from rustdoc JSON, which needs a nightly toolchain (rustup toolchain install nightly) and runs the crate's build scripts. The release covers Bevy 0.18.1 and 0.20.1, egui 0.34.3 and 0.37.0 (with emath, epaint and ecolor), and wgpu 29.0.3 and 30.0.1, with more to come. Set STALECRATE_NO_DOWNLOAD=1 to always build locally.

On a Bevy 0.20 project with an empty cache, sync took 5 minutes. Almost all of that went to three crates with no index that failed to build for lack of ALSA and udev headers. It remembers those failures for a week, and the next run took 25 seconds.

scan lists the dependencies with releases after the cutoff. sync builds the API diffs and writes the notes between <!-- stalecrate:begin --> and <!-- stalecrate:end -->, leaving the rest of the file alone. It writes to CLAUDE.md if the project has one and AGENTS.md otherwise, or to --file. stalecrate status exits 1 when the notes no longer match Cargo.lock, so you can run it in CI or a pre-commit hook.

The only cutoff built in is Claude Opus 5.5 (June 2026), because it's the only one I could confirm. For any other model pass --cutoff YYYY-MM. Releases from the 30 days before the cutoff count as unknown, since the training data covers them thinly. Change that with --margin-days.

What a note looks like

From a project with Bevy 0.18 examples bumped to 0.20.1:

#### Moved Observer events `B` Bundle generic into the event type
(bevy 0.20 migration guide; your code uses `Add`, `On` in 3 files)

The `B: Bundle` type parameter has been removed from `On<E, B>` in observer systems.
...
- `TextFont::font_size` changed: `font_size: f32` → `font_size: FontSize` (used in 3 files)
- `PointLight::shadows_enabled` was removed in bevy_light 0.20.1; `PointLight` gained: `contact_shadows_enabled`, `shadow_maps_enabled` (used in 1 files)

Sections are ranked by how many of your files they touch and cut to a token budget (--max-tokens, default 4000).

Does it help?

I measured this on 12 Bevy 0.20 tasks with claude-opus-5-5. They covered observers, component hooks, picking, UI buttons, text, glTF scenes, lights, bloom and a few others. Every task has an official Bevy 0.20 example that compiles with the same feature set, so each one is solvable. A run passes when cargo check succeeds and the code contains what the task asked for. The two conditions differ only in the system prompt. Control gets one line saying the project pins Bevy 0.20.1. The notes condition gets that line plus a 4,000-token notes file, frozen before the first run.

Writing main.rs in one reply, with no tools and 5 samples per task:

control with notes
compiles 31/60 (52%) 55/60 (92%)
mean compiler errors 2.4 0.1
deprecation warnings 25 0
cost per call $0.036 $0.090

As an agent that can run cargo check and fix its own errors, with 3 samples per task:

control with notes
compiles 36/36 36/36
median turns 6 3
median wall time 38s 25s
cost per session $0.112 $0.139

With a compiler in the loop Opus gets there either way, by reading the errors. The notes halve the turns. On tasks this small they also make each session about 24% more expensive, because the notes ride along in every prompt. Wall times are rough, since two sessions shared the CPU.

The one task the notes didn't fix was loading a glTF scene (0/5 in both conditions). The migration guide renames SceneRoot to WorldAssetRoot in a list that the excerpt cut off. The current version always keeps guide lines that name an item your code uses. I haven't rerun the benchmark since that fix, because tuning on the test set would inflate the number.

I also checked the API diff itself against the compiler. I took Bevy 0.18 examples, compiled them against 0.20.1, and asked whether the diff had flagged what broke. On 20 examples held out from all tuning, it flagged all 8 that broke. 19 of their 25 compiler errors (76%) name an item the diff flagged. Only 16 of the 42 items it predicted would break showed up in an error. That 38% is a lower bound, since rustc stops reporting some errors once others appear.

Everything to rerun this is in the repo. The tasks are in bench/tasks.json, the frozen notes in bench/notes.md, the runner in scripts/bench.py, and per-run results in bench/results-*.json.

How it works

  1. Find what's new. For every package in Cargo.lock that you depend on, or that extends a name you depend on (bevy_ecs for bevy), it asks crates.io for release dates. Crates that a dependency re-exports (egui's Color32 comes from ecolor) join in a second pass. The newest release from before the cutoff is the version the model knows. A 0.0.x upload made long before the real releases counts as a name reservation, so that crate is treated as new.
  2. Diff the APIs. It loads both versions' public APIs from prebuilt indexes, or builds rustdoc JSON in a throwaway package when there is no index, and caches the result in ~/.cache/stalecrate. Then it walks the public items, including methods, fields and enum variants. An item that disappears from one crate and shows up in a crate that's new in this version counts as moved. Changes that only touch trait bounds or lifetime names get dropped, because they rarely break callers.
  3. Find what you use. It runs a text scan of your .rs files with comments stripped. A removed name that still exists in another crate (render_graph::Node vs bevy_ui::Node) only counts when you write the qualified path. This step is an estimate, not name resolution.
  4. Explain it. It looks for migration guides shipped inside the crate (Bevy ships _release-content/migration-guides), MIGRATION.md/UPGRADING.md, and changelog entries for the versions in range. If the crate ships none of those, it uses GitHub release notes, and GITHUB_TOKEN raises the rate limit. Each used item links to the section that names it. Anything left over gets a one-line note with the old and new signature.

Limits

  • Crates without a prebuilt index need a nightly toolchain, and the rustdoc JSON format changes between nightlies. I tested with format version 61 (nightly 2026-10-06).
  • Building docs runs build scripts, so crates that need missing system libraries get skipped. On the test machine that meant bevy_audio and bevy_dev_tools (ALSA) and bevy_gilrs (udev).
  • Without prebuilt indexes, the first sync on a Bevy project builds rustdoc JSON for about 50 crates at two versions each. On my laptop that took over 30 minutes and peaked at 1.8 GB of RAM. Later runs use the cache in ~/.cache/stalecrate.
  • Usage matching is textual, so a type you shadow with your own of the same name can still match.
  • The benchmark covers one model and one crate family. I haven't measured crates that ship no migration guide, such as egui or wgpu.

FAQ

Why Python and not cargo install? The diff logic changed a lot while I checked it against the compiler, and Python was faster to iterate in. It has no dependencies, and uvx stalecrate runs it without an install step. The tool only reads rustdoc JSON and text, so Rust would buy little speed. I'd take a port if people want one.

Does it call a model? No. Everything is crates.io lookups, rustdoc JSON and text matching. The benchmark scripts call a model. The tool doesn't.

Which models? Any model, if you pass --cutoff YYYY-MM. Only Claude Opus 5.5 has a built-in cutoff, because it's the only one I could confirm.

License

MIT or Apache-2.0, at your option.

Metadata

Release files for stalecrate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stalecrate 0.1.1
File Size Uploaded Provenance Actions
stalecrate-0.1.1.tar.gz 79.0 kB Without provenance Details for stalecrate-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stalecrate 0.1.1
File Interpreter ABI Platform Actions
stalecrate-0.1.1-py3-none-any.whl Python 3 none any Details for stalecrate-0.1.1-py3-none-any.whl

Total release size: 111.3 kB

Release files / stalecrate-0.1.1.tar.gz

Download URL stalecrate-0.1.1.tar.gz
Size 79.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6b023e77bdf167c573c63c2e41ea21702d97065a2d49cbdfe1ffda001da3f85e
BLAKE2b-256 checksum
How to use checksums
b148bcc7f7ec0ed7033e9c241be40951a11dcdb15204134a9c59d282728a0b2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / stalecrate-0.1.1-py3-none-any.whl

Download URL stalecrate-0.1.1-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e90e3e50430076d6969ec68b0257ecf91034f682aab599c4586f344142e4cd3c
BLAKE2b-256 checksum
How to use checksums
97923bd0a6f72f5b86088c5319f6a26ceefdb61b9b59077aac97de5512ff4ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for stalecrate 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page