dnd 5e – What makes a spell being cast considered to be a {class} spell?

Class spells are spells you know from being a a member of that class

There are (at least) two ways to resolve this. There is a clear, direct answer: Any spell you cast that is on your class spell list counts as a spell of that class. While this has the advantages of both being simple and of being a response directed at the question itself, it has the disadvantage of being largely based on (now unofficial) tweets from Jeremy Crawford. I choose not to follow that path for reasons other than it being unofficial. First, this is a complex question and I don’t think all the nuances and caveats lend themselves to explanation within a tweet character limit. Second, I am uncomfortable with the logical conclusion that follows – an individual spell you cast that is on two different spell lists of yours is then simultaneously a spell of both of those classes. And third, applied broadly it contradicts what is an official Sage Advice answer (see below). I think unofficial answers (tweets) have a valuable role in clarifying things when official answers aren’t forthcoming, but I hesitate to accept them when they contradict what is official.

For me then, the way to resolve this is to look at what is actually within the the text of official sources such as the PHB and Sage Advice. Unfortunately, this approach relies on interpreting passages that are not explicitly directed at the question itself (what makes a spell of a certain class), and interpretations can vary.

Spells you know on your list because of your class Spellcasting ability

To start, sorcerer spells (for example) are spells off the sorcerer spell list that you know because you are a sorcerer (having the Spellcasting ability because you are of the sorcerer class).

“Sorcerer: Spellcasting” (PHB 101; emphasis mine)

Spell Slots The Sorcerer table shows how many spell slots you have to cast your spells of 1st level and higher. To cast one of these sorcerer spells, you must expend a slot of the spell’s level or higher…
Spells Known of 1st Level and Higher The Spells Known column of the Sorcerer table shows when you learn more sorcerer spells of your choice…Additionally, when you gain a level in this class, you can choose one of the sorcerer spells you know and replace it with another spell from the sorcerer spell list, which also must be of a level for which you have spell slots.

Notice the subtle distinction between “sorcerer spells” and a “spell from the sorcerer spell list”. A spell becomes a sorcerer spell for you when you know it. Just being on the sorcerer spell list is not enough; it does not become a sorcerer spell for you until you know it.

This interpretation is supported by the text in the (optional) Multiclassing Rules (emphasis mine)

You determine what spells you know and can prepare for each class individually, as if you were a single-classed member of that class…Each spell you know and prepare is associated with one of your classes, and you use the spellcasting ability of that class when you cast the spell.

It is a matter of interpretation what one ascribes to the phrase “associated with”. I choose to believe it means that knowing a spell through being a sorcerer makes it a sorcerer spell.

Spells you gain access to not through the Spellcasting feature of your class

If something besides your class Spellcasting feature grants you the ability to cast a spell, typically it will tell you what class of spell it is.

For example, the Cleric’s Domain feature (PHB 58):

If you have a domain spell that doesn’t appear on the cleric spell list, the spell is nonetheless a cleric spell for you.

Here, although the spell does not appear on the cleric spell list, and in fact appears on another spell list, it is still a cleric spell because the feature granting it to you says it is (I would argue that the underlying principle is that it is because knowledge of the spell is granted through a cleric class feature, although it does not say that explicitly). Thus, if a specific class feature gives you a spell, it would be a spell of that class if the feature said it was (see also the Druid’s Circle spells and the Bard’s Magical Secrets).

Note that sometimes a class feature gives you a spell but explicitly says it is not of your class.

The Spells Known column of the Eldritch Knight Spellcasting table shows when you learn more wizard spells of 1st level or higher.

In this case, the spells you know as an Eldritch Knight are wizard spells, not fighter spells.

You might also learn a spell through the optional rules of feats, which are not a class feature. However, these will still typically imply what kind of spell you are getting.

“Feats: Magic Initiate” (PHB 168)

Choose a class: bard, cleric, druid, sorcerer, warlock, or wizard. You learn two cantrips of your choice from that class’s spell list. In addition, choose one 1st-level spell from that same list. You learn that spell and can cast it at its lowest level. Once you cast it, you must finish a long rest before you can cast it again. Your spellcasting ability for these spells depends on the class you chose: Charisma for bard, sorcerer, or warlock; Wisdom for cleric or druid; or Intelligence for wizard.

This feat stops short of saying the spells you learn are spells of the class whose list you chose. Fortunately there is a Sage Advice Compendium that more explicitly addresses Magic Initiate:

If you have spell slots, can you use them to cast the 1st-level spell you learn with the Magic Initiate feat? Yes, but only if the class you pick for the feat is one of your classes. For example, if you pick sorcerer and you are a sorcerer, the Spellcasting feature for that class tells you that you can use your spell slots to cast the sorcerer spells you know, so you can use your spell slots to cast the 1st-level sorcerer spell you learn from Magic Initiate. Similarly, if you are a wizard and pick that class for the feat, you learn a 1st-level wizard spell, which you could add to your spellbook and subsequently prepare.
In short, you must follow your character’s normal spellcasting rules, which determine whether you can expend spell slots on the 1st-level spell you learn from Magic Initiate.

Here, we are told explicitly that a spell counts as a sorcerer spell not because you knew it through a sorcerer class feature, but because you deliberately learned it from the sorcerer spell class list. Had the same spell also been on another class list as well as that of the sorcerer, and you learned it through Magic Initiate as the other class, it would not count as a sorcerer spell. (See also this question and this question, and the “Ritual Caster” feat).

You might also gain the ability to cast a spell through a magic item, and here it gets more difficult. Magic items that grant you the ability to cast spells do not typically tell you what kind of spells they are, although it is clear that it is you who are casting the spell, not the item, which is important if you are interacting with a feature that says ‘when you cast a spell’ or ‘when you cast a {class} spell’.

“Activating an Item; Spells” (DMG 141)

Some magic items allow the user to cast a spell from the item…A magic item, such as certain staffs, may require you to use your own spellcasting ability when you cast a spell from the item. If you have more than one spellcasting ability, you choose which one to use with the item.

While you are certainly the one casting the spell, is it a {class} spell? Since my resolution of this emphasizes spells you know, I would say a spell you cast from an item is, for example, a sorcerer spell if it is a spell you already know from being a sorcerer. However, this is my interpretation, and others disagree (see this question).

What if you know a spell through more than one means?

(See also this question) If you are multiclassed and have access to a spell from another class that is also on the sorcerer spell list, you still can’t cast it as a sorcerer unless you know it through being a sorcerer (“Each spell you know and prepare is associated with one of your classes”).

But if you know the spell both as a sorcerer and as another class, is it a sorcerer spell? I would say that you make that decision at the moment you cast it, based on the multiclassing rules: “you use the spellcasting ability of that class when you cast the spell”.

I realize that ‘your spellcasting ability’ (ie, Charisma) is not ‘your ability to use Spellcasting’ (ie, a class feature), and I recognize that a spell’s class being determined at the moment of casting is also my interpretation. But the precedent of, when a spell could be sourced from multiple classes, choosing the spellcasting ability at the time of casting seems a clear enough proxy for the class of the spell to me.

Thus, I would say that Any spell on a class spell list that you know from being that class is a class spell, if you choose to cast it as such. If a feature gives you the ability to cast a spell and explicitly references the class, the spell can also be of that class, if you choose to cast it as such.