Allow customizing plan file naming via Options

Resolved 💬 2 comments Opened May 14, 2026 by radhikasig Closed May 14, 2026

Feature Request

Allow SDK consumers to customize plan file naming through Options, similar to how plansDirectory already works.

Problem

When using @anthropic-ai/claude-agent-sdk programmatically (e.g. building an agent runtime), plan files are given random adjective-gerund-noun names like giggly-squishing-squid.md. There's no way to override this naming from the SDK's public API.

The plansDirectory option exists to control where plans are stored, but there's no corresponding option for how they're named.

Proposed Solution

Add a planSlug or planNameGenerator option to Options:

interface Options {
  // Existing:
  plansDirectory?: string;

  // New - either a static slug:
  planSlug?: string;

  // Or a generator function for dynamic naming:
  planNameGenerator?: () => string;
}

This would allow consumers to generate deterministic, meaningful names (e.g. timestamp-based plan-2026-05-13-143022, or chat-ID-based plan-<chatId>).

Current Workaround

The only way to achieve this today is via pnpm patch to replace the internal BU8() function in the bundled cli.js, which is fragile across SDK version upgrades.

Context

We're building a multi-session agent runtime where plan files should be identifiable and organized per-chat rather than using random names that are hard to correlate with sessions.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗