In a way the short answer is that this is what Archived Projects are for. Since I started using Agenda I’ve kind of settled on a stable hierarchy of about 6-7 categories of which 2 are large enough to have a few subcategories. Once projects are done (e.g. each major update of Agenda), I archive those and this way the sidebar in terms of complexity, structure and size pretty much stays stable.
As with everything it takes a bit of tweaking to find the right size and complexity of what works. In general my experience is also that it’s often better to stay light on the number of categories, subcategories and projects than to go too granular. The same is true for tags for example, it’s better to have a limited number of somewhat broader tags, than going to granular as you quickly end up with so many tags that it pretty much becomes useless.