← ClaudeAtlas

logging-for-remote-diagnosislisted

Use when building any mechanic that could fail on a machine out of reach - a shipped product, a CLI a user runs, a server.
Fergius-Engineering/instincts · ★ 2 · AI & Automation · score 73
Install: claude install-skill Fergius-Engineering/instincts
## The rule Add the logs as you build the mechanic, not after. The test to hold yourself to: a user on another machine hits a bug, turns on verbose logging, and sends you one dump. From that dump alone, with no chance to add a log and ask them to try again, can you tell which path ran, what got skipped, and why? If not, the logging isn't done yet. ## Fires when While writing any branch, early return, skip, or async/deferred step in code that runs somewhere you can't attach a debugger. At build time, not at bug time. ## How to apply Log the entry of each path, every branch and skip with the deciding condition, key values and counts, and the chosen outcome. Use a greppable tag prefix (e.g. `[Dispatch]`, `[Sync]`) so the dump is filterable. Key values means ids, sizes, counts, and reasons — not payloads. Credentials and tokens never go in a log line, and personal data is payload too: log the user id, not the email. The dump you're designing for gets read on screens you don't control and forwarded around. For async or deferred work, log at schedule time and at execution time. They're different moments and either can be the bug. Before calling it done, reread each branch and ask: "from the verbose dump alone, could I tell this branch was taken and why?" ## Absence is not proof A missing log line does not prove the code didn't run. The log level may have been off. If you grep a dump and find zero hits for a tag, "verbose was disabled" is at least as likely as "the branch