Creating a work log

TIL
Bluesky
Work
Claude
Chris Albon’s helper script for logging everything you do
Author
Published

Last Updated on 2025-01-03

Just before Christmas 2024, Chris Albon of Wikimedia posted this on Bluesky about keeping track of his work by using a script to log his day:

Screenshot of a Blueksy post by Chris Albon of a script he uses for logging. "One thing I've noticed with AI is that the barrier to having lots of little helper scripts is wildy lower.  I keep a work log so its easy to talk about what I worked. This script lets me open the terminal and type "log talked to james" and have it logged/timestamped. Super easy."

Post by Chirs Albon on Bluesky, 2024-12-11, https://bsky.app/profile/chrisalbon.com/post/3ld24aoq4ik2p

He also posted a link to this 15 minute video called Don’t Do Invisible Work https://www.youtube.com/watch?v=HiF83i1OLOM in which he goes into details about why and how to keep a log. Key points I took away were:

Even if you are not someone who is comfortable with coding this seems like a very good idea. One could use a Word document, spreadsheet or even paper. Although I know habits take months to form or break so that is probably the biggest challenge (for me).

As I am really lazy, I asked Claude to recreate the shell script for me from the screengrab.

#!/bin/bash

# Function to log messages with timestamps
log() {
    # Define the path to your log file
    local log_file="$HOME/Documents/work_log.txt"

    # Get the current timestamp in ISO 8601 format
    local timestamp=$(date -u +"%Y-%m-%d")

    # Append the timestamp and message to the log file
    echo "$timestamp $*" >> "$log_file"

    # Print a confirmation message
    echo "Logged: $timestamp $*"
}

I work across Window and Linux operating systems, so a bash script works for me and on my Windows machine I use Gitbash. So once the script logger.sh is sourced in my home directory, I use it with the command log followed by whatever I want to log like so:

$ log added blog to my website

which records this to the work_log.txt file:

Logged: 2025-01-03 added blog to my website

Now all I have to do is actually form the habit of using it!

Back to top

Citation

BibTeX citation:
@online{bailey2025,
  author = {Bailey, Alistair},
  title = {Creating a Work Log},
  date = {2025-01-03},
  url = {https://ab604.uk/blog/2024-12-11-TIL/},
  langid = {en}
}
For attribution, please cite this work as:
Bailey, Alistair. 2025. “Creating a Work Log.” January 3, 2025. https://ab604.uk/blog/2024-12-11-TIL/.