Codenames is played between two teams, red and blue on a set of twenty-five codenames. Each team consists of a single spymaster who knows the secret identity behind each codename, with the remaining players as field operatives who will contact the codenames. On each turn of the game, the spymaster provides a clue to their field operatives. The field operatives will then attempt to contact at least one of their aligned agents based on the codenames clued. The first team to activate all of their agents wins the game!

Codenames is an interesting game since it can be adapted to a variaty of themes. For instance, it can be themed to Harry Potter. As such it is also a very good game to be played with children. Therefor, I created an excel file (Update 2017-04-30: I updated and added two additional word lists to the file; i) the official word list and ii) an extensive noun word list. Download here) from the original game which includes all the necessary items for the basic game:

  • Codenames (two categories, general and Harry Potter)
  • Map cards
  • Identity cards

You can print these on sheets of paper and cut them out. Now follows a set of detailed instructions for playing the game.

Identity cards
Identity cards
Selection of the codenames.
Map cards.
Selection of the map cards.


Players are divided into two teams, Red and Blue. Each team consists of one spymaster, with the remaining players as field operatives. All players observe a set of twenty-five words, representing codenames for agents aligned with each team. While field operatives do not observe the identities of each of the codenames, the spymasters each get to see the identity of all codenames on the map card.

There are four different agent identities: red agent, blue agent, bystander, and assassin. One of the teams will have nine of their-colored agents in the set of codenames, while the other team will have eight agents. The team with nine agents will take the starting turn in the game. Among the eight codenames not aligned with either team, there are seven Bystanders and one Assassin. Effects for contacting these agents are described in the following section.

Game flow

On a team’s turn, their spymaster must start by providing their field operatives with a clue for the identities for their own agents. A clue consists of a single word and a number. The word should be related to the codenames that are aligned with the acting spymaster’s team, while the number represents how many codenames are related to the clue word. Further guidelines, including two special number rules, follow in the section below.

Once a clue has been given, the field operatives are free to discuss which codename(s) should be contacted. When the field operatives have decided on a guess, they may register their guess by touching the codename. The host or spymaster will reveal the identity of the codename by putting an identity card (Red Agent, Blue Agent, Bystander or Assasin) on top of it.

If the revealed agent is of the same team as the operatives, then they may continue making guesses. A maximum number of guesses may be made equal to the number given in the spymaster’s clue, plus one. Alternatively, the field operatives may pass to end their turn, so long as they have made at least one guess already on their turn. If the revealed agent is not of the same team, then the turn ends. In the special case that the assassin was revealed, then the team that performed the reveal immediately loses the game.

Spymaster Clue Guidelines

Spymaster clues consist of a single word and a number, with the following guidelines:

  • Words must be related to the meaning of the codenames being clued.
  • The number following the word cannot be used as a clue itself.
  • Clues may not include codenames or related forms of codenames. For compound codenames, this includes the constituent words that comprise the compound word. Once a codename has been guessed, it can be used in clues.

Overall, be reasonable about rules; spymasters may consult with their opposing spymaster and the host for the validity of a clue. If an invalid clue is provided, then the turn immediately ends and the opposing spymaster may declare an agent of their own color before making their own clue.

Spymasters have two special options for numbers associated with their clue words. First, spymasters may declare zero (0) as their clue, suggesting that none of the codenames are related to their declared word. In the case that zero is declared, the field operatives do not have a limit to the number of guesses that they may make before passing. The second special option is to declare “unlimited” as their clue, suggesting at least one codename is related to the declared word. As with zero, the number of guesses that may be made by field operatives before passing is unlimited.

(Modified) PERT distribution

The United States navy developed in the 1950’s a program evaluation research task (PERT). It was designed to analyze the duration of a project and the tasks within the project. Each task in the project is given the following properties:

  • Name of the task
  • Predecessor, the list of tasks that have to be completed before the task can start.
  • The amount of time it will take for a task to be finished.

The duration of a task is often not fixed. It can vary between a minimum and maximum. The PERT distribution was created to give a good estimate of what the probability is of the duration of a task. It uses the same three parameters as the Triangular distribution, namely, the minimum (\text{min}), the most likely (\text{mode}) and the maximum (\text{max}). The probability density function (PDF) is given by

    \begin{equation*} f(x) = \frac{1}{B(\alpha_1,\alpha_2)}\frac{(x - \text{min})^{\alpha_1 - 1} (\text{max} - x)^{\alpha_2 - 1}}{(\text{max} - \text{min})^{\alpha_1 + \alpha_2 - 1}} \end{equation*}


    \begin{equation*} \alpha_1 = 6 \left( \frac{\mu - \text{min}}{\text{max} - \text{min}} \right), \quad \alpha_2 = 6 \left( \frac{\text{max} - \mu}{\text{max} - \text{min}} \right), \quad \end{equation*}


    \begin{equation*} \mu = \frac{\text{min} + 4\text{mode} + \text{max}}{6} \end{equation*}

being the mean.

An additional shape parameter \gamma might be added, in which case we are dealing with the modified PERT (MPERT) distribution. The parameter influences the peakness of the distribution. The only difference with PERT is the definition of \alpha_1 and \alpha_2. These are namely defined as:

    \begin{equation*} \alpha_1 = 1 + \gamma \left( \frac{\mu - \text{min}}{\text{max} - \text{min}} \right), \quad \alpha_2 = 1 + \gamma \left( \frac{\text{max} - \mu}{\text{max} - \text{min}} \right), \quad \end{equation*}

I created some Matlab code which includes functions for the PDF, the (inverse) cumulative distribution function (CDF). The inverse CDF is important for when you want to generate random numbers. The code can be download from here.

Finally, below is an interactive example of the PDF of PERT (blue) and MPERT (red) distribution.