We study a new type of extended theory of gravity in the framework of general scalar–tensor theories in which the higher order terms of curvature are coupled with a scalar field and its derivatives. We analyze the stability and evolution of cosmological perturbations in this setup. For this purpose, we perturb the Hubble parameter, matter density, and scalar field to check stability and evolution of perturbations to first order. In this framework, we investigate stability conditions for de Sitter and power law solutions and we examine viability of cosmological evolution of these perturbations. We consider some specific f(R) models and show that the stability analysis gives some constraints on the parameters of these models.