Trace your steps back. Find chunks of me. Do try to be smart

Railway Riddles: Trace your steps back. Find chunks of me. Do try to be smart. I go on forever, but the last safe holds my start. Though I’m infinite, there’s only space here for four. Find the chunk that would follow next to open this locked door

Solution: The correct answer is 2384

If you have an idea, you can write as a comment.