hot-paths

Reduce startup and per-turn latency in TypeScript developer tools.

5|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/TechyMT/claude-code-superpowers --skill hot-paths
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hot-paths
Source: https://github.com/TechyMT/claude-code-superpowers/tree/main/skills/hot-paths
Command: npx skills add https://github.com/TechyMT/claude-code-superpowers --skill hot-paths

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large developer-agent codebases and tools can suffer noticeable delays when modules initialize at process start, when per-turn context is assembled, or when tool inputs are validated on every call. This Skill captures the patterns used to keep Claude Code's startup under a second and to minimize latency during each API turn and tool invocation.

Core Features & Use Cases

  • Deferred schema initialization via lazySchema to avoid Zod construction at module load.
  • Build-time dead-code elimination using feature flags to keep bundles small.
  • Memoization and targeted cache invalidation for expensive per-conversation computations like git status.
  • Parallel asynchronous initialization with Promise.all and simple profiling checkpoints to measure load stages.
  • Use case: Apply when adding a new tool whose input schema or top-level initialization threatens to regress startup time, or when per-turn prompt assembly becomes a performance bottleneck.

Quick Start

Wrap top-level Zod schemas in lazySchema, memoize expensive per-conversation functions, and replace sequential init steps with Promise.all to reduce startup and per-turn latency.

Frequently Asked Questions about hot-paths

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce TypeScript module initialization latency in CLI tools?

Reduce TypeScript module initialization latency by deferring Zod schema construction with lazySchema and replacing sequential init steps with parallel Promise.all execution. This prevents heavy module loading from blocking startup time in short-lived CLI processes.

How do I optimize Zod schema construction for LLM tool validation?

Optimize Zod schema construction by wrapping top-level schemas in a lazySchema function, which defers object creation until validation is actually needed. This prevents schema building from executing during module load and slows down per-turn tool invocations.

What is the best way to cut per-turn latency in LLM-integrated developer tools?

Cut per-turn latency by memoizing expensive per-conversation computations like git status checks and applying targeted cache invalidation. This ensures repeated context assembly operations do not recompute unchanged data during each API turn.

Does feature flag tree-shaking help with TypeScript startup performance?

Feature flag tree-shaking improves TypeScript startup performance by enabling build-time dead-code elimination to keep bundles small. This removes unused code paths before execution, directly reducing the initialization overhead of the interpreter session.

How do I profile startup delays in agent-backed developer tools?

Profile startup delays by implementing simple profiling checkpoints alongside parallel asynchronous initialization using Promise.all. This combination allows you to measure individual load stages and identify which modules regress startup time.

Can I use memoization to cache git status in CLI agent processes?

Memoization caches git status and other expensive per-conversation computations in CLI agent processes, returning cached results until invalidated. This prevents redundant execution during rapid sequential tool calls within the same conversation context.