The background story of this Koan
Basho said to his disciple: "When you have a staff, I will give it to you. If you have no staff, I will take it away from you."
This staff is meant to be the leg of the Buddha, that helps people to come to enlightenment. The staff is even meant to be identical with Buddhas enlightenment.
But enlightenment has no meaning at all. If you think you enlightened, I'll give you more of the same. If you think you're not enlightened I take even this thinking away.
In both cases, what are you after giving and taking?
This Koan is typical in how enlightenment was defined in China, although there's nothing to define.
Don't think about it, just walk your way, with or without a staff, it doesn't matter.
Traditional Commentaries and .... Poems (Gata)
When there is no bridge over the creek the staff will help me.
When I return home on a moonless night the staff will accompany me.
But if you call this a staff, you will enter hell like an arrow.
It helps fording across the river of the broken bridge.
It’s my companion returning to the moonless village.
If you call it or take it for a crutch you enter hell like an arrow.