// 38 tips tagged "performance"
The cleanupPeriodDays setting controls how long session transcripts are kept, or set it to 0 to disable persistence entirely.
Hand Claude your heap snapshots or server code and ask it to trace memory leaks — it spots missing event listener cleanup, unbounded caches, and stream lifecycle bugs that are easy to miss in code review.
A PreToolUse hook can intercept test runner commands and filter output to show only failures, cutting thousands of tokens from Claude's context.
CLAUDE.md loads into every message. Move workflow-specific instructions into skills that load on demand to reduce token costs across your session.
Claude Code exports detailed events via OpenTelemetry logs, giving you a full audit trail of every tool call, API request, and user prompt.
Every event emitted while processing a single prompt shares a prompt.id UUID, letting you trace the complete chain of API calls and tool executions.
Three environment variables control which attributes are included in Claude Code OTel metrics, letting you manage cardinality and storage costs.
Prevent automated Claude Code runs from saving session data to disk, keeping your CI pipelines clean and your .claude directory lean.
Let Claude generate a complete PWA setup — manifest, service worker with Workbox, caching strategies, and all the meta tags you'd otherwise forget.
Let Claude configure Nx in your monorepo — dependency graphs, affected builds, caching, and task pipelines — so CI only rebuilds what changed.
Type /model mid-session to switch from Opus to Sonnet, saving tokens on execution-heavy work without losing output quality.
Use worktree.symlinkDirectories and worktree.sparsePaths to avoid duplicating large directories and speed up worktree creation in monorepos.