Context. We present the COld STream finder Algorithm (COSTA), a novel algorithm used to search for cold kinematical substructures in the phase space of planetary nebulae (PNe) and globular clusters (GCs) in the halos of massive galaxies and intracluster regions. Aims. The aim of COSTA is to detect small, low-velocity-dispersion streams, such as the ones produced in recent interactions of dwarf galaxies with the halos of more massive galaxies, including the ones sitting in the central regions of rich galaxy clusters. Methods. We based COSTA on a deep friend-of-friend procedure that isolates groups of N particles with low velocity dispersion (between 10 km s−1 and ∼100 km s−1) using an iterative (n) sigma-clipping on a defined number of (k) neighbor particles. The algorithm has three parameters (k − n − N), plus a velocity dispersion cut-off that defines the “coldness” of the stream, which are set using Monte Carlo realizations of the sample in question. Results. In this paper, we show the ability of COSTA to recover simulated streams on mock datasets of discrete kinematical tracers of different sizes and measurement errors, from publicly available hydrodynamical simulations. We also show the best algorithm setup for realistically locating streams in the core of the Fornax cluster, for future applications of COSTA to real populations of PNe and GCs. Conclusions. Finally, COSTA can be adapted to many situations in finding small substructures in the phase space of a limited sample of discrete tracers, provided that the algorithm is trained on realistic mock observations reproducing the specific dataset under examination.