Leave it in a small pet container (or make something similar) and let it cocoon itself. Shortly, a beautiful butterfly dinner will emerge. Most caterpillars will only eat the leaves from the tree it was taken from. Feed those if available or known, until it cocoons. It should start soon, due to fall. Good luck.