Layered transition metal dichalcogenides are promising as lithium and/or sodium storage materials for lithium and sodium (Li/Na) ion batteries. However they always exhibit limited rate capability and long-term cycling stability, due to the fact that their 2D structures are easily restacking and agglomeration during cycling process and further result poor electrochemical reversibility. Herein, hierarchical Co1/3Mo2/3S2/graphene nanocomposites without CoSx and MoS2 impurities have been synthesized via one-pot solvothermal process. The incorporation of Co into MoS2 at atomic level can not only give rise to thinner and smaller nanosheets in the nanocomposites than MoS2/graphene nanocomposites, but also significantly decrease the size of in-situ formed MoS2/CoSx nanoparticles during electrochemical conversion process, which can greatly promoting the ion diffusion and suppressing the aggregation of active materials. Furthermore, the conductivity of Co1/3Mo2/3S2/graphene nanocomposites can be enhanced from 0.46 S m−1 (MoS2/graphene) to 1.39 S m−1 via changing the semiconducting MoS2 to metallic Co1/3Mo2/3S2. The simultaneously optimized electron conductivity and ions diffusion dynamics of Co1/3Mo2/3S2/graphene nanocomposites can effectively improve the reversibility of electrochemical conversion reactions. A capacity of 940 mAh g−1 and 529 mAh g−1 can be maintained at 3200th cycle (2 A g−1) in lithium-ion batteries and 200th cycle (1 A g−1) in sodium-ion batteries, respectively.