How do I deal with students being unkind to each other when I'm not there? The faculty and students at my small minority-serving institution think of our environment as being supportive and cooperative. This is very important in CS, since programming is a team sport, and students are expected to seek help from each other (and TAs and me).

I have heard recently from two unconnected students about other students ignoring or being rude to them (such as walking away mid-question). The complainants don't give names, and I have no idea who they're talking about. 

Almost all of the students in our program belong to at least one demographic underrepresented in CS and/or in the US. The students who have been mistreated belong to multiple such demographics and think that may be a factor. I have no way of knowing if they're right. Each is the only student of their cohort in their demographic.

What can I do to encourage students to better treat classmates? Some have been at the institution much longer than others. The ones who feel mistreated are newer arrivals. While my top goal would be changing students' behavior, we all know it isn't always possible to get people to change. If I can't get people to change, how can I know who should deserve bad citizenship grades or to not get letters of recommendation? I am not interested in furthering the careers of people who mistreat others.
I have a couple thoughts of how I'd handle it:


Address it with the bad actors 1-on-1, but don't assume bad faith. We might not know the whole story and there might have been a good reason to walk away from a situation or it is possible that the bad actor has poor social skills. Give them the benefit of the doubt, but explain why that kind of behavior creates a hostile environment that is not good for education.
Discuss in class what makes for a good working/learning environment. Not necessarily directly mentioning the situation, you can still emphasize a need for students to take agency in being part of a nurturing environment. I haven't had the exact same circumstances, but I have found it helpful by acknowledging that most jobs require interpersonal skills and that I've known even talented developers who have been passed up for good jobs because no one wanted to put up with their attitudes. In that same notion, I tell my software engineering students that I expect them to behave like professionals and like the class is a part-time job. That includes treating others with respect, even if they don't consider each other friends.


If you find it is a continuing problem, you might consider working into your assessment plan some way (even as a small percentage of the overall grade) to evaluate individuals' professionalism in-and-out of the classroom.