Need advice on caterpillar enclosure

I found a caterpillar on my jacket at a train station earlier today and put it in a small temporary container (roughly 10x15x4cm) with some dirt (about 2cm deep) a couple small twigs, and some dried leaves. the caterpillar has now burrowed under the dirt and i think it’s pupating, and i need advice on how to set up an enclosure without moving it out of this small container (i haven’t done this before so please don’t spare any basic details you might think are obvious and feel free to ask any questions)

Welcome to the iNat Forum, Malachi!

Check out these tips from @ceiseman: https://www.birdsofiowa.org/bugrearing

That’s copied from a page on my website, which maybe has been updated a bit since it was copied: https://bugtracks.wordpress.com/rearing/

I think you could just leave it there, do make sure it gets all it needs. I used to raise multiple generations of Monarchs in a similar enclosure so I believe this could be fine.

how should i make sure it’s properly able to emerge when it’s done pupating? if i just get a pop up butterfly enclosure will it be able to climb up or do i need to put some sticks in the dirt for it to climb up

What I used to do was to gently take the butterfly/moth outside the enclosure. Do be very careful when doing so and try to make it climb into your hand/finger instead of picking it up yourself.