Skip to content

Repository files navigation

TimeGPT

Chrome extension that adds timestamps to ChatGPT messages and conversations — because time matters.

ChatGPT doesn't show when messages were sent or when conversations were created. TimeGPT fixes that by intercepting API responses and displaying timestamps inline in the UI.

Features

  • Message timestamps — Shown on hover alongside the action buttons (Copy, Edit, etc.)
  • Sidebar timestamps — Creation date displayed below each conversation title
  • Configurable format — Relative (5m ago), 24h, 12h, ISO 8601, or time-only
  • Toggle visibility — Enable/disable message and sidebar timestamps independently
  • Privacy-first — No data leaves your browser. No external requests. No tracking.

Installation

From source

  1. Clone the repository:

    git clone git@github.com:deviationist/timegpt.git
    cd timegpt
  2. Install dependencies and build:

    npm install
    npm run build
  3. Load in Chrome:

    • Navigate to chrome://extensions
    • Enable Developer mode (top right)
    • Click Load unpacked
    • Select the timegpt project folder
  4. Open ChatGPT and hover over any message to see timestamps.

Development

Prerequisites

  • Node.js 18+
  • npm

Scripts

Command Description
npm run build Compile TypeScript → dist/ via esbuild
npm run build:debug Build with debug logging enabled
npm run watch Rebuild on file changes
npm run watch:debug Watch mode with debug logging
npm run typecheck Run TypeScript type checking (no emit)
npm run package Build and create timegpt.zip for distribution

Project structure

timegpt/
├── src/
│   ├── types.ts          # Shared type definitions
│   ├── globals.d.ts      # Compile-time constants (e.g. __DEBUG__)
│   ├── interceptor.ts    # Fetch interceptor (runs in MAIN world)
│   ├── content.ts        # DOM manipulation (runs in ISOLATED world)
│   └── popup.ts          # Settings popup
├── dist/                  # Compiled JS (gitignored, generated by build)
├── icons/                 # Extension icons (16, 48, 128px)
├── manifest.json          # Chrome extension manifest (MV3)
├── popup.html             # Settings popup HTML
├── styles.css             # Timestamp styling
├── build.js               # esbuild configuration
├── tsconfig.json          # TypeScript config (type checking only)
└── logo.svg               # Source logo

Architecture

TimeGPT uses two content scripts injected into chatgpt.com:

  1. Interceptor (MAIN world, document_start) — Monkey-patches window.fetch to capture responses from:

    • /backend-api/conversation/{id} — extracts message.create_time for each message
    • /backend-api/conversations — extracts create_time for the sidebar conversation list
  2. Content script (ISOLATED world, document_idle) — Receives timestamp data via postMessage, matches message IDs to DOM elements ([data-message-id]), and injects <time> elements. Uses MutationObserver to handle dynamically loaded content.

Communication between worlds happens via window.postMessage. The interceptor buffers data in case it arrives before the content script loads, and the content script sends a drain request to retrieve buffered data.

Debug logging

Build with --debug to enable [TimeGPT] console messages:

npm run build:debug

Debug logs are compiled out entirely in production builds via esbuild's define feature — no runtime cost.

Making changes

  1. Edit files in src/
  2. Run npm run watch for automatic rebuilds
  3. Reload the extension in chrome://extensions
  4. Hard-refresh ChatGPT (Cmd+Shift+R / Ctrl+Shift+R)

Privacy

  • No permissions beyond storage (used to save your format preference)
  • Scoped to chatgpt.com only — won't run on any other site
  • Read-only — only reads timestamp metadata from API responses, never message content
  • No external requests — everything stays in your browser
  • No background processes — nothing runs when ChatGPT isn't open

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes in src/
  4. Run npm run typecheck to verify types
  5. Run npm run build to verify the build
  6. Test by loading the unpacked extension and verifying on ChatGPT
  7. Commit and push your branch
  8. Open a pull request

License

ISC

About

Chrome extension that displays timestamps on ChatGPT messages and conversations. Intercepts API responses to extract message creation times and renders them inline — no data leaves your browser.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages