Midgard uses code snippets and snippetdirs for handling library-like code in a format that enables sharing the code between hosts. Code snippets are stored in snippetdir tree hierarchies within the Midgard database.