Record commands on crash