What to Do in a Code Blue: From CPR to Recovery

A code blue is a hospital-wide alert that a patient is in cardiac or respiratory arrest and needs immediate resuscitation. The response follows a specific sequence: recognize the arrest, call for help, start chest compressions, and continue structured advanced life support until the patient’s heart restarts or the effort is stopped. Every second matters, and each person in the room has a defined job. Here’s what actually happens, step by step.

Recognizing the Arrest and Activating the Code

Any healthcare worker can activate a code blue. If you find a patient unresponsive and not breathing normally, you call it. In most hospitals, activation triggers a centralized alarm system: a 30-second overhead announcement identifying the patient’s location broadcasts throughout the building (typically excluding operating rooms and ICUs, where teams are already present). Phone calls then go out in sequence to the specific team members needed, including a senior resident, emergency nurses, and an ICU attending.

Before the team arrives, the first person on scene has two priorities: confirm the patient has no pulse and begin chest compressions. The crash cart should be brought to the bedside immediately, along with the defibrillator. One critical step that’s easy to overlook in the chaos: check the patient’s chart for a do-not-resuscitate (DNR) order. If a valid DNR is documented, resuscitation should not proceed. Without one, full resuscitation begins by default.

Starting High-Quality CPR

Chest compressions are the foundation of every code blue. The American Heart Association standards are specific: compress at a rate of 100 to 120 per minute, pushing down at least 2 inches into the adult chest. Allow full recoil between compressions so the heart can refill with blood. These numbers aren’t suggestions. Compression quality is the single biggest predictor of whether a patient survives.

Before the patient has a breathing tube in place, the ratio is 30 compressions to 2 breaths. Compressors should count out loud, ideally using a metronome to keep pace. Once an advanced airway like an endotracheal tube is placed, the rhythm changes: continuous compressions with no pauses, and one breath delivered every 6 seconds (10 breaths per minute). Compressors should rotate every 2 minutes because fatigue degrades compression depth quickly, even when you don’t feel tired.

Code Team Roles

A code blue is not a free-for-all. Each person has a designated role, and the team works best when those roles are clearly assigned from the start.

  • Code leader: Runs the resuscitation. Stands where everyone can see and hear them, announces decisions, identifies reversible causes, and monitors the team’s performance. A good code leader introduces themselves immediately: “I am [name], I am the code leader. Does the patient have a pulse? No? You, start compressions.”
  • Compressor: Delivers uninterrupted, high-quality chest compressions with audible counting. Rotates out every 2 minutes.
  • Airway manager: Manages ventilation with a bag-valve mask initially, then places an advanced airway when appropriate.
  • Medication nurse: Draws up and administers medications on the code leader’s orders, announces what’s being given and when.
  • Recorder: Documents everything in real time: timestamps for medications, rhythm checks, shocks delivered, and any changes in the patient’s status.
  • Defibrillator operator: Attaches pads, reads the rhythm, charges the device, and delivers shocks when indicated.

If you arrive at a code and roles are already filled, stay nearby. People tire out, supplies run low, and extra hands are always needed for compressions, drawing medications, or running to get equipment.

Shockable vs. Non-Shockable Rhythms

When the defibrillator pads go on, the monitor shows the heart’s electrical activity, and this determines the entire treatment path. There are two categories.

Shockable rhythms include ventricular fibrillation (the heart quivering chaotically) and pulseless ventricular tachycardia (the heart beating dangerously fast but producing no blood flow). These rhythms respond to defibrillation, which delivers an electrical shock to reset the heart’s electrical system. The sooner the shock is delivered, the better the odds.

Non-shockable rhythms include pulseless electrical activity (the monitor shows some organized electrical signals, but the heart isn’t actually pumping) and asystole (a flatline, no electrical activity at all). Defibrillation will not help these rhythms and must not be applied. Treatment relies on continuous CPR, medications, and identifying whatever underlying problem caused the arrest, whether that’s massive bleeding, a blood clot in the lungs, a drug overdose, or a severe electrolyte imbalance.

Medications During the Code

The crash cart at the bedside contains a standardized set of emergency medications and supplies: syringes, IV placement kits, saline flushes, airway equipment, and protective gear like gloves and sharps containers. The key drugs stocked include epinephrine, amiodarone, atropine, calcium, sodium bicarbonate, dopamine, vasopressin, and naloxone (which reverses opioid overdoses).

Epinephrine is the primary medication in cardiac arrest. It’s given every 3 to 5 minutes regardless of rhythm type, working to constrict blood vessels and push blood toward the heart and brain. For shockable rhythms that don’t convert after defibrillation, amiodarone is added. The first dose is 300 mg, with a second dose of 150 mg if needed. These medications buy time while the team works to fix whatever triggered the arrest.

What Happens When the Heart Restarts

When a patient achieves return of spontaneous circulation (often called ROSC), the code isn’t over. The first minutes and hours after the heart restarts are a high-risk window, and the care that follows directly affects whether the patient recovers with intact brain function.

The immediate priorities shift to stabilization. Oxygen levels are titrated carefully, targeting a blood oxygen saturation of 94% to 98%. This is counterintuitive, but flooding the newly restarted brain with 100% oxygen actually causes damage. High oxygen levels during reperfusion increase harmful chemical reactions in brain tissue, leading to worse neurological outcomes. So the team starts at full oxygen to prevent any deficit, then dials it back as soon as reliable monitoring is in place.

Blood pressure management is equally critical. The goal is to keep systolic blood pressure at or above 90 mmHg using IV fluids and, if needed, medications that support heart function. The brain and other organs are vulnerable after being starved of blood flow, and maintaining adequate pressure ensures oxygen delivery continues.

Temperature management is one of the most important post-arrest interventions. Patients who remain unconscious after ROSC are cooled to a target temperature between 33°C and 36°C (roughly 91°F to 97°F) and held there for at least 24 hours. This controlled cooling protects the brain from swelling and further injury during the recovery phase. Blood sugar is monitored closely and kept in a moderate range, and any seizure activity is treated immediately, since seizures compound brain damage after an arrest.

Practical Tips for Code Blue Performance

Knowing the protocol is different from executing it under pressure. The single most common piece of advice from experienced code leaders is to stay calm. UCSF’s code blue handbook opens with a half-serious reminder: “Check your own pulse first.” Panic is contagious, and a calm leader produces a calm team.

Communicate out loud, constantly. The code leader should verbalize every decision. The medication nurse should announce every drug given and the time. The compressor should count. Silence during a code means someone isn’t sure what’s happening, and uncertainty costs time. If you’re unsure of your role, ask. A simple “What do you need from me?” is always the right question.

Closed-loop communication prevents errors. When the code leader gives an order, the person receiving it repeats it back: “Giving 1 mg epinephrine IV, now.” This confirms the message was heard correctly and creates a verbal record for the team. It feels awkward in practice until it catches a mistake, which it will.

Finally, expect the code to feel long. Most resuscitation efforts last 20 to 40 minutes, and some go longer. The structured 2-minute cycles of CPR, rhythm checks, medication timing, and role rotations create a rhythm of their own. Trust the algorithm, focus on your role, and keep compressions deep and fast. That’s what saves lives.