Record commands for later analysis