While the first few months after a stroke are crucial for recovery1, the role of diet in cognitive rehabilitation for stroke survivors during the sub-acute phase remains underexplored. We aimed to evaluate the associations between energy and macronutrient intake and post-stroke cognition, as well as potential mediating pathways linking dietary fibre and post-stroke cognition via the gut microbiota. Cross-sectional data were drawn from the PISCES-ZODIAC trial2, which enrolled ischemic stroke survivors with no cognitive disability two months after stroke onset. Energy and macronutrient intakes (carbohydrate, protein, fat, saturated fat, fibre, and added sugar) were assessed using a 3-day food diary. Adequacy of macronutrient intake was defined according to the Australian Dietary Guidelines3. Global cognition was measured using the Alzheimer’s Disease Assessment Scale–Cognition subscale (ADAS-Cog), with lower scores indicating better cognition. Associations between diet and cognition were examined using age‐adjusted linear regression. Gut microbial communities were profiled using full 16S rRNA sequencing, with alpha diversity (Shannon index) and beta diversity (Bray-Curtis dissimilarity) assessed at the genus level. Associations between alpha diversity, dietary fibre, and cognitive scores were assessed using standardised linear regression, adjusted for age, sex, and BMI. Multivariable linear modelling (MaAsLin3) was used to identify taxa (at both genus and species levels) that were differentially abundant and independently associated with fibre intake and cognition, controlling for host covariates (q cut-off <0.1). Fifty‐two participants (61% male, mean age: 63±15 years) were included. Overall, higher energy intake (kcal/kg body weight) was associated with better cognition (β: -0.16; 95% CI: -0.32, -0.01, p = 0.038), while protein intake (g/kg body weight) was not associated with cognition (β: -3.23; 95% CI: -6.56, 0.10, p = 0.056). Stratified analyses indicated that both energy and protein intakes were positively associated with cognition only among non‐obese participants. Additionally, participants who met the adequate intake for fibre (Females: ≥ 25 g/day; Males: ≥ 30 g/day) had lower ADAS-Cog scores (β: -5.58; 95% CI: -9.21, -1.96, p = 0.003). The other macronutrients were not associated with cognition. The total of 43 participants had microbiome data. Shannon diversity was significantly associated with ADAS-Cog scores (β: -0.39 SD per SD of ADAS-Cog, 95% CI: -0.68, -0.09, p = 0.011) but not with fibre intake. Bray-Curtis dissimilarity showed different microbial community compositions across ADAS-Cog score and fibre intake, with R² = 5.3% (p < 0.001) and R² = 4.2% (p = 0.019), respectively. Higher fibre intake and lower ADAS-Cog score were both associated with depletion of the unclassified species, Blautia_A sp003471165. These exploratory findings suggest that the positive association between energy and protein consumption and post-stroke cognition depends on obesity status, whereas adequate fibre intake, potentially through changes in the gut microbiota, is associated with better cognition in stroke survivors.