Micro-Spec is a direct-detection spectrometer which integrates all the components of a diffraction-grating spectrometer onto a ≈10-cm2 chip through the use of superconducting microstrip transmission lines on a single-crystal silicon substrate. The second generation of Micro-Spec is being designed to operate with a spectral resolution of at least 512 in the far-infrared and submillimeter (420–540 GHz, 714–555 μm) wavelength range, a band of interest for NASA's experiment for cryogenic large-aperture intensity mapping called EXCLAIM. EXCLAIM will be a balloon-borne telescope that is being designed to map the emission of redshifted carbon monoxide and singly-ionized carbon lines over a redshift range 0<z<3.5 and it will be the first demonstration of the Micro-Spec technology in a space-like environment. This work reviews the status of the Micro-Spec design for the EXCLAIM telescope, with emphasis on the spectrometer's two-dimensional diffractive region, through which light of different wavelengths is focused on kinetic inductance detectors along the instrument focal plane. An optimization process is used to generate a geometrical configuration of the diffractive region that satisfies specific requirements on size, operating spectral range and performance. An initial optical design optimized for EXCLAIM is presented in terms of geometric layout, spectral purity and efficiency.