This is such a fun project! It seems that the model is a bit confused about $_, which I find pretty interesting:
simedw@laptop:~$ pwd
/home/simedw
simedw@laptop:~$ mkdir -p foo/bar/baz
simedw@laptop:~$ cd $_
cd foo
simedw@laptop:~/foo$ cd baz
simedw@laptop:~/foo/bar$ pwd
/home/simedw/foo/bar
simedw@laptop:~/foo/bar$ cd baz
simedw@laptop:~/foo/bar/baz$