Prompt Git
by @theshadowrose
Git for your prompts. Track every change, diff versions, rollback mistakes, never lose a good prompt again. All local, zero dependencies, works offline.
Example 1: Refining a System Prompt
# Initial version
echo "You are a helpful assistant." | \
python3 prompt_git.py save assistant --category system --note "v1"After testing, add more detail
echo "You are a helpful assistant. Provide concise answers." | \
python3 prompt_git.py save assistant --note "v2: added conciseness"Hmm, too concise. Rollback
python3 prompt_git.py rollback assistant Try a different approach
echo "You are a helpful assistant. Provide detailed, thoughtful answers." | \
python3 prompt_git.py save assistant --note "v3: detailed instead" --tag testingThis one works! Tag it
python3 prompt_git.py tag assistant best
python3 prompt_git.py tag assistant production
Example 2: Sharing Prompts with a Team
# Export your best system prompt
python3 prompt_export.py export my-system-prompt team-prompt.json --historyTeammate imports it
python3 prompt_export.py import team-prompt.jsonNow they have the full history and can see how it evolved
python3 prompt_git.py versions my-system-prompt
Example 3: Finding What Broke
# Prompt stopped working. When?
python3 prompt_git.py versions my-promptOutput shows versions with timestamps
Pick two versions: one that worked, one that didn't
python3 prompt_git.py diff my-prompt Diff shows exactly what changed
Fix it and save a new version
See config_example.json for reference constants and example values
# Change storage location
STORAGE_DIR = '/path/to/your/prompts'Define your own categories
DEFAULT_CATEGORIES = ['system', 'task', 'template', 'snippet', 'general']Suggested tags
SUGGESTED_TAGS = ['best', 'testing', 'production', 'deprecated']Similarity threshold for "find similar" search
SIMILARITY_THRESHOLD = 0.5
See config_example.json for all options.
Q: Does it sync across devices?
A: No. It's local-only. But you can export/import to share manually, or put ~/.promptgit in a synced folder (Dropbox, Git, etc.).
Q: Can I use it with Git? A: Yes! The storage directory is just JSON and text files. You can version the whole thing with Git if you want meta-version-control.
Q: What about collaborative editing? A: Not built-in. Export/import is the collaboration model. For real-time collab, use a shared folder or Git.
Q: Does it work with images or multimodal prompts? A: Text only. If your multimodal prompt has a text component, you can save that.
Q: How do I delete a prompt?
A: Currently, no delete command (by design οΏ½ version control shouldn't delete easily). You can manually delete the folder in ~/.promptgit/prompts/.
clawhub install prompt-git