> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autoblocks.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Snippets FAQ

> Frequently asked questions about the snippet system

## General Questions

**Q: What are snippets and why should I use them?**
A: Snippets are reusable text blocks that can be referenced in prompts. They help maintain consistency, reduce duplication, and enable centralized content management across your entire prompt library.

**Q: How do snippets differ from regular prompt templates?**
A: Snippets are smaller, focused content blocks that can be referenced within prompt templates. Templates are complete prompts, while snippets are building blocks for templates.

**Q: Can I use the same snippet in multiple prompts?**
A: Yes! That's the main benefit. A single snippet can be referenced by unlimited prompts, and updating the snippet updates all referencing prompts simultaneously.

**Q: Do snippet updates require re-deploying prompts?**
A: No. Snippet content updates propagate automatically to all referencing prompts without requiring redeployment.

## Creating and Managing Snippets

**Q: What are the naming rules for snippets?**
A: Snippet names must:

* Contain only letters, numbers, slashes, underscores, and hyphens
* Be 1-100 characters long
* Follow the pattern: `^[a-zA-Z0-9]+([/_-][a-zA-Z0-9]+)*$`
* Use forward slashes for hierarchy (e.g., `system/greeting`)

**Q: How do I update a snippet?**
A: Go to Settings > Snippets, click on the snippet to edit, modify the content, optionally add a commit message, and save. Changes take effect immediately.

**Q: Can I see who created or modified a snippet?**
A: Yes, each snippet shows its creator and revision history includes the author of each change.

**Q: What happens to old versions of snippet content?**
A: All revisions are preserved in the snippet's revision history, but only the latest revision is used in prompts.

## Using Snippets in Prompts

**Q: How do I reference a snippet in a prompt?**
A: Type `@` followed by the snippet name in the template editor. For example: `@system/greeting`

**Q: Can I preview snippet content before using it?**
A: Yes, hover over any snippet reference in the template editor to see a preview popup with the content.

**Q: What's the difference between referencing and expanding a snippet?**
A:

* **Referencing**: Keeps the dynamic link (`@snippet-name`) - updates automatically
* **Expanding**: Copies the content directly into the template - becomes static text

**Q: How many snippets can I use in a single prompt?**
A: There's no hard limit, but for performance and maintainability, keep it reasonable (typically under 20 references per template).

## Deployment and Versioning

**Q: What happens to snippet references when I deploy a prompt?**
A: Deployed prompts maintain persistent snippet references. The system tracks which snippets are used by deployed prompts.

**Q: If I update a snippet, do all prompts using it update immediately?**
A: Yes, both deployed and non-deployed prompts get the updated content immediately. There's no way to pin prompts to specific snippet versions.

**Q: How does the system handle snippet references during prompt versioning?**
A: Each prompt revision tracks its snippet references. When you create new revisions, old references are cleaned up (for non-deployed revisions) and new ones are created.

**Q: Can I see which prompts use a specific snippet?**
A: Yes, each snippet shows a usage count indicating how many prompts reference it.

## Troubleshooting

**Q: Why can't I delete a snippet?**
A: Snippets cannot be deleted if they're referenced by any prompts (deployed or non-deployed). You must remove all references first.

**Q: I updated a snippet but don't see changes in my prompt. Why?**
A: Check:

* Snippet name spelling in your prompt
* Browser cache (try refreshing)
* User permissions
* Whether the snippet reference is correctly formatted (`@snippet-name`)
