At the decisive moment of the campaign against the city of Ai, God commands Joshua to perform an action that will turn the tide of battle and spring the trap set by the Israelites. He instructs Joshua to stretch out [ביאור שטיינזלץ] his long spear or javelin [רש״י, רד ק ומצודת ציון]. The primary approach among commentators is that extending the weapon toward the city served as a pre-arranged signal. It was meant to alert the ambush force, which was waiting in the southwestern corner of the city [מלבי״ם], to emerge from hiding and launch their raid. This gesture functioned as both a practical and symbolic marker for the troops [ביאור שטיינזלץ].
However, a logistical challenge arises regarding the ambush force's ability to actually see this signal. Given the vast distance, the chaos of the fleeing Israelites, the pursuing army of Ai, and the concealed position of the ambushers between Bethel and Ai, normal human vision could not have spotted the weapon. Because of this, Joshua's physical gesture takes on a miraculous and spiritual dimension. By stretching out his hand, Joshua channeled a divine flow and an inner awakening directly to the thirty thousand men waiting in the ambush. It was this spiritual prompting, rather than a visual cue, that caused them to leave their positions and charge the city at the exact right moment [אלשיך].