[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXRB3757RGVBP8Z88MTBX3":3,"skill-same:01M6GXRB3757RGVBP8Z88MTBX3":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":63,"ownerHtmlUrl":64,"ownerBlogUrl":63,"ownerDescription":65,"updatedAt":66,"install":67,"resources":79},"01M6GXRB3757RGVBP8Z88MTBX3","telemetry",null,"Unified telemetry hub. Shows current session cost, today's spend, all-time totals, hook activity, trust level, and a directory of every telemetry command available. Also the control surface to toggle telemetry on\u002Foff and tune thresholds. Single entry point for anyone asking \"what does this cost\" or \"what telemetry does Citadel have\".","SethGammon\u002FCitadel","SethGammon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5523585?v=4","01M6GXJ90FD2CE9QF5GQERWN06","Seth Gammon","01M6GXJ94VXYGK5KAW14EYE901",929,"MIT","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftelemetry\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"spending","directory","hook","activity","records","thresholds","false","time","me","show","trust","hooks","session","command","how","show me","integrity","audit integrity","audit","2026-11-10 10:12:30",false,"---\nname: telemetry\nlicense: MIT\ndescription: >-\n  Unified telemetry hub. Shows current session cost, today's spend, all-time\n  totals, hook activity, trust level, and a directory of every telemetry command\n  available. Also the control surface to toggle telemetry on\u002Foff and tune\n  thresholds. Single entry point for anyone asking \"what does this cost\" or\n  \"what telemetry does Citadel have\".\nuser-invocable: true\nauto-trigger: false\ntrigger_keywords:\n  - telemetry\n  - what did this cost\n  - session cost\n  - how much did that cost\n  - how much have I spent\n  - what hooks fired\n  - trust level\n  - show me telemetry\n  - spending\n  - session stats\n  - what telemetry\n  - verify audit\n  - audit integrity\n  - check audit\n  - tampered records\nlast-updated: 2026-04-09\n---\n\n# \u002Ftelemetry — Telemetry Hub\n\n## When to Use\n\n- \"What does Citadel track?\" \u002F \"What telemetry does it have?\"\n- \"What did this session cost?\" \u002F \"How much have I spent?\"\n- \"How do I turn off the cost alerts?\" \u002F \"Can I disable telemetry?\"\n- \"Show me hook activity\" \u002F \"What hooks fired?\"\n- \"What trust level am I at?\"\n- Directly: `\u002Ftelemetry`\n\nRouted here by `\u002Fdo` for: \"telemetry\", \"what did this cost\", \"session stats\",\n\"session cost\", \"how much did that cost\", \"what hooks fired\", \"trust level\",\n\"show me telemetry\", \"cost breakdown\", \"spending\".\n\n## Commands\n\n| Command | Behavior |\n|---|---|\n| `\u002Ftelemetry` | Full hub — stats + command directory + settings |\n| `\u002Ftelemetry --costs` | Cost section only: session, today, all-time, by campaign |\n| `\u002Ftelemetry --hooks` | Hook activity only: last 20 fires with timing and outcomes |\n| `\u002Ftelemetry --verify` | Telemetry and artifact integrity check: verify hashes\u002Fsignatures, flag tampered records, report legacy records |\n| `\u002Ftelemetry --config` | Show current telemetry settings from harness.json |\n| `\u002Ftelemetry off` | Disable session summary, reduce hook verbosity |\n| `\u002Ftelemetry on` | Re-enable all telemetry |\n| `\u002Ftelemetry --threshold N` | Set cost alert threshold step (e.g. `--threshold 10` = alert every $10) |\n\n## Protocol\n\n### Step 1: COLLECT DATA\n\nRead the following in parallel. All are optional — treat missing files as zero\u002Fempty.\n\n**Live session cost:**\n- Run `node scripts\u002Fsession-tokens.js --today 2>\u002Fdev\u002Fnull` — captures real token data\n- If unavailable, read `.planning\u002Ftelemetry\u002Fcost-tracker-state.json` for burn rate\n- Real cost is always preferred over estimated. Mark clearly: `$X.XX` vs `$X.XX (est)`\n\n**Historical costs:**\n- Run `node scripts\u002Fsession-tokens.js --all 2>\u002Fdev\u002Fnull` for all-time real totals\n- Read last 20 lines of `.planning\u002Ftelemetry\u002Fsession-costs.jsonl` for recent sessions\n- For each entry: prefer `real_cost` > `override_cost` > `estimated_cost`\n\n**Hook activity:**\n- Read last 20 lines of `.planning\u002Ftelemetry\u002Fhook-timing.jsonl`\n- For each `event: \"timing\"` entry: extract `hook`, `duration_ms`, `timestamp`\n- For each `event: \"counter\"` entry: extract `hook`, `metric`\n- Check `.planning\u002Ftelemetry\u002Fhook-errors.jsonl` (last 20 lines) for recent blocks\n\n**Trust level:**\n- Read `.claude\u002Fharness.json` (Citadel's shared config path for all runtimes, including Codex) → `trust` object\n- Compute: novice (sessions \u003C 5), familiar (5-19), trusted (20+ with 2+ campaigns)\n- If `trust.override` set, use that\n\n**Settings:**\n- Read `.claude\u002Fharness.json` → `telemetry` object\n- Show current values with defaults if missing\n\n### Step 2: RENDER HUB\n\nOutput this format. Omit a section only if the data source is completely unavailable.\n\n```\n=== Citadel Telemetry ===\n\nCURRENT SESSION\n  Cost:       $X.XX [real] | $X.XX (est)\n  Duration:   N min | $X.XX\u002Fmin burn rate\n  Tokens:     NNK input | NK output | NK cache read | NK cache write\n  Messages:   N\n  Agents:     N spawned\n  Hooks fired: N (today)\n\nTODAY\n  $X.XX across N sessions\n  Most expensive: {slug or \"unattached\"} — $X.XX\n\nALL TIME\n  $X.XX across N sessions, N campaigns\n  Cache savings: ~$X.XX (cache reads vs full input price)\n\nBY CAMPAIGN (recent 5)\n  {slug}: $X.XX — N sessions\n  _unattached: $X.XX — N sessions\n\nHOOK ACTIVITY (last 10 fires)\n  {relative time} | {hook} | {duration_ms}ms | {outcome}\n  (no hook timing recorded yet)\n\nTRUST LEVEL\n  Level:    {novice | familiar | trusted}\n  Sessions: N completed\n  Campaigns: N completed\n  (novice = 0-4 sessions | familiar = 5-19 | trusted = 20+ with 2+ campaigns)\n\nTELEMETRY SETTINGS\n  Enabled:          {true | false}\n  Session summary:  {auto | always | off}   ← the [session] line at session end\n  Cost alerts:      {on | off}  at thresholds: {list or \"default ($5,$15,$30...)\"}\n  Hook timing:      {on | off}\n  Audit log:        {on | off}\n  — or, when harness.json is absent —\n  (harness.json not found — defaults active)\n  → Run \u002Fdo setup to unlock cost tracking, configure thresholds, and register your install.\n\nCOMMAND DIRECTORY\n  \u002Ftelemetry                            This screen\n  \u002Ftelemetry --costs                    Cost breakdown only\n  \u002Ftelemetry --hooks                    Hook activity only\n  \u002Ftelemetry --verify                   Telemetry\u002Fartifact integrity check (hash\u002Fsignature verification)\n  \u002Fcost                                 Deep cost exploration by session\u002Fcampaign\u002Fweek\n  \u002Fdashboard                            Full harness state (campaigns, fleet, all costs)\n\n  node scripts\u002Fsession-tokens.js --today   Today's sessions with exact token counts\n  node scripts\u002Fsession-tokens.js --all     All-time totals (real data, not estimates)\n\n  cat .planning\u002Ftelemetry\u002Fsession-costs.jsonl   Raw session cost log\n  cat .planning\u002Ftelemetry\u002Fhook-timing.jsonl     Raw hook execution log\n  cat .planning\u002Ftelemetry\u002Faudit.jsonl           Raw tool call audit log\n\nCONTROLS\n  \u002Ftelemetry off                        Disable session summary + reduce verbosity\n  \u002Ftelemetry on                         Re-enable\n  \u002Ftelemetry --threshold N              Alert every $N (writes to harness.json)\n  \u002Ftelemetry --config                   Edit settings interactively\n```\n\n### Step 3: SUB-COMMAND HANDLING\n\n**`\u002Ftelemetry off`:** Set `telemetry.sessionSummary = \"off\"` and `telemetry.costAlerts = false` in harness.json. Output: \"Telemetry summary disabled. Hook safety checks remain active.\" Safety hooks (protect-files, circuit-breaker, external-action-gate) are never disabled.\n\n**`\u002Ftelemetry on`:** Set `telemetry.sessionSummary = \"auto\"` and `telemetry.costAlerts = true`. Output: \"Telemetry re-enabled.\"\n\n**`\u002Ftelemetry --threshold N`:** Validate N is positive. Generate `[N, N*2, N*5, N*10, N*20, N*50, N*100]` (capped at 500). Write to `harness.json` under `policy.costTracker.thresholds`.\n\n**`\u002Ftelemetry --verify`:** Run the project verifier:\n\n```\nnode scripts\u002Fverify-telemetry-integrity.js\n```\n\nThe verifier scans `.planning\u002Ftelemetry\u002F*.jsonl` and `.planning\u002Fartifacts\u002F*.jsonl`. Display verified, signed, legacy, tampered, invalid, and signature-warning counts. Use `--strict-legacy` only when old unsigned records should fail the check.\n\nOutput format:\n```\n=== Telemetry Integrity ===\n\nfile.jsonl\n  Total records:    N\n  Verified (hash):  N\n  Verified (signed): N\n  Legacy (no hash): N\n  TAMPERED:         N\n  Invalid JSON:     N\n  Signature warnings: N\n\nStatus: CLEAN or FAILED\n```\n\nIf any tampered records: list each with `timestamp`, `event`, and both the stored and expected hash (first 16 chars each). Tampering can indicate log corruption, manual edits, or a bug — not necessarily malicious.\n\nIf only legacy records (no tampered): note \"Legacy records were written before telemetry integrity hashing was added. New telemetry and artifact records are hashed automatically.\"\n\n**`\u002Ftelemetry --config`:** Show current settings with the `node -e \"...\"` command to change each — don't auto-apply.\n\n### Step 4: ACCURACY BADGES\n\nAlways mark data source clearly:\n- `[real]` — data from Claude Code's native session JSONL (exact)\n- `(est)` — estimated from the fallback model ($1 base + $0.50\u002Fagent + $0.10\u002Fmin)\n- `(override)` — manually entered by the user\n\nNever blend real and estimated in the same total without flagging it.\n\n## What Telemetry Covers\n\n**Covered:** session cost (real token data), duration\u002Fburn rate\u002Fmessage count, agent spawn count, hook timing and outcomes, campaign cost attribution, trust level.\n\n**Not covered (by design):** per-tool-call cost, per-subagent cost isolation, real-time streaming token count.\n\n**Safety hooks always on (cannot be disabled):** protect-files, external-action-gate, circuit-breaker, quality-gate.\n\n## OTLP Export\n\nThe JSONL files under `.planning\u002Ftelemetry\u002F` stay canonical. For standard observability\nstacks, `scripts\u002Ftelemetry-otlp-export.js` translates new records into OTLP\u002FHTTP JSON\nmetrics and POSTs them to a collector. Byte offsets per source file live in\n`.planning\u002Ftelemetry\u002Fotlp-export-state.json`, so repeat runs export only new records.\n\n```bash\n# Preview the OTLP payload without sending or advancing state\nnode scripts\u002Ftelemetry-otlp-export.js --dry-run\n\n# Export new records to a local collector (\u002Fv1\u002Fmetrics appended when the url has no path)\nnode scripts\u002Ftelemetry-otlp-export.js --endpoint http:\u002F\u002Flocalhost:4318\n```\n\n| Metric | Type | Source file |\n|---|---|---|\n| `citadel.session.cost.usd` | sum (delta), `session.id` \u002F `cost.source` attributes | `session-costs.jsonl` |\n| `citadel.session.tokens` | sum (delta), `token.type` attribute | `session-costs.jsonl` |\n| `citadel.hook.duration.ms` | gauge, `hook.name` attribute | `hook-timing.jsonl` |\n| `citadel.agent.runs` | sum (delta), `run.status` \u002F `run.event` attributes | `agent-runs.jsonl` |\n\n`--reset` clears the offsets for a full re-export. On a non-2xx response or network\nerror the exporter exits 1 without advancing state, so the next run retries the same\nrecords. Data point timestamps come from the JSONL records, never the current clock.\nTest with `node scripts\u002Ftest-telemetry-otlp.js`.\n\n**Local collector demo:** `examples\u002Fotel-collector\u002F` contains a ready-made collector\nconfig (OTLP HTTP receiver on 4318, debug exporter to stdout) and a README with the\ntwo-command flow: `docker run` with the config mounted, then\n`node scripts\u002Ftelemetry-otlp-export.js --endpoint http:\u002F\u002Flocalhost:4318`. Without\nDocker, `--dry-run` prints the exact OTLP payload instead.\n\n## Quality Gates\n\n- Never show raw JSONL to the user — always parse and format\n- Cost totals must be labeled with their source (real \u002F est \u002F mixed)\n- `\u002Ftelemetry off` must NOT disable safety hooks — make this explicit in output\n- Relative timestamps required — no raw ISO strings in output\n- If all data sources are missing, show the empty-state version with setup hint\n\n## Fringe Cases\n\n- **`.planning\u002Ftelemetry\u002F` missing:** Show empty state with \"Run `\u002Fdo setup` to initialize telemetry.\"\n- **`session-tokens.js` unavailable:** Fall back to session-costs.jsonl; mark `(est)`.\n- **harness.json missing:** Show \"(harness.json not found — defaults active)\" and \"→ Run \u002Fdo setup to unlock cost tracking.\"\n- **`telemetry.enabled: false`:** Show banner \"Telemetry is disabled. Run `\u002Ftelemetry on` to re-enable.\"\n- **`--verify` with missing files:** Report \"No telemetry or artifact JSONL files found.\" Not an error.\n- **`--verify` when `scripts\u002Fverify-telemetry-integrity.js` is unavailable:** Report that the verifier is missing and show the raw file paths to inspect; do not claim hash verification ran.\n\n## Contextual Gates\n\n**Disclosure:** Read-only by default. `--threshold`, `off`, `on`, `--config` write `harness.json`.\n**Reversibility:** amber — `harness.json` writes; undo with `git checkout .claude\u002Fharness.json`.\n**Trust gates:** Any — no restrictions.\n\n## Exit Protocol\n\n\u002Ftelemetry does not produce a HANDOFF block. It is a read-only observability\ntool (except for `--threshold`, `off`, `on`, `--config` which write harness.json).\nAfter displaying output, wait for the next user command.\n","# \u002Ftelemetry — Telemetry Hub\n\n## When to Use\n\n- \"What does Citadel track?\" \u002F \"What telemetry does it have?\"\n- \"What did this session cost?\" \u002F \"How much have I spent?\"\n- \"How do I turn off the cost alerts?\" \u002F \"Can I disable telemetry?\"\n- \"Show me hook activity\" \u002F \"What hooks fired?\"\n- \"What trust level am I at?\"\n- Directly: `\u002Ftelemetry`\n\nRouted here by `\u002Fdo` for: \"telemetry\", \"what did this cost\", \"session stats\",\n\"session cost\", \"how much did that cost\", \"what hooks fired\", \"trust level\",\n\"show me telemetry\", \"cost breakdown\", \"spending\".\n\n## Commands\n\n| Command | Behavior |\n|---|---|\n| `\u002Ftelemetry` | Full hub — stats + command directory + settings |\n| `\u002Ftelemetry --costs` | Cost section only: session, today, all-time, by campaign |\n| `\u002Ftelemetry --hooks` | Hook activity only: last 20 fires with timing and outcomes |\n| `\u002Ftelemetry --verify` | Telemetry and artifact integrity check: verify hashes\u002Fsignatures, flag tampered records, report legacy records |\n| `\u002Ftelemetry --config` | Show current telemetry settings from harness.json |\n| `\u002Ftelemetry off` | Disable session summary, reduce hook verbosity |\n| `\u002Ftelemetry on` | Re-enable all telemetry |\n| `\u002Ftelemetry --threshold N` | Set cost alert threshold step (e.g. `--threshold 10` = alert every $10) |\n\n## Protocol\n\n### Step 1: COLLECT DATA\n\nRead the following in parallel. All are optional — treat missing files as zero\u002Fempty.\n\n**Live session cost:**\n- Run `node scripts\u002Fsession-tokens.js --today 2>\u002Fdev\u002Fnull` — captures real token data\n- If unavailable, read `.planning\u002Ftelemetry\u002Fcost-tracker-state.json` for burn rate\n- Real cost is always preferred over estimated. Mark clearly: `$X.XX` vs `$X.XX (est)`\n\n**Historical costs:**\n- Run `node scripts\u002Fsession-tokens.js --all 2>\u002Fdev\u002Fnull` for all-time real totals\n- Read last 20 lines of `.planning\u002Ftelemetry\u002Fsession-costs.jsonl` for recent sessions\n- For each entry: prefer `real_cost` > `override_cost` > `estimated_cost`\n\n**Hook activity:**\n- Read last 20 lines of `.planning\u002Ftelemetry\u002Fhook-timing.jsonl`\n- For each `event: \"timing\"` entry: extract `hook`, `duration_ms`, `timestamp`\n- For each `event: \"counter\"` entry: extract `hook`, `metric`\n- Check `.planning\u002Ftelemetry\u002Fhook-errors.jsonl` (last 20 lines) for recent blocks\n\n**Trust level:**\n- Read `.claude\u002Fharness.json` (Citadel's shared config path for all runtimes, including Codex) → `trust` object\n- Compute: novice (sessions \u003C 5), familiar (5-19), trusted (20+ with 2+ campaigns)\n- If `trust.override` set, use that\n\n**Settings:**\n- Read `.claude\u002Fharness.json` → `telemetry` object\n- Show current values with defaults if missing\n\n### Step 2: RENDER HUB\n\nOutput this format. Omit a section only if the data source is completely unavailable.\n\n```\n=== Citadel Telemetry ===\n\nCURRENT SESSION\n  Cost:       $X.XX [real] | $X.XX (est)\n  Duration:   N min | $X.XX\u002Fmin burn rate\n  Tokens:     NNK input | NK output | NK cache read | NK cache write\n  Messages:   N\n  Agents:     N spawned\n  Hooks fired: N (today)\n\nTODAY\n  $X.XX across N sessions\n  Most expensive: {slug or \"unattached\"} — $X.XX\n\nALL TIME\n  $X.XX across N sessions, N campaigns\n  Cache savings: ~$X.XX (cache reads vs full input price)\n\nBY CAMPAIGN (recent 5)\n  {slug}: $X.XX — N sessions\n  _unattached: $X.XX — N sessions\n\nHOOK ACTIVITY (last 10 fires)\n  {relative time} | {hook} | {duration_ms}ms | {outcome}\n  (no hook timing recorded yet)\n\nTRUST LEVEL\n  Level:    {novice | familiar | trusted}\n  Sessions: N completed\n  Campaigns: N completed\n  (novice = 0-4 sessions | familiar = 5-19 | trusted = 20+ with 2+ campaigns)\n\nTELEMETRY SETTINGS\n  Enabled:          {true | false}\n  Session summary:  {auto | always | off}   ← the [session] line at session end\n  Cost alerts:      {on | off}  at thresholds: {list or \"default ($5,$15,$30...)\"}\n  Hook timing:      {on | off}\n  Audit log:        {on | off}\n  — or, when harness.json is absent —\n  (harness.json not found — defaults active)\n  → Run \u002Fdo setup to unlock cost tracking, configure thresholds, and register your install.\n\nCOMMAND DIRECTORY\n  \u002Ftelemetry                            This screen\n  \u002Ftelemetry --costs                    Cost breakdown only\n  \u002Ftelemetry --hooks                    Hook activity only\n  \u002Ftelemetry --verify                   Telemetry\u002Fartifact integrity check (hash\u002Fsignature verification)\n  \u002Fcost                                 Deep cost exploration by session\u002Fcampaign\u002Fweek\n  \u002Fdashboard                            Full harness state (campaigns, fleet, all costs)\n\n  node scripts\u002Fsession-tokens.js --today   Today's sessions with exact token counts\n  node scripts\u002Fsession-tokens.js --all     All-time totals (real data, not estimates)\n\n  cat .planning\u002Ftelemetry\u002Fsession-costs.jsonl   Raw session cost log\n  cat .planning\u002Ftelemetry\u002Fhook-timing.jsonl     Raw hook execution log\n  cat .planning\u002Ftelemetry\u002Faudit.jsonl           Raw tool call audit log\n\nCONTROLS\n  \u002Ftelemetry off                        Disable session summary + reduce verbosity\n  \u002Ftelemetry on                         Re-enable\n  \u002Ftelemetry --threshold N              Alert every $N (writes to harness.json)\n  \u002Ftelemetry --config                   Edit settings interactively\n```\n\n### Step 3: SUB-COMMAND HANDLING\n\n**`\u002Ftelemetry off`:** Set `telemetry.sessionSummary = \"off\"` and `telemetry.costAlerts = false` in harness.json. Output: \"Telemetry summary disabled. Hook safety checks remain active.\" Safety hooks (protect-files, circuit-breaker, external-action-gate) are never disabled.\n\n**`\u002Ftelemetry on`:** Set `telemetry.sessionSummary = \"auto\"` and `telemetry.costAlerts = true`. Output: \"Telemetry re-enabled.\"\n\n**`\u002Ftelemetry --threshold N`:** Validate N is positive. Generate `[N, N*2, N*5, N*10, N*20, N*50, N*100]` (capped at 500). Write to `harness.json` under `policy.costTracker.thresholds`.\n\n**`\u002Ftelemetry --verify`:** Run the project verifier:\n\n```\nnode scripts\u002Fverify-telemetry-integrity.js\n```\n\nThe verifier scans `.planning\u002Ftelemetry\u002F*.jsonl` and `.planning\u002Fartifacts\u002F*.jsonl`. Display verified, signed, legacy, tampered, invalid, and signature-warning counts. Use `--strict-legacy` only when old unsigned records should fail the check.\n\nOutput format:\n```\n=== Telemetry Integrity ===\n\nfile.jsonl\n  Total records:    N\n  Verified (hash):  N\n  Verified (signed): N\n  Legacy (no hash): N\n  TAMPERED:         N\n  Invalid JSON:     N\n  Signature warnings: N\n\nStatus: CLEAN or FAILED\n```\n\nIf any tampered records: list each with `timestamp`, `event`, and both the stored and expected hash (first 16 chars each). Tampering can indicate log corruption, manual edits, or a bug — not necessarily malicious.\n\nIf only legacy records (no tampered): note \"Legacy records were written before telemetry integrity hashing was added. New telemetry and artifact records are hashed automatically.\"\n\n**`\u002Ftelemetry --config`:** Show current settings with the `node -e \"...\"` command to change each — don't auto-apply.\n\n### Step 4: ACCURACY BADGES\n\nAlways mark data source clearly:\n- `[real]` — data from Claude Code's native session JSONL (exact)\n- `(est)` — estimated from the fallback model ($1 base + $0.50\u002Fagent + $0.10\u002Fmin)\n- `(override)` — manually entered by the user\n\nNever blend real and estimated in the same total without flagging it.\n\n## What Telemetry Covers\n\n**Covered:** session cost (real token data), duration\u002Fburn rate\u002Fmessage count, agent spawn count, hook timing and outcomes, campaign cost attribution, trust level.\n\n**Not covered (by design):** per-tool-call cost, per-subagent cost isolation, real-time streaming token count.\n\n**Safety hooks always on (cannot be disabled):** protect-files, external-action-gate, circuit-breaker, quality-gate.\n\n## OTLP Export\n\nThe JSONL files under `.planning\u002Ftelemetry\u002F` stay canonical. For standard observability\nstacks, `scripts\u002Ftelemetry-otlp-export.js` translates new records into OTLP\u002FHTTP JSON\nmetrics and POSTs them to a collector. Byte offsets per source file live in\n`.planning\u002Ftelemetry\u002Fotlp-export-state.json`, so repeat runs export only new records.\n\n```bash\n# Preview the OTLP payload without sending or advancing state\nnode scripts\u002Ftelemetry-otlp-export.js --dry-run\n\n# Export new records to a local collector (\u002Fv1\u002Fmetrics appended when the url has no path)\nnode scripts\u002Ftelemetry-otlp-export.js --endpoint http:\u002F\u002Flocalhost:4318\n```\n\n| Metric | Type | Source file |\n|---|---|---|\n| `citadel.session.cost.usd` | sum (delta), `session.id` \u002F `cost.source` attributes | `session-costs.jsonl` |\n| `citadel.session.tokens` | sum (delta), `token.type` attribute | `session-costs.jsonl` |\n| `citadel.hook.duration.ms` | gauge, `hook.name` attribute | `hook-timing.jsonl` |\n| `citadel.agent.runs` | sum (delta), `run.status` \u002F `run.event` attributes | `agent-runs.jsonl` |\n\n`--reset` clears the offsets for a full re-export. On a non-2xx response or network\nerror the exporter exits 1 without advancing state, so the next run retries the same\nrecords. Data point timestamps come from the JSONL records, never the current clock.\nTest with `node scripts\u002Ftest-telemetry-otlp.js`.\n\n**Local collector demo:** `examples\u002Fotel-collector\u002F` contains a ready-made collector\nconfig (OTLP HTTP receiver on 4318, debug exporter to stdout) and a README with the\ntwo-command flow: `docker run` with the config mounted, then\n`node scripts\u002Ftelemetry-otlp-export.js --endpoint http:\u002F\u002Flocalhost:4318`. Without\nDocker, `--dry-run` prints the exact OTLP payload instead.\n\n## Quality Gates\n\n- Never show raw JSONL to the user — always parse and format\n- Cost totals must be labeled with their source (real \u002F est \u002F mixed)\n- `\u002Ftelemetry off` must NOT disable safety hooks — make this explicit in output\n- Relative timestamps required — no raw ISO strings in output\n- If all data sources are missing, show the empty-state version with setup hint\n\n## Fringe Cases\n\n- **`.planning\u002Ftelemetry\u002F` missing:** Show empty state with \"Run `\u002Fdo setup` to initialize telemetry.\"\n- **`session-tokens.js` unavailable:** Fall back to session-costs.jsonl; mark `(est)`.\n- **harness.json missing:** Show \"(harness.json not found — defaults active)\" and \"→ Run \u002Fdo setup to unlock cost tracking.\"\n- **`telemetry.enabled: false`:** Show banner \"Telemetry is disabled. Run `\u002Ftelemetry on` to re-enable.\"\n- **`--verify` with missing files:** Report \"No telemetry or artifact JSONL files found.\" Not an error.\n- **`--verify` when `scripts\u002Fverify-telemetry-integrity.js` is unavailable:** Report that the verifier is missing and show the raw file paths to inspect; do not claim hash verification ran.\n\n## Contextual Gates\n\n**Disclosure:** Read-only by default. `--threshold`, `off`, `on`, `--config` write `harness.json`.\n**Reversibility:** amber — `harness.json` writes; undo with `git checkout .claude\u002Fharness.json`.\n**Trust gates:** Any — no restrictions.\n\n## Exit Protocol\n\n\u002Ftelemetry does not produce a HANDOFF block. It is a read-only observability\ntool (except for `--threshold`, `off`, `on`, `--config` which write harness.json).\nAfter displaying output, wait for the next user command.\n",{"name":5,"license":15,"description":7,"auto-trigger":39,"last-updated":43,"user-invocable":44,"trigger_keywords":45},1775692800000,true,[5,46,47,48,49,50,51,52,19,53,54,55,36,56,57],"what did this cost","session cost","how much did that cost","how much have I spent","what hooks fired","trust level","show me telemetry","session stats","what telemetry","verify audit","check audit","tampered records","main","e1a3d45697a0f323aaedcbea0ab6a0387b5fe722","skills\u002Ftelemetry",84,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel","https:\u002F\u002Fsethgammon.github.io\u002FCitadel\u002F","https:\u002F\u002Fgithub.com\u002FSethGammon","Building Citadel, the repo-local operating layer for Claude Code and Codex. Persistent work, routing, verification, and coordinated agent fleets.","2026-11-13 02:05:13",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":44},[69,72,75],{"tool":70,"command":71},"npx","npx skills add SethGammon\u002FCitadel --skill telemetry",{"tool":73,"command":74},"bunx","bunx skills add SethGammon\u002FCitadel --skill telemetry",{"tool":76,"command":77},"pnpm","pnpm dlx skills add SethGammon\u002FCitadel --skill telemetry","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftelemetry\u002FSKILL.md",[],[81,106,135,158,181,200],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M6GXSBKE9A2HQWF8QRAZ4WJ5","workspace","Multi-repo campaign coordinator. Same lifecycle as fleet -- scope claims, discovery relay, wave-based execution -- but the unit of work is a repo, not a file. Coordinates campaigns across repositories with shared context.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fworkspace\u002FSKILL.md",[],[83,88,89,90,91,92,93,94,95,96,97,98,99,25,100,101,102,103,104,105],"repos","snowflake","multi-repo","work","context","campaign","coordinate","but","across","campaigns","shared","as","scope","add","unit","coordinator","fleet","claims",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":117,"publishedAt":38},"01M6GXS873AD1Y6RTM6GV47F3E","wiki","Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to ~400K words.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwiki\u002FSKILL.md",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[108,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,99,25,133,134],"vector","embeddings","librarian","markdown","knowledge","karpathy","knowledge management","karpathy wiki","up","files","maintain","self","knowledge base","project","db","sources","native",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":38},"01M6GXS2840SJ61285SZ43EJC3","watch","File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through \u002Fdo. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwatch\u002FSKILL.md",[],[137,20,142,143,144,145,146,147,148,149,150,151,127,152,153,154,155,156,25,157],"commit","tasks","git","batch","actions","start","sentinel","diff","auto","stop","do","scan","human","judgment","reactions","processing",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":167,"publishedAt":38},"01M6GXRXHYJ5RD9RZP81S2VFSW","verify","Self-test the Citadel hook pipeline from within a live session. Exercises real tool calls (Write, Edit, Bash, Read) and checks that hooks fired, telemetry accumulated, and no errors occurred. Reports HOOK HEALTH: PASS or HOOK HEALTH: FAIL with a per-hook breakdown.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fverify\u002FSKILL.md",[164],{"categoryNo":165,"categoryName":166,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000008","测试与质量",[160,168,5,169,170,171,172,173,174,175,31,30,176,129,177,25,21,178,179,180],"citadel","harness","pipeline","Bash","tool","read","write","edit","reports","live","errors","calls","true",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":38},"01M6GXRS9MCJFMQZ917H2XH3AC","unharness","Safely leave Citadel using the active adoption receipt. Produces a no-write, reviewable plan, preserves a portable archive, removes only exact owned material, and reports modified or externally registered surfaces as retained or unknown. Legacy installs must be imported before exact leave is claimed.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Funharness\u002FSKILL.md",[],[183,188,168,169,189,190,191,192,193,126,176,194,195,196,197,198,99,25,199,180],"uninstall","adoption","plan","archive","remove","only","Legacy","surfaces","clean","imported","active","material",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":204,"categories":205,"keywords":214,"publishedAt":38},"01M6GXRMEJ2VHD43R9FNPD4910","triage","GitHub issue and PR investigator. Pulls open issues\u002FPRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Use for investigating GitHub issues and reviewing PRs; do NOT use for general code review unrelated to GitHub issues.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftriage\u002FSKILL.md",[206,209],{"categoryNo":207,"categoryName":208,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":210,"categoryName":211,"taxonomyType":212,"taxonomyTypeDesc":213},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[202,215,216,217,218,219,220,221,222,223,224,225,226,227,152,25,228,229,230,180],"code review","review","review pr","pr","code","github issues","issues","open","use","unrelated","issue","general","references","line","investigator","reviews"]