- "If you would just follow the Code, you would be on the Council."
- ―Obi-Wan Kenobi, to Qui-Gon Jinn
The Jedi Code was a set of rules that governed the behavior of the Jedi Order. It taught its follower to not give in to feelings of anger toward other lifeforms, which would help them resist fear and prevent them from falling to the dark side of the Force.
Amongst other dictates, the Jedi Code forbade Jedi Knights and Jedi Masters from taking on more than one Padawan at a given time; and forbade Jedi from forming attachments, such as marriage, and other specific, individual bonds, such as romantic love and family. Few understood that this practice of nonattachment did not mean the Jedi were strangers to compassion when, in fact, they believed that all lives were precious.
During the Clone Wars, there were those in the Grand Army of the Republic, such as Wilhuff Tarkin, who believed that the Jedi Code prevented the Order from doing what was necessary to win the war against the Confederacy of Independent Systems. Shortly before the end of the Clone Wars, the Jedi High Council, through Obi-Wan Kenobi, asked Anakin Skywalker to spy upon the activities of his friend Supreme Chancellor Sheev Palpatine, something which Anakin felt was against the Jedi Code.
A Jedi such as Obi-Wan Kenobi, trained in the ways of the light side of the Force, could take comfort in the words of the mantra of the Jedi Code:
- There is no emotion, there is peace.
- There is no ignorance, there is knowledge.
- There is no passion, there is serenity.
- There is no chaos, there is harmony.
- There is no death, there is the Force.
There also existed an alternate version of the Code, recited by Jedi younglings during their Initiate Trials, and by Depa Billaba during her full fitness re-assessment after waking up from her 6-month coma:
- Emotion, yet peace.
- Ignorance, yet knowledge.
- Passion, yet serenity.
- Chaos, yet harmony.
- Death, yet the Force.
- Star Wars: Episode I The Phantom Menace (First mentioned)
- Star Wars: Episode II Attack of the Clones (Indirect mention only)
- Star Wars: The Clone Wars – "Voyage of Temptation" (Mentioned only)
- Star Wars: The Clone Wars – "Counterattack" (Mentioned only)
- Star Wars: The Clone Wars – "Citadel Rescue" (Mentioned only)
- Dark Disciple (First appearance)
- Star Wars: Kanan 7: First Blood, Part I: The Corridors of Coruscant
- Star Wars: Episode III Revenge of the Sith (Mentioned only)
- Ezra's Duel with Danger (Mentioned only)