Protobuf Options Are Metadata That the Wire Ignores (and the Parser Files by Brace, Not by Name)
An option is the one part of a .proto file that exists for the code generators and the tools, not for the wire. I encoded the same two-field message twice, once with an option line on the file and once without, and both runs wrote the same six bytes, 080512026869. A decoder that has never seen your schema reads those bytes the same either way, because options never ride the wire at all. They sit in the descriptor, the compiled schema, and from there they steer which code gets generated and which warnings a compiler shows. Everything else in the file is load-bearing; an option is not.
Here is where a JavaScript parser gets opinionated in a way protoc never does. The bracket form, the same [deprecated=true] you write on a field, works inside a message and it stops working the moment the message closes. message M { int32 a=1; } [deprecated=true]; dies on the first bracket with illegal token '['. Same thing on enums, on services, on an rpc. The statement form, option deprecated=true; written as its own line inside the braces, is what a message, a package, a service, and an enum actually take. So the bracket form is a field-level thing and the statement form is the container-level thing, and the parser will tell you which one you wrote and where you wrote it, usually by refusing the other one.
Where the parser puts a statement option is decided by the brace it is inside, and there is a consequence worth knowing. An option line at the top level, outside any block, lands on the file root. The same line inside a package lands on that package node. The same line inside a message lands on the message, even if it sits after your fields, and the same line inside a service lands on the service. The parser is not reading the option, it is just filing it under whatever was open. Which is also why it never checks whether the option is real. I wrote option cc_api_level=1 on a file that imports nothing, and the parser stored it happily on the root node. protoc calls that option unknown and names the file and the line, which is the error you actually want.
The descriptor is where you can watch the option land. I compiled the same message two ways, once with a java_package on the package and once without. The descriptor grew by 19 bytes, and the new bytes break down exactly: the package name, and a nested options block holding the one string. The field list did not move a single byte. That is the whole contract. An option is a label with an address, and the address is the nearest container you wrote it inside.
The diff tab on the tool treats options the way the wire does, which is as invisible. I ran the real diff pipeline on pairs that differ only in options. Add a top-level option, remove one, change its value, add [deprecated=true] to a field, add a java_package to the package. Every one of those reads No differences, which is the right answer, because an option change is never a compatibility break and the report exists to tell you about compatibility. Put a real retype in the same diff and the retype still shows up as its breaking line while the option stays silent. If your diff shows nothing but a big reformat, and your change was options, that is the tool agreeing with the wire.
The tool is at proto.datajutsu.com, and this is the third corner of the options story, after field options and the packed option. The breaking-changes rule is in the breaking changes post, and the diff tab that reads it is walked through in the diff report post.