Erica Chamblee, second from left, with Thomas W. Jones II, Jennifer Mendenhall and Paul Morella in “Cherokee” at Woolly Mammoth Theatre Company. (Stan Barouh)

In a scene from the play “Cherokee” at Woolly Mammoth Theatre Company, a white couple learn that a Native American local they’ve befriended at a campsite sounds a little more “native” when he’s talking to them than he does when he talks with their black friends.

Janine: You used one voice with Traci and another with us?

Traci: (To Janine, intentionally using a “blacker” dialect.) It’s called code-switching, baby. You get good at it.

Erica Chamblee, the actress who plays Traci, has been “code-switching” since she was a child. She just didn’t know there was a name for it. For showing up linguistically different in different places with different people, depending on what the situation calls for. (NPR calls its nimble squad of journalists who deal with race and culture its “Code Switch Team.”)

“I freely switch up,” says Chamblee, a District native who attended the Duke Ellington School of the Arts, Beauvoir and National Cathedral School. “It’s part of our identities and it’s very nuanced. It can make people uncomfortable to even think that you’re behaving differently or thinking differently.”

It’s a skill that often gets honed in discomfort. Sounding white in black places can get you bullied. Sounding black in white places can make you feel alienated and unheard. You learn to do as the Romans do. It’s something many of us can relate to.

Last week, I desperately needed a locksmith. I thumbed through the phone book. I found a guy with an Italian-sounding last name. I called him and let all traces of black accent fall from my voice. I raised my pitch, folksied-up my phrasing. “Hey there, I’m really hoping you can help me.” It’s the same thing I do when I’m on the phone with a customer service rep, a handyman from Sears or a guy at Mr. Tire. If they sound white, then I do, too.

It’s not an affectation — well, except that time I got myself invited to a South Carolina state senator’s house to see his Confederate flag. I Meryl Streep code-switched that time.

But typically, it’s a split-second shift. If we’re unpacking it, the calculation goes like this: I urgently needed a locksmith, and wanted one who was predisposed to helping me and charging a fair price. I had no indication that Mr. Italian Locksmith wouldn’t do that if he thought I was black. But this country has a tortured racial history, research on implicit bias (the kind folks aren’t even aware they have) abounds, and I’ve been around the block a few times and have seen these kinds of transactions go bad because of small misunderstandings. Whether he’d be fair doesn’t matter if I take race off the table.

“At a deeper historical level, it’s survival,” says Kumea Shorter-Gooden, co-author of “Shifting: The Double Lives of Black Women in America” and chief diversity officer at the University of Maryland. People who have less power (women in male-dominated situations, people of color in a predominantly white culture) have had to be able to quickly read situations to figure out: How do I manage? How do I maneuver to get what I need out of this situation that wasn’t set up for me in the first place?

It mostly has been a one-way process. Whites haven’t had to communicate using black lingo or idioms, and that’s why it sometimes sounds forced and offensive if they try.

But the comfort blacks feel while code-switching varies as well. In her research, Shorter-Gooden found that some women felt phony and anxious about their shifting. Recently, minority students from Bethesda-Chevy Chase High School made a YouTube video, “I, Too, Am B-CC”, about their constant negotiations around race and identity. As one black girl talked about feeling pressured to dress or talk white to fit in, she started to cry.

I felt for that girl. I wanted to tell her it gets better. That if you’re lucky, you don’t lose yourself in the switch. You take the best parts of whatever world you’re in to all the places you will go. That, as the character Traci notes, you get good at it.

And if you’re super lucky, you get a locksmith who likes black people.

For more by O’Neal, visit wapo.st/lonnae.