Unsupervised classification is a very common problem in pattern recognition even when the classes are known. In many areas intra-class variations may be greater than the inter-class variations causing a need for a subdivision of the training set of a class into smaller subunits often referred to as clusters. The subdivision or clustering is often performed independently of the relative properties of the other present classes in the recognition task. This paper presents a novel class-dependent approach to the clustering problem. Experiments with online handwriting data show that the novel clustering approach CDCR produces a clustering better suited for the task of pattern recognition. Although only validated for two recognition methods in this paper, the same approach could be applied to other methods as well as to other pattern recognition problems.