A cost code is the address for a dollar of job cost. Most contractors combine a work breakdown (often based on CSI MasterFormat divisions, like 03 Concrete or 26 Electrical) with a cost type (labor, material, equipment, subcontract, other). The estimate is loaded into those codes as the original budget, and every timecard, invoice and commitment is coded against them.
The goal is comparison: budget versus actual versus forecast, code by code. That only works if the same codes mean the same thing across jobs and if people in the field can code correctly without a lookup table. Too many codes and time gets miscoded; too few and you cannot see where the job is bleeding.
Budgets change. Approved change orders add budget, and transfers between codes (from contingency, or from a code that came in under) should be recorded as budget changes, not hidden by coding cost to wherever there is room. The revised budget is original plus approved changes, and it is what cost-to-complete is measured against.
If you can answer "what did we spend on rebar on this job, and what did we think we would spend?" in under a minute, your cost code structure is doing its job.