A cost code system is a numbering system that is typically associated with a WBS. For example, a higher level of item of a WBS has a cost code of 1. An item beneath the previous item in the WBS has a cost code of 1.1. An item beneath that item in the WBS (usually this item is the leaf) has a cost code of 1.1.1. Leaf items are usually associated with bills/invoices.
As mentioned earlier, leaf cost codes are associated with invoices, thus adding all the costs of each cost code at the leaf level will result in knowing the total cost of the project.