ABSTRACT In the practical application, such as military, logistics or drone control, in order to meet the mission needs, the scale of multi-agent systems is constantly expanding, and the number of leaders required to implement control is increasing. In containment control, it has some difficulties in forming convex hulls by traditional control methods to achieve ideal control purposes. We propose a method that is more suitable and effective for large-scale networks to achieve containment control here. In this paper, a controllable containment control algorithm based on hierarchical clustering for multi-agent systems is proposed by combining the topology optimisation theory and complex network controllability theory. First, the multi-agent network is divided into several communities according to the hierarchical clustering algorithm. Then the maximum matching algorithm of bipartite graph is used to determine the minimum leader set satisfying the network controllability. Second, the corresponding control protocols are designed for the agents, and a position adjustment control force is introduced to adjust the motion of individuals that are located outside the convex hull in the process of containment among the communities. Therefore, when achieving and maintaining the controllable containment control within the community, the controllable containment control among the communities can be achieved effectively through the proposed algorithm. Finally, some simulation examples are presented to demonstrate the effectiveness of the theoretical results.