stalemap

io.github.Umair由 GitHub 帳號 Umair 發布v0.4.1更新於 Oct 27, 2026

Tells coding agents which npm dependencies changed after their training cutoff, and what changed.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

告訴程式編碼代理哪些 npm 相依套件在模型訓練截止日之後有變動、改了什麼,透過筆記、編輯時守衛與搜尋工具達成。

可以做什麼
  • 搜尋相依套件變更:search_changes 以自然語言查詢專案相依套件中的 API 變化並附上來源。
  • 檢視變更:package_changes 與 project_changes 報告模型已知版本與專案鎖定版本之間的差異。
  • 檢查筆記:check_notes 確認 AGENTS.md 或 CLAUDE.md 中的筆記區塊是否存在且為最新。
  • 寫入與驗證筆記:命令列把排序後的筆記區塊同步進 AGENTS.md 或 CLAUDE.md,CI 檢查在筆記過期時失敗。
  • 守衛編輯:每次編輯後執行專案本身的型別檢查,並把錯誤與對應的變更筆記配對。
適用情境
適合鎖定的 npm 版本比程式編碼模型訓練截止日更新的 JavaScript 與 TypeScript 專案,這類專案中代理容易依已移除或改名的 API 寫程式。也適用於 Claude Code、Cursor、Codex、OpenCode 或任何 MCP 用戶端,以及需要找出相依套件筆記過期的 CI。
執行需求
以 stdio 在本機執行,通常透過 npx stalemap mcp 啟動,需要 Node.js 與 npm。模型 ID 來自 STALEMAP_MODEL,或從代理設定中偵測;也可明確指定截止日期。需要連線 npm registry、GitHub 與 models.dev,可用時會使用 GITHUB_TOKEN 或 gh 登入。
安裝前請注意
套件名稱與版本會傳送到 npm registry、GitHub 與 models.dev;啟用 LLM、範例或升級指南選項時,型別差異、版本說明摘錄與匯入的 API 名稱會傳給 Claude,probe 提示會傳給所選供應商。設定 STALEMAP_PRECOMPUTED_URL 會把套件名稱傳到該主機。sync 命令會寫入 AGENTS.md 或 CLAUDE.md,setup 會合併進代理設定檔。專案仍在早期階段,由一人維護。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 stalemap,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[stalemap: tell your coding agent which dependencies changed after its training cutoff]

[npm version] [CI] [MIT license] [Node version] [Claude Code plugin] [MCP server]

Install · Example · How it works · Results · Changelog

Coding agents learn libraries from training data that stops at a cutoff date. When your project pins newer versions, the agent writes code for the old API: maxSteps against AI SDK 7, required_error against zod 4, middleware.ts against Next 16.

stalemap finds the dependencies that changed after your model's training cutoff and tells the agent what changed, in three ways:

  • Notes: a short, ranked list of changes written into AGENTS.md or CLAUDE.md, so the agent reads it before it starts.
  • Edit-time guard: after each edit, the project's own type-check. If the code uses an API that changed after the cutoff, the agent gets the compiler error and the matching note (or the release-note or upgrade-guide section that explains it) right away. It also reports the code that still compiles but uses something that moved.
  • search_changes: an MCP tool the agent can ask in its own words, such as "resolve alias in next.config", to get the matching changes with their sources.

It works for JavaScript and TypeScript projects, with Claude Code, Cursor, Codex, OpenCode or any MCP client.

In a blind, pre-registered benchmark of 66 tasks built from changes released after June 2026, claude-sonnet-5-5 agents passed 89% of sessions with stalemap, against 68% with no help and 73% with a plain tsc --noEmit hook after each edit. See Results.

[Your pinned versions, what your code uses and your model's cutoff go in; stalemap diffs types, release notes and upgrade guides; your agent gets notes at session start, a guard after each edit, and search_changes on demand.]

Status

  • npm: the latest release is stalemap 0.4.1: the build tested in held-out v4 (0.4.0), plus a one-line footer in the notes block. npx stalemap, the Claude Code plugin and the GitHub Action all run it. See the changelog.
  • The project is early, and maintained by one person.

Install

Claude Code plugin

text
/plugin marketplace add Umair/stalemap/plugin install stalemap@stalemap

The plugin adds:

  • a SessionStart hook that puts the notes into Claude's context for the session's model (on startup, after /clear and after compaction; it writes no files);
  • a PostToolUse hook that runs the edit-time guard after each Write or Edit;
  • the stalemap MCP server and two skills (/stalemap:sync writes the notes block; upgrade tells Claude to look up a package's changes before using or upgrading it).

The hooks and the MCP server run npx -y stalemap@latest, so they use the latest npm release. Its MCP tools are search_changes, package_changes, project_changes and check_notes.

Command line

bash
npx stalemap            # preview what changed and the block it would writenpx stalemap sync       # write the block into AGENTS.md or CLAUDE.mdnpx stalemap check      # for CI: exit 1 when the block is missing or stalenpx stalemap guard src/**/*.ts   # run the guard by hand

The block sits between <!-- stalemap:start --> and <!-- stalemap:end -->. Text outside it is never touched. Claude Code reads CLAUDE.md; if your notes live in AGENTS.md, add @AGENTS.md to CLAUDE.md or pass --target CLAUDE.md.

Other agents: setup --agent

bash
stalemap setup --agent cursor             # or codex, opencode, claudestalemap setup --agent codex --dry-run    # print the changes, write nothing

One command per agent writes the notes, registers the MCP server and installs the guard as the agent's post-edit hook, as project files you can commit. It merges into existing config files, keeps entries it didn't write, and re-running it changes nothing.

One caveat: it hasn't been tried in a real Cursor, Codex or OpenCode install yet. Cursor doesn't pass a postToolUse hook's context to the model yet, so setup adds a stop-hook fallback that sends unreported findings as a follow-up message.

Any MCP client

json
{ "mcpServers": { "stalemap": { "command": "npx", "args": ["-y", "stalemap@latest", "mcp"] } } }

GitHub Action

yaml
- uses: Umair/stalemap@main  with:    model: claude-opus-5-5          # fail CI when the notes are missing or stale    # mode: comment                 # or comment on PRs that change dependencies

Comment mode needs permissions: pull-requests: write. It lists each changed dependency (what the model knows → what's pinned) with its notes, and updates the comment on later pushes.

What the notes look like

[npx stalemap on a Next.js + AI SDK app with claude-sonnet-4-5: next, ai and zod changed after the cutoff, and the notes name the changed APIs and their replacements]

For a Next.js + AI SDK app and claude-sonnet-4-5 (cutoff 2025-07-31), excerpt:

markdown
**ai** 4.3.16 → 7.0.142 (major)- `CoreMessage` was removed; use `ModelMessage`. [types]- `convertToCoreMessages` was removed; use `convertToModelMessages`. [types]- `streamText()` options no longer accept `maxTokens`, `maxSteps`, `toolCallStreaming`, … [types]
**next** 15.4.0 → 16.4.2 (major)- `revalidateTag()` now requires `profile` (in `next/cache`) [types]- `NextMiddleware` is deprecated: Use `NextProxy` instead. Middleware has been renamed to Proxy. (in `next/server`) [types]

Full output: examples/next-ai-app.claude-sonnet-4-5.md.

How it works

  1. Which model? --model, or the model configured for Claude Code, Codex, OpenCode or Gemini CLI, or $ANTHROPIC_MODEL. The training cutoff comes from models.dev (with a built-in fallback table), or pass --cutoff YYYY-MM-DD.
  2. What did the model know? For each dependency, the newest stable release published at least 30 days before the cutoff (--margin).
  3. Which dependencies? Direct dependencies your code imports (scanned locally), plus the ones a config file configures (tsconfig.json, next.config.*, the Prisma schema, Vitest and ESLint configs, and others). --all checks every direct dependency. Pinned versions come from node_modules or the lockfile (npm, pnpm, yarn, bun).
  4. What changed?
    • Types: both versions' .d.ts files are downloaded and compared with the TypeScript compiler API: removed, renamed and moved exports, new required parameters, removed or newly required options, and new @deprecated tags with their hints.
    • Release notes: the package's changelog or GitHub Releases, scored for breaking-change signals and for the APIs you use. A removal gets its replacement from a rename the changelog announces.
    • Upgrade guides (--guides): for changes that never reach a type signature, like a new default or a renamed file convention. Claude turns each guide into short notes, and a note is kept only if it quotes the guide.
    • Verified examples (--examples): a Before → After line under the top notes, written by Claude and kept only if it compiles against the version you pin.
  5. Fit the budget. Notes about what your project uses come first: imported APIs, members and props, config keys it sets, file names. The default budget is 1,800 tokens (--budget).

The guard runs after each edit. It runs the project's own tsc and reports what it finds, in this order:

  1. Compile errors that come from a dependency that changed after the cutoff, with the matching note as the fix. When no note explains the error, it shows the matching section from the package's type changes, release notes or upgrade guide, found by searching with the error and the code around it.
  2. Things that still type-check but changed:
    • config keys that moved (experimental.ppr in Next 16);
    • moved members (HttpStatusCode.PayloadTooLarge → ContentTooLarge in axios 1.20);
    • renamed file conventions (middleware.ts → proxy.ts);
    • tsconfig.json options the project's TypeScript rejects.
  3. The compiler's other errors: in the edited file, new ones in files that import it, and a few elsewhere. These don't claim a dependency changed.

So a plain type-check hook is a subset of the guard. STALEMAP_GUARD_TSC=0 limits the guard to dependency changes. Deprecations are reported only with STALEMAP_GUARD_DEPRECATIONS=1.

search_changes (also stalemap search <query>) searches everything stalemap found for the project's dependencies: every type change, every release-note item, cached upgrade-guide notes and, for a new major, the guides' text. Ranking is BM25 over words and split identifiers (resolveAlias matches "resolve alias"), weighted toward what the project uses. The first search builds an index from the analysis caches; later ones are offline and fast.

stalemap probe measures which notes a model actually needs: it asks the model to write code for each change, type-checks the answers against the pinned version, and runs again with the notes. Notes the model already gets right are dropped from the block. Probe tasks name the old API, so they measure whether the model knows a change when pointed at it, which is easier than noticing it unprompted.

Run stalemap --help for every command and option, including --llm (summaries written by Claude) and the precomputed reports for about 200 fast-moving packages (not hosted yet).

What leaves your machine

  • Package names and versions go to the npm registry, GitHub (changelogs and releases; GITHUB_TOKEN or your gh login is used when available) and models.dev.
  • Your source code is never uploaded. The import scan is local.
  • With --llm, --examples or --guides: type diffs, release-note excerpts, guide text and the names of APIs you import go to Claude (the Anthropic API or claude -p). Your code isn't included.
  • With probe: the probe prompts go to the provider you choose.
  • With $STALEMAP_PRECOMPUTED_URL set: package names, not versions, go to that host.

Caches live in ~/.cache/stalemap ($STALEMAP_CACHE moves them).

Results

[Held-out v4: claude-sonnet-5-5 passed 68% with no help, 73% with a plain tsc hook, 89% with stalemap, 98% with a one-line hint; claude-sonnet-4-5 passed 46%, 53%, 64% and 78%]

Every result comes from headless Claude Code sessions graded by hidden tests the agent never sees. Each task is run in two modes: one-shot (file tools only) and checks (the agent can also run npm test and tsc). Intervals come from a two-level bootstrap (tasks, then runs). A difference counts as a win only when its interval excludes zero.

Held-out v4 (protocol, results for claude-sonnet-5-5, for claude-sonnet-4-5) is blind and pre-registered:

  • 66 tasks sampled by seed from every breaking, deprecation and behavior change that 33 popular npm packages released between July and October 2026;
  • 3 sessions per task, arm, mode and model;
  • the build frozen as freeze/v4-final before any v4 result existed.
setupclaude-sonnet-5-5claude-sonnet-4-5
agent alone68%46%
+ a plain tsc --noEmit hook after each edit73%53%
+ stalemap (notes, edit-time guard, search_changes)89%64%
+ a one-line hand-written hint naming the change (ceiling)98%78%

All four pre-registered comparisons were wins:

comparisonmodeldifferenceinterval
stalemap vs alone (primary)claude-sonnet-5-5+20.7 points[13.6, 28.3] (95%)
stalemap vs tsc hookclaude-sonnet-5-5+16.4 points[7.6, 26.0] (98.3%)
stalemap vs aloneclaude-sonnet-4-5+17.9 points[7.6, 28.8] (98.3%)
stalemap vs tsc hookclaude-sonnet-4-5+10.6 points[0.3, 21.7] (98.3%)
  • One-shot is where it matters most: on claude-sonnet-5-5, 89% vs 60% with no help. With checks, it's 89% vs 77%.
  • Fewer stale edits: the agent's first edit used a stale API in 11% of claude-sonnet-5-5 sessions with stalemap, vs 27% with no help.
  • Cost:
    • claude-sonnet-5-5: median $0.050 vs $0.041 per session with no help, with about the same turns (7 vs 8).
    • claude-sonnet-4-5: higher, at $0.124 vs $0.085 and 79 s vs 47 s.
  • A current model still needs it. Even claude-sonnet-5-5 failed a third of these tasks on its own, and a one-line hint fixed almost all of them. stalemap closes about two-thirds of that gap.
  • Results against third-party tools aren't published.

Earlier suites (all claude-sonnet-4-5):

  • Held-out v1 (pre-registered, 10 tasks): 83% vs 50% alone, a win.
  • Held-out v2 (blind, 10 tasks): 35% vs 23% alone, a tie.
  • Held-out v3 (blind, 59 tasks): 53% vs 43% alone, a win. It tied a plain tsc hook. The changes in 0.3 and 0.4 came from what v3's transcripts showed: the guard didn't run the project's own TypeScript, notes and search lost the fix text, and search wasn't used enough. v4 is the first blind test of those changes.

What to keep in mind:

  • Same author. stalemap, the harness and the protocols have one author. The v4 tasks were written by a separate session that never saw stalemap's code, notes or results. An independent, equally blind reviewer checked them and applied the pilot rule. The tasks, hidden tests, sampling files, review, pilot and per-session results are in bench/ for you to check.
  • JavaScript and TypeScript, two Claude models. Other agents and models weren't measured.
  • Pre-registered vs post-hoc. Only the comparisons fixed in a protocol before a run are claims. The changes made after v3 were post-hoc, which is why v4 was needed.

Limits

  • JavaScript and TypeScript only, and one package.json (no workspace traversal yet).
  • Packages without bundled types get release-note notes only (@types/* aren't diffed).
  • Usage tracking stops at imported names and x.member accesses; instance chains like client.messages.create({ temperature }) aren't traced.
  • Behavior changes that never reach a type signature come only from release notes and (with --guides) upgrade guides. If neither names the setting, stalemap can't either.
  • Ranking release notes is heuristic and noisy for prose-heavy changelogs.
  • Agents sometimes ignore correct notes. The guard catches what fails to compile and some of what still compiles (moved keys and members, renamed files); other stale code that still compiles is caught only if a note covers it.

Run the benchmark

The harness, the tasks, the protocols and the results are in bench/. In short:

bash
npm install && npm run buildmkdir -p bench/.work/template-heldout-v4-latest && cp bench/heldout-v4/templates/latest/*.json bench/.work/template-heldout-v4-latest/(cd bench/.work/template-heldout-v4-latest && npm install --ignore-scripts)npx tsx bench/heldout-v4/validate.ts      # reference solutions pass, stale versions failnpx tsx bench/run.ts --suite heldout-v4 --model claude-sonnet-5-5 --arms alone,stalemap-full,tsc-hook,oracle --examples --guides --reps 3npx tsx bench/analyze.ts bench/results/<dir>

Sessions run on whatever Claude Code is signed in with, and a full v4 run is about 1,600 sessions per model, so start with --reps 1 or --tasks. Transcripts go to bench/results/<dir>/runs/, which is git-ignored. See bench/README.md for the arms, isolation, sharding and costs.

Development

bash
git clone https://github.com/Umair/stalemap && cd stalemapnpm installnpm run build       # → dist/cli.jsnpm test            # node:test via tsxnode dist/cli.js scan --cwd test/fixtures/next-ai-app --model claude-sonnet-4-5npm link            # optional: put your local build on your PATH

Library use:

ts
import { runStalemap, packageChanges, checkBlock } from "stalemap";
const { rendered } = await runStalemap({ cwd: ".", model: "claude-opus-5-5" });

Contributing

Bug reports, false or missing notes, and new benchmark tasks are all welcome. See CONTRIBUTING.md. To report a security problem, see SECURITY.md.

License

MIT

來源:README.md,提交 7dc9805

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.1最新Oct 20, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分