trim diagnostics verbosity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-03-21 18:53:53 +02:00
parent a4fbc9d615
commit 02d51afe09
4 changed files with 24 additions and 64 deletions

View File

@@ -235,6 +235,6 @@ Tell the user:
- If running manually: restart `npm run dev`
## Diagnostics (Optional)
## Diagnostics
After completing all steps above, read and follow [diagnostics.md](diagnostics.md).
Read and follow [diagnostics.md](diagnostics.md).

View File

@@ -1,8 +1,6 @@
# Diagnostics (Optional)
# Diagnostics
After the update is complete, offer to send anonymous diagnostics.
## 1. Gather system info
Gather system info:
```bash
node -p "require('./package.json').version"
@@ -12,17 +10,13 @@ node -p "process.versions.node.split('.')[0]"
git log -1 --format=%ci HEAD@{1} 2>/dev/null || echo "unknown"
```
The last command gets the date of the previous HEAD (before the update) to estimate version age.
## 2. Write the event
Write a JSON file to `/tmp/nanoclaw-diagnostics.json`. Fill in system info from the commands above and the outcome from the session. Use only non-identifying information — no paths, usernames, hostnames, or IP addresses.
Write `/tmp/nanoclaw-diagnostics.json`. No paths, usernames, hostnames, or IP addresses.
```json
{
"api_key": "phc_fx1Hhx9ucz8GuaJC8LVZWO8u03yXZZJJ6ObS4yplnaP",
"event": "update_complete",
"distinct_id": "<generate a uuid>",
"distinct_id": "<uuid>",
"properties": {
"success": true,
"nanoclaw_version": "1.2.21",
@@ -38,33 +32,18 @@ Write a JSON file to `/tmp/nanoclaw-diagnostics.json`. Fill in system info from
}
```
## 3. Show and ask
Show the contents of the file to the user and ask:
> "Would you like to send anonymous diagnostics to help improve NanoClaw? Here's exactly what would be sent:"
>
> (show the entire JSON file)
>
> **Yes** / **No** / **Never ask again**
Use AskUserQuestion.
## 4. Handle response
Show the entire JSON to the user and ask via AskUserQuestion: **Yes** / **No** / **Never ask again**
**Yes**:
```bash
curl -s -X POST https://us.i.posthog.com/capture/ -H 'Content-Type: application/json' -d @/tmp/nanoclaw-diagnostics.json
rm /tmp/nanoclaw-diagnostics.json
```
Confirm: "Diagnostics sent."
**No**: `rm /tmp/nanoclaw-diagnostics.json` — do nothing else.
**No**: `rm /tmp/nanoclaw-diagnostics.json`
**Never ask again**: Opt out of diagnostics in both setup and update-nanoclaw:
1. Replace the contents of `.claude/skills/setup/diagnostics.md` with just `# Diagnostics — opted out`
2. Replace the contents of `.claude/skills/update-nanoclaw/diagnostics.md` with just `# Diagnostics — opted out`
3. Remove the "Diagnostics (Optional)" section from the end of both `.claude/skills/setup/SKILL.md` and `.claude/skills/update-nanoclaw/SKILL.md`
**Never ask again**:
1. Replace contents of `.claude/skills/setup/diagnostics.md` with `# Diagnostics — opted out`
2. Replace contents of `.claude/skills/update-nanoclaw/diagnostics.md` with `# Diagnostics — opted out`
3. Remove the "Diagnostics" section from both `.claude/skills/setup/SKILL.md` and `.claude/skills/update-nanoclaw/SKILL.md`
4. `rm /tmp/nanoclaw-diagnostics.json`
Confirm: "Got it — you won't be asked again."