Skip to main content
prompt GP ChatGPT

12-services-layer — Claude Code prompt: wire up background services

12-services-layer — a prompt that configures Claude Code CLI background services: analytics, policy limits, remote settings, session memory, and bootstrap data.

no license ★ 3,444 updated 2026-10-14

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

What 12-services-layer does

The prompt walks through wiring six services that run in the background of the CLI: GrowthBook for feature flags and OpenTelemetry traces, rate and quota checks from the Anthropic backend, server-pushed configuration, conversation history persistence across invocations, initial data from the API, and token cost tracking. Most of these call Anthropic servers and will fail in a dev build.

It breaks the task into seven parts: first it asks you to document the init sequence in src/entrypoints/init.ts, then makes GrowthBook optional (feature checks return false on failure), stubs policyLimits so it does not block requests, ensures remote settings and bootstrap fall back to defaults, verifies that SessionMemory works with the local filesystem, and wires up cost-tracker.ts to display locally without remote reporting. Bootstrap will fail without an API key — the prompt requires sensible defaults in that case.

At the end you create scripts/test-services.ts: a script that runs init() and logs which service broke. The check is bun scripts/test-services.ts completing without a crash, unavailable services log warnings, and the app starts even when Anthropic's backend is unreachable.

What it helps with

  • connect GrowthBook, policy limits, remote settings, session memory, and bootstrap to the CLI
  • keep services from crashing the app when Anthropic backend is down
  • set up token cost tracking for local display
  • write a smoke test for all background services

Example prompts for the agent

  • Walk through the 12-services-layer prompt and set up the services layer
  • Create scripts/test-services.ts following the 12-services-layer instructions
  • Stub policy limits so they don't block requests in dev builds

How to install 12-services-layer

Manually: put the files in place

.claude/commands/12-services-layer.md

Questions about 12-services-layer

How do I install 12-services-layer in Claude Code?

Copy the prompt to .claude/commands/12-services-layer.md and call it in chat.

What does the 12-services-layer prompt do?

It configures six background services in Claude Code CLI: GrowthBook analytics, request limits, remote config, session memory, bootstrap API, and cost tracking. It makes them work in dev builds without a real Anthropic backend.

What happens if Anthropic's backend is unreachable?

The prompt requires each service to return defaults or log warnings instead of crashing. GrowthBook returns false for feature flags, policy limits pass requests through, remote settings use built-in values.

Similar prompts

All prompts for Agent setup: memory, context, orchestration →

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 02-runtime-shims 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. 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