Type 2 diabetes is increasing in Kenya, especially in urban settings, and prevention interventions based on local evidence and context are urgently needed. Therefore, this study aimed to explore diabetes risk and co-create a diabetes prevention theory of change in two socioeconomically distinct communities to inform future diabetes prevention interventions. In-depth interviews were conducted with middle-aged residents in two communities in Nairobi (one low-income (n = 15), one middle-income (n = 14)), and thematically analysed. The theory of change for diabetes prevention was informed by analysis of the in-depth interviews and the Behaviour Change Wheel framework, and reviewed by a sub-set (n = 13) of interviewees. The key factors that influenced diabetes preventive practices in both communities included knowledge and skills for diabetes prevention, understanding of the benefits/consequences of (un)healthy lifestyle, social influences (e.g., upbringing, societal perceptions), and environmental contexts (e.g., access to (un)healthy foods and physical activity facilities). The proposed strategies for diabetes prevention included: increasing knowledge and understanding about diabetes risk and preventive measures particularly in the low-income community; supporting lifestyle modification (e.g., upskilling, goal setting, action planning) in both communities; identifying people at high risk of diabetes through screening in both communities; and creating social and physical environments for lifestyle modification (e.g., positive social influences on healthy living, access to healthy foods and physical activity infrastructure) particularly in the low-income community. Residents from both communities agreed that the strategies were broadly feasible for diabetes prevention but proposed the addition of door-to-door campaigns and community theatre for health education. However, residents from the low-income community were concerned about the lack of government prioritisation for implementing population-level interventions, e.g., improving access to healthy foods and physical activity facilities/infrastructure. Diabetes prevention initiatives in Kenya should involve multicomponent interventions for lifestyle modification including increasing education and upskilling at individual level; promoting social and physical environments that support healthy living at population level; and are particularly needed in low-income communities.