Keep your AI coding assistant from scaffolding yesterday's stack.
AI coding assistants like Claude Code have a knowledge cutoff. When you ask them to scaffold a project, they default to the dependency versions baked into their training data — often months behind the latest stable releases. You start a fresh project with stale deps, and you've got tech debt before you've written a line of business logic.
ghost-sync is a documented pattern — a set of CLAUDE.md instructions and conventions — that fixes this. Drop it into your project (or your global Claude Code config) and your assistant will verify versions against the live web before pinning anything.
Named after Ghost in the Shell: syncing the ghost with current reality.
You: "Scaffold a Next.js app with Tailwind and Prisma"
Claude (without ghost-sync):
→ next@14.1.0 (latest: 15.2.x)
→ tailwindcss@3.4 (latest: 4.x)
→ prisma@5.10 (latest: 6.x)
Claude (with ghost-sync):
→ Searches for current stable versions first
→ next@15.2.x, tailwindcss@4.x, prisma@6.x
→ Notes any breaking changes you should know about
Add the ghost-sync block to your project's CLAUDE.md:
<!-- In your project's CLAUDE.md -->
## Dependency Management (ghost-sync)
Before adding or suggesting ANY new dependency:
1. **Search first** — Use web search to find the current stable version and its
release date. Do not rely on training data for version numbers.
2. **Check compatibility** — Verify the version works with the project's existing
stack (e.g., Node version, framework version, peer dependencies).
3. **State what you found** — When suggesting a dependency, include:
- The version you're recommending
- The current latest stable version (from your search)
- Any breaking changes from the version you "knew" to the current one
4. **Respect lockfiles** — If a lockfile (package-lock.json, poetry.lock, etc.)
exists, read it before suggesting version changes. Don't fight the lockfile.
5. **Pin deliberately** — Use exact versions or tight ranges, not `latest` or `*`.
Document why if you pick something other than the latest stable.Add it to your global Claude Code instructions at ~/.claude/CLAUDE.md:
## Dependency Management (ghost-sync)
When working on any project, before adding or suggesting new dependencies:
1. Search the web for the current stable version — do not rely on training data.
2. Verify compatibility with the project's existing stack.
3. State the version you're recommending vs. what's currently latest.
4. Respect existing lockfiles.
5. Pin versions deliberately.The quick-start block above covers 90% of cases. For teams or complex projects, see the full pattern in ghost-sync.md, which adds:
- Ecosystem-specific rules — Node/Python/Rust/Go each have their own versioning conventions and lockfile formats.
- Framework scaffolding checks — When generating boilerplate (e.g.,
create-next-app,fastapiproject structure), verify the scaffold itself is current. - Upgrade audit prompt — A prompt block you can paste to audit an existing project's deps against latest.
- Version journal — A convention for documenting version decisions in your codebase.
Those tools update deps after they're in your project. ghost-sync prevents stale versions from landing in the first place. They're complementary:
| Tool | When it acts | What it does |
|---|---|---|
| ghost-sync | At scaffolding / dependency addition time | Ensures the AI suggests current versions from the start |
| Dependabot / Renovate | Ongoing, after deps are committed | Opens PRs when newer versions are available |
Use both.
There's no CLI, no runtime, no package to install. ghost-sync is a prompt engineering pattern that exploits Claude Code's ability to search the web mid-conversation. By placing the instruction in CLAUDE.md (which Claude Code reads at the start of every session), you ensure the behavior is consistent without remembering to ask for it.
The key insight: Claude Code can look up current versions — it just doesn't do it by default. It falls back to training data because that's faster. ghost-sync overrides that default.
Does this slow things down? Marginally. A web search adds a few seconds per dependency. Worth it to avoid starting with stale versions.
Does this work with other AI coding tools? The pattern is designed for Claude Code's CLAUDE.md convention, but the idea transfers. Any AI assistant that reads project-level instructions and can search the web can use a similar pattern.
What if the latest version has a known issue? The pattern asks Claude to check compatibility, not blindly use the latest. If the latest has problems, Claude should flag that and suggest the most recent stable version.
Can I customize which ecosystems to check? Yes. The full pattern in ghost-sync.md has ecosystem-specific blocks you can include or exclude.
This is a living document. If you've found a pattern that works well for keeping AI-assisted projects current, open a PR.
MIT