Skip to main content

Working with Prompts

Prompts are the core resource in Claro. Learn how to retrieve them, access their content, and understand their metadata.

Getting a Prompt

Retrieve a prompt using its package name:

Package Names

Prompts use a semantic naming convention:
Components:
  • @workspace - Your workspace slug (unique identifier)
  • prompt-name - The prompt’s URL-friendly name
  • version - Version identifier (v0 for drafts, v1+ for published)
Find your prompt’s package name in the Claro dashboard under prompt settings or by clicking the “Share” button.

Version Conventions

Version v0 is reserved for drafts. Published versions start at v1.

Prompt Content Fields

Prompts contain three types of content:

Generator Prompt

The main prompt content:
Use this with your LLM provider:

System Prompt

Optional system-level instructions:

Critique Prompt

Optional prompt for evaluating outputs:

Prompt Metadata

Access metadata about the prompt:

Available Metadata

Dictionary-Style Access

Prompts support both attribute and dictionary access:

Working with Multiple Prompts

Fetching Different Versions

Version Migration

Using with Different LLM Providers

OpenAI

Anthropic Claude

Google Gemini

Caching Prompts

For frequently accessed prompts, consider caching:
Be careful with caching. If a prompt is updated, your cache may return stale data. Consider cache invalidation strategies.

Best Practices

Always use specific versions (v1, v2) in production code:
Using latest in production means your application behavior changes when prompts are updated.
Use v0 (draft) for development and testing:
Not all prompts have system or critique prompts:
Validate package names before fetching:

Next Steps

Context Files

Work with file attachments and URLs

Variables

Extract and validate variables in prompts

Listing Prompts

Browse and paginate through prompts

Error Handling

Handle errors when fetching prompts