How limiajayi/prompts-bookmark-extension works
This is a browser extension for saving Claude prompt–response pairs locally. Its main workflow adds a button to completed Claude responses, extracts the preceding prompt and response, checks for sensitive content, hashes the pair, and saves or removes it. The popup reads those bookmarks and supports searching, copying, opening the chat, and deleting entries. The graph includes the sampled capture, extraction, diagnosis, storage, and popup code; secret-handling internals are unsampled, so their details are not expanded.
Main entry points: content.ts Content script · main.ts Popup interface · selectors.ts DOM selectors · extract.ts Pair extraction
Components 16
Claude capture
- Content script
entrypoints/content.ts - Secret confirmation
utils/secretGuard.ts
Extraction and diagnostics
- DOM selectors
utils/selectors.ts - Response completion
utils/settle.ts - Pair extraction
utils/extract.ts - DOM text reader
utils/text.ts - Selector diagnosis
utils/diagnose.ts
Bookmark library
- Pair hashing
utils/hash.ts - Bookmark storage
utils/storage.ts - Bookmark type
utils/types.ts
Popup interface
- Popup interface
entrypoints/popup/main.ts - Bookmark search
utils/search.ts
Other components
- Claude chat page
- Browser local storage
- Extension user
- System clipboard
Connections 23
- Claude chat page → Content script: hosts script
entrypoints/content.ts - Content script → DOM selectors: queries DOM
entrypoints/content.ts - Content script → Response completion: waits for completion
entrypoints/content.ts - Content script → Pair extraction: extracts message pair
entrypoints/content.ts - Content script → Selector diagnosis: checks markup
entrypoints/content.ts - Content script → Secret confirmation: checks sensitive text
entrypoints/content.ts - Content script → Pair hashing: hashes saved pair
entrypoints/content.ts - Content script → Bookmark storage: saves or removes
entrypoints/content.ts - Pair extraction → DOM selectors: selects messages
utils/extract.ts - Pair extraction → DOM text reader: reads message text
utils/extract.ts - DOM text reader → DOM selectors: skips page furniture
utils/text.ts - Selector diagnosis → Pair extraction: checks selectors
utils/diagnose.ts - Selector diagnosis → DOM selectors: inspects variants
utils/diagnose.ts - Response completion → DOM selectors: checks stream state
utils/settle.ts - Bookmark storage → Browser local storage: reads and writes
utils/storage.ts - Popup interface → Bookmark storage: loads and deletes
entrypoints/popup/main.ts - Popup interface → Bookmark search: filters bookmarks
entrypoints/popup/main.ts - Bookmark search → Bookmark type: uses bookmark shape
utils/search.ts - Bookmark storage → Bookmark type: stores bookmarks
utils/storage.ts - Extension user → Content script: clicks bookmark
- Extension user → Popup interface: manages bookmarks
README.md - Popup interface → System clipboard: copies text
entrypoints/popup/main.ts - Popup interface → Claude chat page: opens chat link
entrypoints/popup/main.ts