My understanding of the general legal principle of "tools of the trade" is that tools which are necessary for the exercise of a profession are the inviolate property of the tradesman and cannot be taken away from him either by bankruptcy or by employer or by the state or by anyone else. A tradesman has absolute ownership over tools necessary to conduct his trade.
For example, imagine a machinist makes a clamp at his workplace. Even if he uses company materials and time to make the clamp, the machinist still owns the clamp, because it is a generic tool, not a workpiece. If he leaves and goes to work for a different company he can take the clamp with him and he owns it forever. That is my interpretation of the "tools of the trade" principle. This would not apply to a special tool only usable at a particular employer. For example, if the tool would only work on one employers specific machine, then it is not a "tool of the trade", because it is not generic.
My question is whether this principle applies to software as well. For example, lets imagine a programmer writes a sorting algorithm. Such an algorithm is generic and can be used at any employer. Does the programmer have the right to retain and use that sorting algorithm while working for other employers because it is a "tool of the trade"?