CLC-2 is a hyperpolarization-activated, inwardly rectifying chloride channel. Although the properties of the CLC-2 channel have been well characterized, its function in vivo is not well understood. We have found that channels encoded by the Caenorhabditis elegans CLC-2 homolog clh-3 regulate the activity of the spontaneously active hermaphrodite-specific neurons (HSNs), which control the egg-laying behavior. We identified a gain-of-function mutation in clh-3 that increases channel activity. This mutation inhibits egg laying and inhibits HSN activity by decreasing its excitability. Conversely, loss-of-function mutations in clh-3 lead to misregulated egg laying and an increase in HSN excitability, indicating that these channels modulate egg laying by limiting HSN excitability. clh-3-encoded channels are not required for GABAA-receptor-mediated inhibition of the HSN. However, they require low intracellular chloride for HSN inhibition, indicating that they inhibit excitability directly by mediating chloride influx. This mechanism of CLH-3-dependent modulation may be conserved in other neurons in which the driving force favors chloride influx.