The differential cross section for inclusive particle production as a function of energy in proton-proton collisions at a center-of-mass energy of 13 TeV is measured in the very forward region of the CMS detector. The measurement is based on data collected with the CMS apparatus at the LHC, and corresponds to an integrated luminosity of 0.34 mu b(-1). The energy is measured in the CASTOR calorimeter, which covers the pseudorapidity region -6.6 < eta < -5.2. The results are given as a function of the total energy deposited in CASTOR, as well as of its electromagnetic and hadronic components. The spectra are sensitive to the modeling of multiparton interactions in pp collisions, and provide new constraints for hadronic interaction models used in collider and in high energy cosmic ray physics.