Skip to main content
prompt GP ChatGPT

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/02-runtime-shims.md
Open on GitHub

What 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:bundle imports
  • Populate the global MACRO container 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.md

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.

Similar prompts

All prompts for Programming languages →

From the same set17

The whole set →
05-env-and-auth 05-env-and-auth sets up environment variables and tests API connectivity in claude-code workspaces. Creates a documented .env.example and builds a test script for Bun. GP ChatGPT ★ 3,444repo stars 07-tool-system 07-tool-system is a Claude Code prompt for auditing the CLI tool interface, registry, and imports. It also asks for a smoke test that loads the available tools. GP ChatGPT ★ 3,444repo stars 06-ink-react-terminal-ui 06-ink-react-terminal-ui — a Claude prompt that follows the React + Ink render path in the claude-code repo, checks the components and theme, and ends with a working terminal render test. GP ChatGPT ★ 3,444repo stars 14-dev-runner The 14-dev-runner prompt configures a development runner for Claude Code to execute TypeScript directly with Bun. It eliminates the need for full production builds during iterative work. GP ChatGPT ★ 3,444repo stars 09-query-engine The 09-query-engine prompt guides an architecture review of QueryEngine and a basic conversation test against the Anthropic API. Use it to trace requests, streaming events, and tool calls. GP ChatGPT ★ 3,444repo stars 12-services-layer 12-services-layer — a prompt that configures Claude Code CLI background services: analytics, policy limits, remote settings, session memory, and bootstrap data. GP ChatGPT ★ 3,444repo stars 03-build-config The 03-build-config prompt guides Claude Code through setting up an esbuild build for a TypeScript and TSX CLI. Use it to produce dist/cli.mjs for Bun or Node.js 20+. GP ChatGPT ★ 3,444repo stars Claude Code Explorer MCP Claude Code Explorer MCP — an MCP server that lets your agent browse the Claude source: tool and slash-command listings, code search, architecture overview. CX Codex +1 ★ 3,444repo stars

Project sponsors

Companies that keep this analytics open