Skip to content
TimeMole
How it works Features Privacy Pricing Join the macOS beta
Guide

Knows what your terminal was doing

macOS can't tell what happens inside a terminal window. A small shell hook fixes that — installed with one click, also inside tmux.

The problem

TimeMole builds your timeline from the app in front and its window title. For most apps that is plenty: the document, the tab, the project. A terminal gives away nothing — Terminal.app reports “Terminal”, iTerm2 reports “-zsh”, Alacritty reports “Alacritty”. Three hours of work on two clients' repositories look exactly the same.

The fix

The shell knows what it is doing, so let it say so. A tiny zsh hook writes the working directory and the running command into the window title, which TimeMole already captures. Your timeline then reads

Your timeline
~/acme-api — npm test
~/clients/bakery-site — git push
~/acme-api — claude

instead of “Terminal”. Time spent in an AI coding tool such as Claude Code or Codex gets an AI badge, so you can tell AI-driven time from hand-worked time in the same project.

One click

  1. Open TimeMole's Settings from the menu bar.
  2. In the Terminal section, click Install.
  3. Open a new terminal window.

That's it. The section shows what is in place — the zsh hook, and the tmux snippet when tmux is installed on your Mac. Remove takes it all out again.

What gets written

Two scripts land in ~/.timetracker/shell/, next to TimeMole's own data, and one guarded line each goes to the end of ~/.zshrc and ~/.tmux.conf:

~/.zshrc
# TimeMole terminal integration (managed in TimeMole → Settings → Terminal)
[ -f "$HOME/.timetracker/shell/terminal-title.zsh" ] && source "$HOME/.timetracker/shell/terminal-title.zsh"
~/.tmux.conf
# TimeMole terminal integration (managed in TimeMole → Settings → Terminal)
source-file -q "$HOME/.timetracker/shell/terminal-title.tmux.conf"

Guarded means: if the scripts are ever gone, the lines do nothing. No error on every new shell, no leftovers that bite. TimeMole refreshes the scripts whenever it starts, so an update of the app reaches your shell without touching the rc files again. Everything else in those files stays exactly as it was — the app only appends its two lines and only ever removes those two lines.

If your dotfiles already source the scripts yourself (say, from a checkout of the repository), TimeMole notices and leaves your setup alone.

Inside tmux

tmux owns the terminal title and rewrites it, so the shell hook alone would leave you with “Alacritty — tmux”. The second snippet lets tmux set the title from the active pane instead: session, directory and command, updated about once a second. Your blocks then read like tmux:main acme-api — nvim.

The command name still comes from the zsh hook, not from tmux. tmux reports the kernel's truncated process name, which turns Claude Code into “2_1_198” and Codex into “codex-aarch64-a”; the hook passes the real name through, so the AI badge works in tmux too. A running tmux server picks the snippet up right away; new servers read it from the config.

What it does not do

  • It does not read your keystrokes. The hook puts the command line into the title as you launch it — program and arguments, nothing of what happens afterwards — and TimeMole samples that title every few seconds, like any other window's.
  • It does not leave your Mac. Like everything TimeMole captures, terminal titles stay in the local database.
  • It does not support other shells yet. The hook is written for zsh, the default shell on macOS; if your login shell is bash or fish, the Install button tells you so.

By hand

Prefer to keep this in your own dotfiles? Click Install once, copy the two scripts out of ~/.timetracker/shell/, click Remove, and source your copies from wherever you keep them. The app recognizes a hand-written line and shows it as set up.

TimeMole
Product Features Privacy Pricing
Guides Terminal setup AI setup
Company Contact Impressum Datenschutz

© 2026 RODEIN GmbH · Made in Germany · No cookies, no trackers, no analytics — your hours are none of our business.