I do something similar to your first approach just as I'm about to context switch (either because the day has ended or I have to work on something else).
I write a small summary of what I was doing and what were my next steps at the time, and I write this either directly in the code, in paper or sometimes in a text file. I call them ENDSNAPs (end snapshots).
Quiver is a startup developing a cloud storage platform, similar to Dropbox with additional protection and tracking over file usage. Quiver allows a user to share a file with other users and enforce various protections on it, such as a validation expiry date, read-only, geolocation based usage, etc...