RCP-CWK-020 Cowork Persistent Prompt Library

Build prompts for tasks you repeat across sessionsย 

Builds, saves, loads, searches, compares, and manages reusable prompt templates with file-based persistence and git version tracking. Your prompts survive across sessions and accumulate into a searchable library.


Cowork Persistent Prompt Library with Git Versioning

Tags: Introduced in Beta, Prompt, Library, Template, Persistence, Git, Versioning, Bridge, Cowork

TL;DR

What It Does
Builds, saves, loads, searches, compares, and manages reusable prompt templates with file-based persistence and git version tracking. Your prompts survive across sessions and accumulate into a searchable library.
How It Works
The recipe extends Core UltraPrompt Builder with Cowork file-system persistence. In build mode, it runs the full Core 10-step interactive UltraPrompt flow, then offers to save the result as a named template in the project folder. Saved templates are organized by category (general, content_creation, technical, marketing, analysis, craft_specific, custom) in a prompt-library directory with a central index file. Git versioning lets you compare template versions over time. Seven modes cover the full lifecycle: build, save, load, list, search, compare, and delete.
What To Expect
In build mode you go through the interactive UltraPrompt builder and get a save prompt at the end. In load mode you get your saved template back with options to use as-is, modify sections, or use as a starting point for a new build. In list and search modes you see your library contents. In compare mode you see git diffs between template versions.
Best Results When You
Build prompts for tasks you repeat across sessions — project briefs, analysis frameworks, content templates. Save them with descriptive names and appropriate categories. Use compare mode after modifying a template to see what changed. Commit your prompt-library directory via CWK-005 to persist across sessions.
Typical Time
2–5 minutes for build mode (interactive UltraPrompt flow). Under 1 minute for all other modes.
Difficulty
Medium — build mode requires the interactive UltraPrompt conversation (10 steps of template selection, section building, and assembly). All other modes are simple operations with minimal input.

How To Start

Choose a mode based on what you want to do with your prompt library.

STEP 1Choose the Operation Mode

Tell the AI which library operation to perform.
Available parameters
  • mode · string · optional · default: build
    Operation mode. Options: “build” (interactive UltraPrompt builder with auto-save), “save” (save current prompt), “load” (load template), “list” (list all templates), “search” (search by keyword), “compare” (compare versions via git), “delete” (remove template).
  • template_name · string · optional
    Name for saving or loading a prompt template.
  • category · string · optional · default: general
    Template category. Options: “general,” “content_creation,” “technical,” “marketing,” “analysis,” “craft_specific,” “custom.”
  • search_term · string · optional
    Search term for finding saved templates. Used with search mode.
  • user_name · string · optional · default: User
    Name for personalized prompts.
  • initial_purpose · string · optional
    Initial purpose to guide the build process.
Invocations
Build New Prompt (Default)
#H->AI::Directive: (Manage persistent prompt library)
Build with Purpose
#H->AI::Directive: (Manage persistent prompt library with initial_purpose=“blog post outline for AI trends”)
Load Saved Template
#H->AI::Directive: (Manage persistent prompt library with mode=load, template_name=“weekly-report”)
List All Templates
#H->AI::Directive: (Manage persistent prompt library with mode=list)
Search Templates
#H->AI::Directive: (Manage persistent prompt library with mode=search, search_term=“analysis”)
Compare Versions
#H->AI::Directive: (Manage persistent prompt library with mode=compare, template_name=“weekly-report”)

Usage Examples

Three scenarios — building and saving a new prompt, loading and modifying a saved template, and comparing template versions.
Example 1 · Build and save a new prompt template
User: I need a reusable prompt for weekly project status reports.
AI: Initializing UltraPrompt Builder with persistence. [Runs 10-step interactive flow.] UltraPrompt built successfully. Save to prompt library? Provide a name or say SKIP. [User: weekly-status-report] Template saved: analysis/weekly-status-report. Recommend git checkpoint to version-track this template.
Example 2 · Load and modify a saved template
User: Load my weekly-status-report template and update the output format section.
AI: Loading template: weekly-status-report. Found in analysis/weekly-status-report.ultraprompt.txt. Version 1, created 2026-03-15. Displaying 8 sections. Use as-is, modify sections, or use as starting point? [User: modify section 5] Current section 5 shown. New content for section 5? [User provides update.] Section updated. Reassembled. Save as new version?
Example 3 · Compare template versions via git
User: Show me what changed in weekly-status-report since last month.
AI: Checking git history for weekly-status-report.ultraprompt.txt. 3 commits found. Comparing LATEST vs commit abc1234 (2026-03-15). Changes: section 5 (output format) rewritten, section 3 (context) expanded with stakeholder list. 2 sections added, 0 removed.

How AI Reads This Recipe

When this recipe is triggered, the AI manages a persistent prompt library through an 8-step mode-based pipeline. The AI should:
  1. DETERMINE MODE from the mode parameter. Route to the appropriate step: build → Step 2, save → Step 3, load → Step 4, list → Step 5, search → Step 6, compare → Step 7, delete → Step 8.
  2. BUILD PROMPT in build mode by executing the full Core UltraPrompt 10-step interactive flow (template selection through optional sections). After assembly, offer to save to the prompt library. If the user provides a name, auto-save via Step 3.
  3. SAVE TEMPLATE to the prompt-library directory. Create the category subdirectory if needed. Generate a template file with header metadata (name, category, created, modified, version, author, description) and the full assembled prompt. Update the central PROMPT-INDEX.txt. Recommend a git checkpoint.
  4. LOAD TEMPLATE by searching the prompt-library directory for a matching filename. Display the template with metadata and offer three options: use as-is, modify specific sections, or use as a starting point for a new build. Section modification reassembles the prompt and offers a new version save.
  5. LIST TEMPLATES from the index file (or rebuild from file scan if the index is missing). Filter by category if specified. Display a formatted table with name, category, modified date, version, and description.
  6. SEARCH TEMPLATES using Grep across the prompt-library directory. Case-insensitive search. Rank results by relevance: filename match > metadata match > content match.
  7. COMPARE VERSIONS using git history. Show commit log for the template file, let the user choose two versions, display the diff with added/removed/changed sections highlighted.
  8. DELETE TEMPLATE after confirmation. Remove the file and update the index. Note that git history preserves the content for recovery.
The recipe extends Core UltraPrompt Builder with file-based persistence and git versioning. The prompt-library directory uses category subdirectories with .ultraprompt.txt files and a central index. Integrates with Git Checkpoint (CWK-005), Session Init (CWK-001), Handoff (CWK-002), and Cookbook Scanner (CWK-019). If the prompt-library directory does not exist, create it. If the index is corrupted, rebuild from file scan. Never fabricate template content.

When to Use This Recipe

Use this recipe when you:
  • Want to build a high-quality prompt using the structured UltraPrompt interactive flow and save it for reuse.
  • Need to load, modify, or reuse a prompt template from a previous session.
  • Want to search your accumulated prompt library by keyword to find relevant templates.
  • Need to compare how a template has evolved over time using git version diffs.
Do not use this recipe when:
You need a quick, one-off prompt that you will not reuse. The full UltraPrompt build flow takes 2–5 minutes of interactive conversation. For throwaway prompts, just write them directly. The library adds value only when templates are reused or evolved over time.

Recipe FAQ

Q.Where are prompt templates stored?

In the project folder under prompt-library/{category}/ as .ultraprompt.txt files. A central PROMPT-INDEX.txt file tracks all templates with metadata. The directory structure organizes templates by category: general, content_creation, technical, marketing, analysis, craft_specific, and custom.

Q.How does versioning work?

Templates are plain text files in the project folder. When you commit via CWK-005 (Git Checkpoint), git tracks every change. Use compare mode to see diffs between any two commits for a template file. Git history preserves all versions, including deleted templates.

Q.What happens in build mode?

Build mode runs the full Core UltraPrompt 10-step interactive flow: template selection, role definition, context setting, constraint definition, output format specification, and several optional enhancement sections. After the final assembly, it offers to save the result to the library with a name and category.

Q.Can I modify a saved template without rebuilding from scratch?

Yes. Load mode displays the template’s numbered sections and lets you modify specific ones. After modification, it reassembles the prompt and offers to save as a new version. You can also use the “starting point” option to enter build mode with the template’s sections pre-populated.

Q.What categories are available?

Seven: “general” (default), “content_creation” (blog posts, articles, copy), “technical” (code, architecture, debugging), “marketing” (campaigns, messaging, positioning), “analysis” (research, reports, data interpretation), “craft_specific” (CRAFT framework recipes and workflows), and “custom” (anything else).

Q.How does the recipe integrate with other CRAFT recipes?

Four integrations: Git Checkpoint (CWK-005) versions the prompt-library directory. Session Init (CWK-001) reports library size during startup. Handoff (CWK-002) notes active and recently modified templates. Cookbook Scanner (CWK-019) can discover prompt templates alongside recipe cheatsheets for a complete project inventory.

Version History

Changes to this recipe over time. Most recent first.
v1.00a 2026-02-28
Initial release. Extends Core UltraPrompt Builder with Cowork persistence: 7 operation modes (build, save, load, list, search, compare, delete), file-based template storage with category subdirectories, central PROMPT-INDEX.txt, git version tracking with diff comparison, 7 template categories, section-level modification in load mode, integration with 4 recipes (Git Checkpoint, Session Init, Handoff, Cookbook Scanner).

Get this recipe with CRAFT for Claude Cowork

Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.

Pull anytime to stay on the latest version — free to clone, no login or email required.

Then start your session

Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:

You

Please initialize my CRAFT session.

Claude

CRAFT session ready. Your project is loaded, your persona is active, and your recipes are available. What would you like to work on?

What is CRAFT for Claude Cowork?

Not familiar with Git? Download as a ZIP

No command line needed. Just download, move, and unzip:

  1. Open the CRAFT framework repo on GitHub.
  2. Click the green Code button, then choose Download ZIP.
  3. Move the downloaded ZIP into your Claude Cowork project folder.
  4. Unzip it: double-click on Mac, or right-click → Extract All on Windows.

Similar Posts