Skip to content

Instantly share code, notes, and snippets.

@jonhainstock
Created July 2, 2026 15:15
Show Gist options
  • Select an option

  • Save jonhainstock/442c4bf825b589a7b0c5b9483f44954d to your computer and use it in GitHub Desktop.

Select an option

Save jonhainstock/442c4bf825b589a7b0c5b9483f44954d to your computer and use it in GitHub Desktop.
Relay Capital Threadsmith agent skill
name threadsmith
description Work with Threadsmith local Messages thread links and the Threadsmith MCP/follower database. Use when a user asks an LLM agent to summarize, search, inspect, export, or reason about Threadsmith thread links, cached Threadsmith conversations, local Messages exports, or Threadsmith MCP tools.

Threadsmith

Use this as a portable agent skill for Claude, Codex, or another LLM agent that can read SKILL.md-style instructions.

Source Of Truth

  • Treat Messages data and Contacts data as privacy-sensitive.
  • Prefer Threadsmith MCP tools over manual database queries.
  • Use the follower database at ~/Library/Application Support/Threadsmith/threadsmith.sqlite for agent reads.
  • Treat the follower database as a local historical archive. Normal Threadsmith syncs should add or update cached rows, not delete messages just because they are missing from a later Messages read.
  • Do not open ~/Library/Messages/chat.db directly unless the user explicitly asks and the task cannot be completed from the follower database.
  • Keep Messages access read-only.
  • Keep Contacts access read-only.

Common Workflow

  1. Start with threadsmith_status to confirm the follower database exists, is readable, and has sync metadata.
  2. For threadsmith://thread/<id>, call threadsmith_read_thread or threadsmith_get_thread_slice with the URI as identifier.
  3. For discovery, call threadsmith_search_threads first, then read or slice the selected thread by row id, URI, GUID, identifier, or exact display name.
  4. For targeted questions, use threadsmith_search_messages inside a single thread before expanding to larger slices.
  5. If a requested thread is not cached, open the URI through macOS with open 'threadsmith://thread/<id>' so the Threadsmith app can fetch and upsert that single thread, then re-check the follower database.
  6. If MCP tools are unavailable, query the follower database read-only.
  7. Summarize, extract open loops, or answer the user's question from bounded message slices. Avoid dumping entire private conversations unless the user explicitly asks for an export.

Ordering Defaults

  • Search/list threads newest-active first so the most recent context is easiest to find.
  • Read, slice, and export messages oldest-first by default so shared context preserves the conversation chronology.
  • Use newestFirst only when the user explicitly wants recent matching messages before earlier context.

MCP Tools

Prefer these tools when available:

  • threadsmith_status: reports follower database path, readability, sync counts, and privacy status.
  • threadsmith_search_threads: searches cached threads and returns newest-active thread summaries with threadsmith://thread/<id> URIs.
  • threadsmith_read_thread: reads one cached thread from the beginning, oldest-first, capped by maxMessages.
  • threadsmith_get_thread_slice: reads a bounded slice by limit, offset, optional ISO-8601 date bounds, and optional newestFirst.
  • threadsmith_search_messages: searches message text, subject, sender, GUIDs, and attachment filenames inside one cached thread.
  • threadsmith_export_thread: writes one cached thread to Markdown, JSON, or a ZIP package at a local outputPath.

Each tool accepts optional databasePath when the user explicitly wants another Threadsmith follower database. The MCP server reads Threadsmith's follower database only. It does not open ~/Library/Messages/chat.db.

Manual SQLite Fallback

Use sqlite3 -readonly "$HOME/Library/Application Support/Threadsmith/threadsmith.sqlite".

Useful tables:

  • threads: cached thread metadata
  • participants: thread handles
  • messages: cached message rows
  • attachments: attachment metadata only
  • sync_metadata: cache status

When querying dates manually, date_ms is milliseconds since Apple's 2001-01-01 reference date, not Unix epoch. Convert with:

datetime((date_ms / 1000) + 978307200, 'unixepoch', 'localtime')

Privacy And Output Rules

  • Summarize private message content instead of quoting long passages.
  • Do not include attachment contents. Only mention attachment names or counts when useful.
  • If a cache is missing or stale, say that Threadsmith must be opened/refreshed rather than weakening privacy controls.
  • If macOS blocks access to ~/Library/Messages/chat.db, report the Full Disk Access requirement instead of trying to bypass it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment