Dendritic and axonal arbors of many neuronal types exhibit self-avoidance, in which branches repel each other. In some cases, these neurites interact with those of neighboring neurons, a phenomenon called self/non-self discrimination. The functional roles of these processes remain unknown. In this study, we used retinal starburst amacrine cells (SACs), critical components of a direction-selective circuit, to address this issue. In SACs, both processes are mediated by the gamma-protocadherins (Pcdhgs), a family of 22 recognition molecules. We manipulated Pcdhg expression in SACs and recorded from them and their targets, direction-selective ganglion cells (DSGCs). SACs form autapses when self-avoidance is disrupted and fail to form connections with other SACs when self/non-self discrimination is perturbed. Pcdhgs are also required to prune connections between closely spaced SACs. These alterations degrade the direction selectivity of DSGCs. Thus, self-avoidance, self/non-self discrimination, and synapse elimination are essential for proper function of a circuit that computes directional motion.