When subjected to fires, cementitious composites can be seriously damaged. However, the mechanical behavior of nanoscale calcium silicate hydrate (C–S–H) grains, which are the main binder of cementitious composites, exposed to elevated temperatures under shear deformations remain poorly investigated. In this paper, considering different calcium/silicate (C/S) molar ratios (i.e., C/S = 1.10, 1.33, and 1.64), the shear behavior of the C–S–H grain after exposure to different high-temperature levels (i.e., 300 K, 500 K, 700 K, 900 K, and 1000 K) is studied by conducting series of reactive molecular dynamics simulations. Results reveal that the C–S–H grain exhibits good plasticity under shear deformation. Furthermore, the shear modulus of the C–S–H grain is between 14 GPa and 17 GPa and exhibits a decrease with the calcium/silicon (C/S) molar ratio at ambient temperature. While the shear strength is around 1.0 GPa and reaches the lowest value at C/S = 1.64. Interestingly, we report that heating can lead to the increase of the shear modulus and shear strength due to the sevaporation of the interlayer water which generally acts as the lubricant. Additionally, we show that heating has no clear influence on the shear strain corresponding to the onset of yielding when the C/S ratio is high but can indeed improve the shear strain corresponding to the shear strength. Furthermore, the yielding area of the C–S–H grain under the shear deformation can be enlarged. Finally, factors affecting the strength degradation of cementitious composites after being heated to different temperature levels are further discussed based on the simulation results.