A surgical stapling instrument includes a handle assembly, an elongate shaft extending distally from the handle assembly, and a tool assembly coupled to a distal end of the elongate shaft. The tool assembly includes a cartridge assembly including a plurality of surgical staples each including a code embedded portion and a first sensor for detecting the position of the surgical staples prior to and during a formation of the staples. The tool assembly further includes an anvil assembly including a second sensor that detects the position of the surgical staples after the formation of the surgical staples.