“Joshua and all the fighting men set out to go up against Ai. Joshua chose thirty thousand warriors. He sent them out by night, with the command. ‘You shall lie in ambush against the city, behind it. Do not go very far from the city, but all of you stay alert. I and all the people who are with me will approach the city. When they come out against us like before, we shall flee from them. They will come out after us until we have drawn them away from the city. They will say. ‘They are fleeing from us, as before.’ While we flee from them, you shall rise up from the ambush and seize the city. Yahweh your God will give it into your hand. When you have taken the city, you shall set the city on fire, doing as Yahweh has ordered. See, I have commanded you.’”
This is a great plan. Get the people of Ai out of the city and then burn it from the backside. The Israelites with Joshua will pretend to be defeated like the first time and start to flee. In the meantime, 30,000 troops from the back of the town will enter the city, seize it, and burn it.
“So Joshua sent them out. They went to the place of the ambush. They were between Bethel and Ai, to the west of Ai. But Joshua spent that night in the camp. In the morning, Joshua arose early. He mustered the people. He went up, with the elders of Israel, before the people to Ai. All the fighting men who were with him went up. They drew near before the city. They camped on the north side of Ai with a ravine between them and Ai. Taking about five thousand men, he set them in ambush between Bethel and Ai, to the west of the city. So they stationed the forces, the main encampment that was north of the city and its rear guard west of the city. But Joshua spent that night in the valley.”
The plan seems to be working without any divine intervention, since there is no mention of the Ark of the Covenant or the Levite priests, just old fashioned warfare tactics. The Israelites seem to be on the west and north side of the city of Ai.