The warrior code

The warrior code is a list of fifteen different rules that should be followed by all Clan cats. It is taught from the first means of kithood to when an elder is faced with death. It is said that, as long as the Clans follow the warrior code, no harm shall come to them.

History
There is a disagreement about the origins of the warrior code. On one hand, Secrets of the Clans states that the rules were invented when the Clans were founded, made up by the leaders Thunder, Shadow, Wind. and River. On the other hand, Code of the Clans states that the rules were developed during a very long timespan, each one invented by different cats after a significant event.

The Warrior Code
The Warrior Code:

1. Defend your Clan, even with your life. You may have friendships with cats from other Clans, but your loyalty must remain to your Clan, as one day you may meet them in battle.

2. Do not hunt or trespass on another Clan's territory.

3. Elders, queens, and kits must be fed before apprentices and warriors. Unless they have permission, apprentices may not eat until they have hunted to feed the elders. If any warrior or apprentice is sick or injured, they may eat while the elders, queens, and kits are eating.

4. Prey is killed only to be eaten. Give thanks to StarClan for its life.

5. A kit must be at least six moons old to become an apprentice.

6. Newly appointed warriors will keep a silent vigil for one night after receiving their warrior name.

7. A cat cannot be made deputy without having mentored at least one apprentice.

8. The deputy will become Clan leader when the leader dies or retires.

9. After the death or retirement of the deputy, the new deputy must be chosen before moonhigh.

10. A Gathering of all four Clans is held at the full moon during a truce that lasts for the night. There shall be no fighting among Clans at this time.

11. Boundaries must be checked and marked daily. Challenge all trespassing cats.

12. No warrior can neglect a kit in pain or danger, even if the kit is from a different Clan.

13. The word of the Clan leader is the warrior code.

14. An honorable warrior does not need to kill other cats to win his/her battles, unless they are outside the warrior code or if it is necessary for self-defense.

15. A warrior rejects the soft life of a kittypet.

Exceptions

 * Cats on their way to the Moonstone or Moonpool are allowed to cross other Clans' territories to get to their destination - WindClan grounds in on the moorland and ThunderClan grounds by the lake, in the forest.
 * At the lake, cats may travel on other Clans' grounds as long as they are within two fox-lengths of the lake; for instance, to go to a Gathering.
 * Cats may travel on other Clan territories if they have something to report (fox, badger).

Additional Rules
The following rules are not specifically stated in the warrior code, but are expected to be followed:
 * Medicine cats may not have a mate or kits.
 * Kits must stay in camp until they are apprenticed, and are not allowed to hunt.
 * The safety of the Clan is more important than the safety of one cat.
 * Clans must not unite together to drive out another Clan.
 * Clans must not force another Clan to share territory.
 * Enemy patrols must not attack cats if they are returning from a mission all four Clans agree on.

Rejected Codes
Throughout history, several other rules were proposed for introduction into the Warrior Code, however, they were turned down. These rules were:
 * Only cats of pure forest blood can be Clan members (suggested by Featherstar of WindClan).
 * Each Clan may only eat the prey they are most suited for (suggested by Robinstar of SkyClan).
 * All Clan cats must believe in StarClan (suggested by Dovestar of RiverClan).

Breaking the Warrior Code
The rules are often broken. All of the Clans break the rules many times although ThunderClan is the Clan whose cats question and debate the Code the most.

Examples of Breaking the Warrior Code

 * Rule 1 was broken by Graystripe when he was torn between his loyalties to ThunderClan and RiverClan due to his love relationship with Silverstream, and refused to fight her. This rule was also broken by Bluefur when she fell in love with Oakheart, and refused to battle him when he was attacked by Thistleclaw. It was also broken by any cat who joined the Dark Forest. This was broken by Fallowtail and Reedfeather when they gave birth to Graypool and Willowbreeze.
 * Rule 2 is one of the most frequently broken, with many Clans crossing boundaries to catch prey or apprentices not acknowledging the boundaries.
 * Rule 3 was broken by Firepaw when catching prey for Yellowfang after she was exiled from ShadowClan. It was also broken by Longtail and Darkstripe, who ate prey on a hunting patrol instead of bringing back to the elders and kits. It is rumored by Graypaw that Sandpaw and Dustpaw did this every so often.
 * Rule 4 was broken by Tigerstar and his warriors when he killed prey only to raise a hill of bones.
 * Rule 5 was broken by Brokenstar of ShadowClan, when he forced kits to become apprentices before they were ready. He also trained them too hard, killing some of them. Some were made warriors before they were even six moons old.
 * Rule 6 was broken when Squirrelflight was named a warrior, but did not sit vigil as ThunderClan did not yet have a camp.
 * Rule 7 was broken by Firestar when he appointed Brambleclaw as deputy because he had no apprentice, even though he was going to mentor Berrykit when he became six moons. This rule was also broken when Hawkfrost was appointed temporarily as deputy since he hadn't mentored an apprentice.
 * Rule 8 was broken by Tallstar when he appointed Onewhisker leader even though Mudclaw was still deputy.
 * Rule 9 was broken by Bluestar when she waited for too long to name a new deputy.
 * Rule 10 was broken by all Clans when they fought numerous times at Gatherings.
 * Rule 11 was broken by ShadowClan when they stopped believing in StarClan and stopped patrolling their borders.
 * Rule 12 was broken by Russetfur and her patrol, watching Berrykit struggle with his tail caught in a fox trap, and making no move to help him. Also done by Tigerstar when he was an apprentice and tried to kill Scourge while he was a kit named Tiny.
 * Rule 13 was broken by Fireheart when he refused to attack WindClan when Bluestar planned an attack.
 * Rule 14 was broken by Brokentail, Hawkheart, Tigerstar, Hollyleaf, and Clawface.
 * Rule 15 was broken by Cloudpaw when he took food from Twolegs and by SkyClan's daylight warriors because they live with Twolegs at night.
 * The rule about medicine cats being forbidden to have a mate and kits was broken by both Leafpool and Yellowfang.

Punishment
The Clan Leader may choose to punish cats who broke the Warrior Code. These include scolding, giving a warrior apprentice duties, or giving an apprentice an unpleasant task (like when Bluestar put Firepaw in charge of taking care of Yellowfang for feeding her). In severe cases, the cat may be exiled from the Clan; such as RiverClan exiling Graystripe, or Bluestar exiling Tigerclaw.

Cats who would murder for no reason or caused much pain to other cats for no reason would go to the Place of No Stars instead of StarClan (Tigerstar, Hawkfrost, Darkstripe, etc.)