Recording CIRCLE_SHA1 on checkout

nodejs
circle.yml

#1

Could someone explain why it would be beneficial to record the CIRCLE_SHA1 when checking out the code from Github and cache it?

version: 2
  jobs:
    checkout_code:
       docker:
          - image: circleci/node:latest
       working_directory: ~/my-project
       steps:
         - checkout
         - attach_workspace:
             at: ~/my-project
         - run: echo $CIRCLE_SHA1 > .circle-sha
         - save_cache:
             key: v1-repo-{{ .Branch }}-{{ checksum ".circle-sha" }}
             paths: .circle-sha
         - persist_to_workspace:
             root: .
             paths: .

#2