Abstract The direct-fitness approach to modelling the evolution of social traits is an alternative to the classical inclusive-fitness-based approach. Despite both its utility and popularity, the direct-fitness approach has not yet been extended to include the analysis of dynamic traits, i.e. traits whose level of expression may vary over time. In this article, I apply the direct-fitness approach to cope with the evolution of a dynamic resource-allocation behaviour when this behaviour influences the fitness of relatives. I am able to implement the direct-fitness approach using components (reproductive value, fitness changes and measures of relatedness) found in standard, social-evolutionary models. I illustrate the modified direct-fitness model with an example studied by previous authors, and I show how the direct-fitness perspective can aid the validation of analytical results by means of a genetic algorithm.