Tom forces Jim to make a coat of arms before he can escape.
Although Tom’s appearance usually adds a bit of humor, his shenanigans with Jim are not fun and games. He tries to make an adventure out of rescuing Jim, rather than really wanting to help him. He drags the process out with ridiculous embellishments as Jim remains trapped.
The coat of arms is particularly ridiculous. Because “there warn't no case of a state prisoner not scrabbling his inscription to leave behind, and his coat of arms” (Ch. 38), Tom decides Jim has to leave one. Jim thinks he is talking about a real coat. He has no idea what Tom is talking about, but he goes along with it and all of Tom’s other foolery.
So whilst me and Jim filed away at the pens on a brickbat apiece, Jim a-making his'n out of the brass and I making mine out of the spoon, Tom set to work to think out the coat of arms. (Ch. 38)
Tom decides it has to have a Latin inscription and writes several examples of a “mournful inscription” for Jim to choose from, then decides Jim must do them all. Jim complains that it will take forever to scratch all of that writing into the logs with a nail, especially since he can’t read or write. Tom says logs won’t do anyway, they must use a rock.
The most absurd part of the whole thing is when the two boys attempt to get the huge grindstone but can’t carry it, so they break Jim out of the “prison” so he can help carry it (while Tom “superintends”), just so he can properly leave his prisoner coat of arms and mournful inscription so he can escape.
The whole time, this is all just a game to Tom. He is having fun, and doesn’t realize he is being cruel. Jim is free, and Tom knows it. Instead of telling anyone, he uses Jim (and Huck) for his own amusement. This demonstrates the lack of morality in regular society toward slaves.