Build Paste

YESreplaces $2.5/mosaves $30/yrback to the verdict

0%0 of 20 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

A background agent that captures everything you copy into an encrypted local store, skips items password managers mark as concealed, keeps rich previews for images and files, organises pins into boards, expires old entries on a schedule, and pastes back into the application you were in.

estimated effort weekendthe files for this build are in the project pack

LanguageSwift 6 and SwiftUI in XcodeApp typeA background agent with LSUIElement trueCapturePolling NSPasteboard.changeCountStorageSQLite encrypted at rest, with the key in the keychainInsertionPasteboard plus a synthetic Cmd-V with restore

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree if you own one

    Why The pasteboard, keychain and insertion APIs are all platform surfaces.

    Get it Apple menu, then About This Mac.

    Verify About This Mac reports macOS 14 or higher

  2. installfree

    Why Builds and signs the agent.

    Get it Mac App Store or developer.apple.com/xcode. open ↗

    Verify xcodebuild -version prints 16 or higher

  3. installfree with an open source manager

    Why Phase 1's most important check cannot be tested without one, and it is the check that keeps this from becoming a password log.

    Get it Any password manager that sets the concealed pasteboard type. Test by copying a password and confirming nothing is captured.

    Verify A copied password does not appear in the history

  4. decidefree

    Why Sending Cmd-V into another application needs it. Capture and search work without it, so it can be requested late.

    Get it System Settings, then Privacy and Security, then Accessibility, when the paste-back feature is first used.

    Verify Selecting a clip pastes into the previous application

  5. 99 USD per year

    Why Product phase only. Without it, no notarization.

    Get it Enrol at developer.apple.com/programs. open ↗

    Verify A Developer ID Application certificate appears in Xcode settings

Data model

Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.

- clips(id, kind, hash, bytes, preview_text, source_bundle_id, copied_at, pinned, board_id, expires_at) · kind is text, image, file or rich
- boards(id, name, position) · pinboards for things you paste repeatedly
- clip_data(clip_id, encrypted_blob) · the actual content, encrypted at rest, separate from the searchable metadata
- excluded_apps(bundle_id, reason) · applications whose copies are never captured
- The searchable metadata deliberately holds a preview rather than the content, so search does not require decrypting everything.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
HISTORY_DB_PATHrequired~/Library/Application Support/Clips/history.dbEncrypted clip store. The key lives in the keychain, not here.
POLL_INTERVAL_MSrequired200How often the change count is checked. Lower feels instant and costs battery.
RETENTION_DAYS_TEXTrequired30How long text clips are kept. Finite by default and deliberately so.
RETENTION_DAYS_IMAGErequired7Images are large and rarely wanted a month later.
MAX_HISTORY_MBrequired500Total size cap. Oldest unpinned clips are removed first.
EXCLUDED_BUNDLE_IDSrequiredcom.example.passwordmanagerApplications never captured from, in addition to the concealed type check.

The build, in order

  1. Capture, and what not to capture

    Everything you copy is stored, except the things that must never be.

    1. A timer comparing changeCount. Only read the pasteboard when it has moved.

      Files Watcher.swift

    2. Skip concealed, transient and auto-generated markers. Check before reading, since reading is what creates the exposure.

      Files Watcher.swift

    3. Same content updates the timestamp. Otherwise a repeated copy fills the history.

      Files Store.swift

    done when · tick each as it passes
    watch out
    • Password managers mark their pasteboard items with a concealed type, and a history that ignores those markers becomes a plaintext log of every password you copied. Check types before reading contents, not after, and write a test that feeds a synthetic concealed item and asserts nothing was stored.
  2. Encryption at rest

    The history on disk is unreadable without the key, and the key is in the keychain.

    1. On first launch, into the keychain with an appropriate access policy. Never a file.

      Files Crypto.swift

    2. Content encrypted, preview short and treated as readable.

      Files Store.swift

    3. Open the database file with a tool and look. If you can read a clip, the encryption is not doing what you think.

      terminal
      sqlite3 history.db "select * from clip_data limit 1;"
    done when · tick each as it passes
    watch out
    • Encrypting the content but storing a full plaintext preview alongside it defeats the purpose, because the preview usually contains the sensitive part. Keep the preview short and truncated, and treat it as something that could be read.
  3. Search and pasting back

    A hotkey opens the history, typing filters it, and Return pastes into where you were.

    1. A non-activating panel so the previous application keeps its focus context.

      Files Panel.swift

    2. Without decrypting everything, which is why previews exist.

      Files Search.swift

    3. Save the pasteboard, write, send Cmd-V, restore after a delay, and only if your value is still there.

      Files Paste.swift

    done when · tick each as it passes
    watch out
    • Restoring the previous pasteboard too quickly races the paste and the target application receives the restored value instead of the clip. Restore after a delay, and only if the pasteboard still holds what you wrote.
  4. Boards and rich content

    Things you paste repeatedly live somewhere, and images and files behave like themselves.

    1. Images, files and rich text each have their own capture, preview and paste behaviour.

      Files Types/

    2. Mark missing files in the list rather than failing at paste time.

      Files Types/FileClip.swift

    3. Named collections of pinned clips, reorderable, exempt from expiry.

      Files Boards.swift

    done when · tick each as it passes
    watch out
    • Storing a copied file as a path means the clip breaks silently when the file moves or is deleted, and it will look fine in the list until you paste it. Either store the file's contents for small files, or check existence when the clip is shown and mark it clearly.
  5. Expiry, which is a feature

    The history does not keep everything you have ever copied, forever.

    1. Both, on a schedule and after each capture. Pinned clips exempt.

      Files Expiry.swift

    2. Vacuum after removal so the content is not recoverable from the file. Verify by inspection.

      Files Store.swift

    3. Different lifetimes per kind, with the setting prominent rather than buried.

      Files Settings.swift

    done when · tick each as it passes
    watch out
    • A clipboard history that keeps everything forever is a comprehensive record of everything you have handled, and it is the kind of thing people forget they are carrying. Default to a finite window and make the retention setting prominent rather than buried.
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more productivity utilities.