The mammalian cortex is a laminar structure containing many areas and cell types that are densely interconnected in complex ways, and for which generalizable principles of organization remain mostly unknown. Here we describe a major expansion of the Allen Mouse Brain Connectivity Atlas resource1, involving around a thousand new tracer experiments in the cortex and its main satellite structure, the thalamus. We used Cre driver lines (mice expressing Cre recombinase) to comprehensively and selectively label brain-wide connections by layer and class of projection neuron. Through observations of axon termination patterns, we have derived a set of generalized anatomical rules to describe corticocortical, thalamocortical and corticothalamic projections. We have built a model to assign connection patterns between areas as either feedforward or feedback, and generated testable predictions of hierarchical positions for individual cortical and thalamic areas and for cortical network modules. Our results show that cell-class-specific connections are organized in a shallow hierarchy within the mouse corticothalamic network.