First off the palette, to customize it to your needs you should look at the
paletteProvider inside the palette module. There you can add and remove the palette entries that you wish for.
With spanner tool, I guess you're referring to the
replace menu. You can check it's module and inside you'll find a
BpmnReplace.js file that takes care of the logic behind the actual replacement of bpmn elements and you'll find a
ReplaceOptions.js, which carries with it which options should be shown when it is opened for the selected shape.