---
title: Diagnostic code
order: 8
description: "A stable MGSxxxx identifier attached to a magus warning or error, so it can be referenced and looked up; some are guardrails (see wards), others hard errors."
tags: [glossary, insight-and-knowledge]
---

# Diagnostic code

A stable `MGSxxxx` identifier attached to a magus warning or error, so it can be
referenced and looked up; some are guardrails (see [wards](../concepts/wards.md)), others hard
errors.

## Example

```sh
magus query "kind=diagnostic MGS8001"
```

## Used in

<!-- BEGIN GLOSSARY USAGE (generated by glossary-usage-generate from the knowledge graph; edit the generator, not this list) -->

In the code (`magus refs <name>` lists every site):

- `types.DiagnosticCode` (Go)

<!-- END GLOSSARY USAGE -->

## See also

- [Ward](ward.md)
