Peering over my shoulder from the backseat, Hodge asks why the name Ryda Gang is written in my notebook. I tell him that I watched a couple of Ryda Gang videos on YouTube. In one of them, a group of young men are parked outside the Cabrini row houses as they film themselves in a black minivan at night. “Curfew time!” someone yells out, as others appear along the narrow strip, Hodge among them. A person from the van announces into the camera that he’s affiliated with the Black Disciples. Another one, describing himself as a gang veteran, zeroes in on the five blue-light surveillance cameras that surround the block, detailing for anyone with an Internet connection his plans to cut the wires on one of them. Apparently he doesn’t like to be watched.

“Ryda Gang is a gang gang,” Hodge says, stressing each word as if willing me to comprehend. “WildEnd is a music group.” But as the fate of Lil JoJo shows, on the Internet especially it’s hard to differentiate between the two. Hodge may have taken at least one lesson from that tragedy. When a minor online kerfuffle seemed to be brewing between Yung Killa and Chief Keef, the WildEnd guys were quick to squash it. Hodge got right in touch with Cozart—by phone.

The headquarters of the Chicago police department is on the South Side, a couple of blocks from where the White Sox play and not far from where the Robert Taylor Homes, once the country’s largest housing project, stood until they were torn down nearly a decade ago. On the day I visit the station, 20 recruits who have just completed their training line up in front of a mural of the neighborhood, preparing to be sworn in for duty. I sit down in a folding chair near Kevin Ryan, commander of the gang enforcement unit, and Ken Boudreau, a 27-year department veteran who runs the gang unit’s school-safety team. Over his protruding belly, Boudreau wears a worn bulletproof vest, its Velcro straps frayed and discolored. On the seat beside him, he places a BlackBerry and a second phone, each emitting constant chirps.

Ryan, in a brown pin-striped suit and trim mustache, takes an iPad from his briefcase. He’s reluctant to talk too specifically about the methods they use to monitor the online activity of gangbangers, for fear of limiting his capabilities. But he assures me that I could figure out most of it just by tooling around with a few search terms. On his iPad, he types “CPDK,” for Chicago Police Department Killers, and shows me the string of results on YouTube, guys crowing in each video about their desire to kill cops.

Gang enforcement officers in Chicago started looking closely at social media sites about three years ago, after learning that high school students were filming fights in the hallways and alcoves of their schools and posting the videos online. Boudreau tells me that they began to hear about fight videos going on YouTube during the day, and then they would often see a related shooting later in the afternoon. In the department’s deployment operations center, the other unit in the force that regularly monitors social media activity, officers first took notice when they read in the newspaper about a West Side gang member who was using the Internet to find out about enemies being released from prison. But “virtual policing” became a priority only after kids aligned with local cliques started calling each other out in rap videos.

Much of this police work is reactive. In the same way that flyers taped to light poles used to announce parties, news of a big gathering is now posted online, and officers move into position based on that intel. Other times guys will say point-blank that they’re going to kill someone. “We’re like, oh shit, we better put some police there because this is about to set off,” an officer in deployment operations says. When people brag about a crime they’ve already committed, detectives use that as yet another investigative tool, assuming that online admissions alone won’t hold up in court. (Though in one successful case, a Cincinnati district attorney was able to introduce thousands of pieces of online evidence of suspects appearing beside guns, drugs, and one another to establish a criminal conspiracy.)

But over time, the cops’ approach to social media has become more entrepreneurial. The police in Chicago now actively look for inflammatory comments around specific dates: the anniversary of a homicide, say, or the birthday of a slain gang member, the sorts of events that have often incited renewed rounds of violence. They also use information collected from public sites to add to their knowledge about the hundreds of cliques and sets operating in the city, cataloging the members, affiliations, beefs, and geographic boundaries.

“We saved a life this week,” Boudreau says. A middle-school student from Englewood had denigrated Chief Keef and the Black Disciples in a rap video. Looking at the comments, Boudreau’s team could see that Keef partisans were mobilizing; the online taunts were close to spilling over into real-world violence. The police notified the 12-year-old’s family, and he and a classmate were relocated from the neighborhood. The next day the police spotted the rivals prowling near the boy’s home. It was the same story as JoJo’s, Boudreau says, except with a different ending.

Police and other experts say the ad hoc, emotional nature of street violence today might actually present an opportunity. Repairing big rifts between warring criminal enterprises is really hard; defusing minor beefs and giving kids skills to regulate their socio-emotional behavior is highly labor-intensive but effective. And the public nature of social media gives police and advocacy groups some warning about trouble before it starts. For a long time, criminal-justice experts have talked about predictive policing—the idea that you can use big data to sniff out crimes before they happen, conjuring up an ethically troublesome future like the one depicted in Steven Spielberg’s Minority Report. But in Chicago and other big cities, police are finding it’s much easier than that. Give people social media and they’ll tell you what they’re about to do.

Just as Chicago cops helped save that 12-year-old in Englewood, police departments around the country are trying to use information gleaned from online posts to anticipate crimes and prevent them from ever taking place. In Cincinnati, officers at the police department’s real-time crime center track dozens of sites daily in a room filled with video monitors. Captain Dan Gerard, who runs the unit, says they want gangbangers to know that the police are watching. A beat cop can bait a suspect who passes on the street: I know you were out celebrating last night; I know who you were with. “It’s designed to get in their heads, to rattle them, so they put the guns down,” Gerard says.

In New York City, where the number of homicides is now the lowest since it started keeping crime statistics 50 years ago, the NYPD credits much of its recent success to monitoring online gang activity. The department determined that street-crew members, by and large teenagers, were responsible for a vastly disproportionate share of the violent crimes in the city. And so last year it launched Operation Crew Cut, which is doubling the number of detectives in its gang division to 300, with many of the additional officers focusing specifically on social media sites. The result, authorities say, has been a steep drop in retaliatory violence, as the police have been able to identify clashes and step in before they escalate. “Any tweet might hold the identities of the next potential victim and perpetrator,” NYPD deputy commissioner Paul Browne says.

There are some signs in Chicago too that police and community efforts might be working. Compared with its pace in 2012, the homicide rate this year has decreased. But as of mid-August, there were still more than 220 people murdered and 1,000 shot; 47 shootings occurred over the July 4 holiday weekend alone. The daily scorekeeping itself has turned into a grim yardstick, a gauge of the quality of life in a place where life is valued far too cheaply.

For kids stuck in these areas wracked by shoot-outs, the best defense is learning how to minimize risk, both online and off. Most of them just want to appear hardened, tough, but not so tough that they stand out; the goal is a level of invisibility that makes them a less likely target. Jason Story, a former gang member from the South Side, is now one of several teachers in a Chicago-wide program called BAM (short for Becoming a Man), a 30-week class aimed at 1,500 troubled high school freshmen and sophomores. He feels that by focusing on issues of integrity, self-determination, and positive anger expression, BAM is steering many of these wayward teens away from dangerous activities on social media and the streets.

Beyond that, simply living in the neighborhoods teaches young people new ways to behave online. The Morgan Street guys tell me some of the basic rules for Facebook. First, don’t make friend requests to rivals or accept any from guys you don’t know. Second, borrow someone else’s phone when possible—ideally a girl’s—to browse the site. But third, don’t quit social media entirely: You need to know who is cliqued up with whom, who is making threats, who might try to catch you unawares. Novell’s route to the McDonald’s will take him right past Black Disciples territory. The Morgan Street guys point beyond the garden where they played as children to the multiple vacant lots and spaces between the neighboring properties. Do I see all those “side cuts”? Some 14-year-old with a gun could emerge at any time from any one of them, they say.

Before I leave the Baskin family home, Novell says, “I ain’t going to lie. On my Facebook page, I’m on there showing my guns off. It’s how you advertise yourself.” It doesn’t matter that he makes himself a target for the police, that cops sometimes stop him to say, “I see you got a new gun. Where’s it at?”

The way he sees it, he is both endangering his life and protecting it. He feels he has to let the BDs know he has big guns just like theirs. It’s an arms race, escalated by the projections of power made on the web every day. “I’m my own police,” Novell declares. “Someone says something to me on Facebook, I don’t even write a word. The only thing I do is post my 30-popper, my big banger.”

It was only a few days later when, back home, I saw the news headline out of Chicago. In the late afternoon on Mother’s Day, Ronald — the quiet one, the one who hoped to be a barber — and Hal Baskin’s grandson were pulling away from the house on Morgan Street when someone stepped from a building and fired on their car. The grandson ducked and scrambled to the street. Ronald was hit in the neck and killed. Some of the news outlets ran a picture of Ronald grabbed from his Facebook page. He’d tried hard to look stern as he took it, holding up his smartphone, snapping the self-portrait in his bathroom mirror.

Ben Austen (@ben_austen) wrote about the legacy of Steve Jobs in issue 20.08.