02-runtime-shims — Claude Code prompt: what it does, how to install
02-runtime-shims is a Claude Code prompt that creates runtime shims for bun:bundle flags and MACRO globals to run CLI source without Bun.
no license ★ 3,444 updated 2026-10-14
.claude/commands/02-runtime-shims.mdWhat 02-runtime-shims does
This prompt directs an AI assistant to write runtime replacements for Bun bundler macros. Original Claude Code CLI sources expect dead-code elimination via feature() flags and rely on compile-time inlining of the global MACRO namespace. Attempting to execute the raw TypeScript code directly makes module resolution fail.
The tasks include producing src/shims/bun-bundle.ts with environment variable fallbacks alongside src/shims/macro.ts to extract the package version from package.json. It also sets up a bootstrap file at src/shims/preload.ts and supplies global type definitions. Settings in tsconfig.json remain untouched because runtime aliasing belongs to a subsequent build phase.
What it helps with
- Execute Claude Code CLI sources without depending on Bun bundling
- Provide runtime implementations for missing
bun:bundleimports - Populate the global
MACROcontainer directly from project metadata - Ensure TypeScript checks pass by validating with
bun run typecheck
Example prompts for the agent
- Apply the 02-runtime-shims prompt to set up runtime shims for Bun
- Generate shims for bun:bundle and the global MACRO inside src/shims
- Verify the runtime shims using bun -e according to the prompt instructions
How to install 02-runtime-shims
Manually: put the files in place
.claude/commands/02-runtime-shims.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 02-runtime-shims
How to install 02-runtime-shims in Claude Code?
Save the file to .claude/commands/02-runtime-shims.md inside your workspace and execute it from Claude Code.
What does 02-runtime-shims do?
It guides the creation of src/shims/bun-bundle.ts, src/shims/macro.ts, and src/shims/preload.ts to replace Bun compile-time features at runtime.
Why does the prompt leave tsconfig.json untouched?
The existing path configuration already satisfies type verification, while runtime alias mapping is handled during the bundler build step.