Organizing Code Snippets Like a Pro: A Clasp Tutorial
You've got 50 code snippets scattered across Gist, your notes app, and old Slack messages. Your workflow is chaos.
Sound familiar?
This is the developer problem Clasp solves. It's a native macOS/iOS clipboard manager that doesn't just save everything you copy — it learns from your patterns, lets you search across your entire coding history, and expands text snippets on-demand.
In this tutorial, I'll walk you through setting up Clasp like a senior developer's snippet library, with real-world workflows for API keys, SQL queries, code templates, and config files.
Why Snippet Management Matters
The Problem: Developers spend ~10% of their workday searching for code they've already written. Gist works, but it's slow. Snippets extensions work, but they're tied to one editor. Clipboard managers exist, but they're clunky and don't understand code.
The Clasp Advantage:
- Native integration: Works across Xcode, VS Code, Terminal, everywhere you copy
- AI classification: Automatically tags snippets as SQL, JSON, API responses, etc.
- Semantic search: Find "that config I used last month" without remembering exact keywords
- Offline-first: Everything stays on your Mac. Zero cloud. Zero tracking.
- Bilingual: English + French, perfect for international teams
Setup (5 minutes)
Download & Install
- Get Clasp from App Store: https://apps.apple.com/app/id6759068382
- Clasp opens to an empty clipboard history. That's normal — it starts capturing from moment one.
First Steps
Enable Hotkey:
- Open Clasp → Settings → Hotkey
- Set to
Cmd+Shift+C(default, or choose your own) - This is your lifeline. Memorize it.
Organize by Category:
- Create group: API Keys (for tokens, auth)
- Create group: SQL Queries (for database snippets)
- Create group: Config Templates (for .env, docker-compose, etc.)
- Create group: Regex Patterns (for grep/sed/js patterns)
Enable Search:
- Settings → Search → toggle ON
- This indexes everything you copy. Huge time-saver.
Real-World Workflows
Workflow 1: Database Queries (SQL)
Scenario: You're building a reporting dashboard. You write a complex SQL query, then need it again next sprint.
SELECT u.id, u.email, COUNT(o.id) as order_count,
SUM(o.total) as lifetime_value
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at > DATE_SUB(NOW(), INTERVAL 1 YEAR)
GROUP BY u.id
HAVING COUNT(o.id) > 5
ORDER BY lifetime_value DESC;
With Clasp:
- Copy the query (Cmd+C)
- Open Clasp (Cmd+Shift+C)
- Clasp auto-tags it as "SQL" + "Database"
- Tag it manually: add "Reporting" + "Dashboard"
- Add note: "Customer cohort analysis for reporting dashboard"
- Next month: search "customer cohort" → boom, there it is
No Gist. No switching apps. No friction.
Workflow 2: API Authentication Tokens
Scenario: You work with 3 APIs (OpenAI, Stripe, Cloudflare). Each has a different auth pattern.
Clasp stores them safely:
- Copy token → Clasp auto-detects as "API Key"
- Add tag: "OpenAI" or "Stripe"
- Add note: "Production API key for ChatGPT integration"
- Lock it (Settings → Lock sensitive items) — requires Touch ID to view
- Later, hit Cmd+Shift+C → search "OpenAI" → paste instantly
Security win: Keys live in Clasp (encrypted on-device), not in your terminal history or browser history.
Workflow 3: Config Templates
Scenario: You spin up new projects monthly. Every project needs:
.envtemplatedocker-compose.ymltemplate- GitHub Actions workflow
Setup:
- Create group: Config Templates
- Copy
.envtemplate → Clasp → tag "Env Template" - Do same for docker-compose, GitHub Actions, etc.
- When starting new project, Cmd+Shift+C → "Env" → paste → customize
This cuts project setup time from 20min to 5min.
Workflow 4: Regex & sed Patterns
Scenario: You constantly write regex patterns for log parsing.
Store patterns + their descriptions:
# Extract HTTP status codes from logs
(\d{3})(?=\s)
# Match email addresses
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Tag them: "Regex", "Logging", "Email Extraction" Next time: search → paste → done.
Pro Tips
Tip 1: Search is Your Superpower
Don't memorize where snippets live. Clasp's semantic search finds them by meaning, not exact text. Example: search "postgres connection string" finds your psql -U user -d db command even if you don't remember the exact flags.
Tip 2: Use Tagging Aggressively Don't rely on description alone. Tag everything by language (SQL, JavaScript, Bash), project (ProjectX, Dashboard), and use-case (Auth, Logging, API). Search across tags: "SQL + ProjectX" finds only relevant snippets.
Tip 3: Sync Across Devices Enable iCloud in Settings if you want iPhone/iPad access. Clips you copy on Mac appear on iPhone instantly. Perfect for on-call scenarios.
Tip 4: Lock Sensitive Items Settings → Sensitive → mark API keys, passwords, tokens. Requires Touch ID to view. Still searchable, but hidden from casual glances.
Tip 5: Weekly Cleanup Clasp saves everything. Prune old entries monthly. Keep only evergreen, reusable snippets.
Conclusion
Clasp transforms your clipboard from a black hole into a searchable, organized library.
You'll save ~2 hours per week searching for old code. That's 100+ hours per year. The time cost of setup (5 minutes) pays for itself in the first day.
Download Clasp on the App Store
Share your best Clasp workflow in the comments. What snippets do you find yourself copying most?
About the author: Kevin Nadjarian builds privacy-first apps at LorisLabs. Clasp is one of 8 macOS/iOS apps designed with zero cloud, zero tracking. Learn more at lorislab.fr.