def read_hook_version(path):
    """Read the hook version from the file."""
    with open(path, 'r') as f:
        f.readline()
        version_line = f.readline()
        if version_line.startswith('# THERAPIST'):
            try:
                return int(version_line.split()[3][1:])
            except IndexError:
                return 1
