actually, you are asking the wrong question... the legislative branch consists of the senate and house of representatives, and the judicial branch is the federal court system (sadly, also grossly perverted in its present form)... the executive branch is where most of the problems are, with the blessings of the legislative and judicial branches..
agencies are, to the last one, part of the executive branch.. the defense department (formerly war department), treasury, and state department are all specifically noted in the Constitution... the departments of education, housing and urban development, agriculture, commerce, labor, and energy are all either misplaced or functions the federal government has no business in... the Constitution tells us that the powers of the federal government are few and well defined, and that powers not specifically mentioned in the Constitution are reserved to the states...
the military is a valid part of the executive branch, and should include all foreign intelligence gathering organizations.. the departments of homeland security and veterans affairs.. the state department should be the single body that deals with all nonmilitary matters involving foreign nations.. the treasury is in charge of currency, managing money for the government, collecting taxes, duties, and other funds, and running the postal system.. the justice department is for federal law enforcement--it too, is legit..
there are valid arguments for a department to handle all non-law enforcement functions within the nation.. infrastructure is certainly a public good.. federal land, including monuments and landmarks, must be managed.. the departments of interior, commerce, energy, and transportation should be rolled into one, far leaner, department...
we are left with the departments of housing and urban development, health and human services, and education.. these should be eliminated entirely... the epa also gets a chair at cabinet meetings, and at this table of illegitimacy as well, and should be eliminated.. there is one possible exception to the above list, and that would be health... in this day and age, i believe that the ability to fight off an epidemic is necissary, and because of what that might entail, should be a federal function... there should never be any department so perverted as to lable itself "human services," though.
thats just the cabinet... there are, sadly, many, many more agencies and organizations out there that cause more harm than good.. here is the true test--does an agency serve each and every American?? if the answer is no, it is unconstitutional, and must be eliminated..
the US Constitution is an amazingly short and concise document, and has the added bonus of being widely available for not much money.. the copy i keep on my computer desk cost me about 3 bucks, and contains the Constitution, the Amendments, the Articles of Confederation, and the Declaration of Independence.. there are many other writings from the time of this nations founding, which make crystal clear the meaning of most, if not all nonexact wording.. the federalist papers, and the antifederalist are chief among them.. for example, you will find that "general welfare" has nothing to do whatsoever with transfer payments.. in fact, transfer payments are repeatedly attacked by our founders..
take a couple hours and read the Constitution and some other founding documents, and if you have more time, read more.. if nothing else, you will gain a better understanding of hsitory and the intended government this nation was given, and the perversion it has become...