Contacts book v1

contacts.txt is the private snapshot for one local Contacts book. It stores imported connections and their user-edited notes and last-contacted dates. The launcher checks the file before opening the book. See the backup and restore runbook.

Text format

The file is UTF-8 with LF line endings and a final LF. It starts with Contacts-Version: 1. An empty book has just this version line. Each record starts after a %% separator on its own line. The first record header is Contact: <ID>, where the ID is unique and contains 32 lowercase hexadecimal characters.

HeaderValue
First-Name, Last-NameImported name. At least one has a value.
Profile-URLRecognized LinkedIn profile URL.
Email, Company, PositionImported contact and work details.
Connected-OnDate or timestamp as supplied by the export.
Last-ContactedUser-entered calendar date in YYYY-MM-DD form.

Headers use Key: value. A header key appears at most once per record. Fields with empty values are omitted on write. A blank line after the headers starts the note body, which can be empty. The serializer prefixes a % to each note line beginning with %. The reader removes one leading % from note lines beginning with %%. This preserves literal separator lines in notes.

Write and restore

The snapshot is a regular file owned by the data directory's owner, with mode 0600 and one hard link. Contacts locks the book, checks the revision for the proposed write, and replaces the snapshot atomically from the same directory. A preview or edit based on an older revision pauses for a fresh preview or reopened book.

For a stopped-book backup, copy contacts.txt. The lock and temporary import previews are recreated as needed during normal use.

Snapshot reader and writer (source unavailable)