Skip to content

docs(spec): add metrics baseline spec (metrics-baseline) - #4

Merged
inkatze merged 5 commits into
mainfrom
spec/metrics-baseline
Apr 9, 2026
Merged

docs(spec): add metrics baseline spec (metrics-baseline)#4
inkatze merged 5 commits into
mainfrom
spec/metrics-baseline

Conversation

@inkatze

@inkatze inkatze commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

Adds specs/metrics-baseline/ as a new sibling spec to specs/claude-context/. Defines a structured, encrypted-at-rest baseline of Claude Code usage metrics so the items in project_improvement_plan (memory) can be re-measured against a fixed reference point and deltas attributed to specific changes.

What's in the spec

  • Required dimensions: every volume and friction metric is reported per-project, per-machine (personal vs work), and main-thread vs subagent. Aggregates alone are insufficient.
  • Required metrics: corpus scope (incl. daily conversation counts), tool-call volumes, top tools, per-tool error rate, friction tallies (with Edit old_string mismatches and hook failures broken down by hook name as their own lines), permission prompts (approve/deny per tool), stuck-loop sessions, subagent type breakdown, slash command usage and success rate, MCP usage, hot-file re-reads, conversation outcomes, interaction style indicators.
  • Optional metrics: time-of-day, file-type breakdown, TodoWrite/Task usage, token/cost, top user opener verbs, top bash command patterns (the last is encrypted-only).
  • Encryption: snapshots stored as baseline-YYYY-MM.md.age using age with SSH-key recipients in plaintext recipients.txt. Schema and spec files stay plaintext. Pre-commit guard rejects staged plaintext baseline-*.md.
  • Report regeneration: schema is designed so both the full-data and anonymous HTML report variants the user already produces locally can be regenerated from the same snapshot by a deferred renderer.

Why now

This blocks the implementation of claude-context and other improvement-plan items whose effects should be measurable. Without a tracked baseline, "did this help?" stays unanswerable.

Test plan

  • Read requirements.md and confirm every dimension and metric is one you actually want measured.
  • Read design.md and confirm the encryption choice (age + SSH recipients, file-level) and the deferred-renderer / snapshot-as-data split are correct.
  • Read tasks.md and confirm the implementation order (schema → encryption surface → first snapshot → verify → cross-link → commit) matches your intended workflow.
  • Read test-spec.md and confirm the verification gates (schema conformance, encryption hygiene, sanity against memory numbers) are sufficient.
  • Confirm the pre-baseline acknowledgement approach (AGENTS.md → CLAUDE.md rename and terraform bump are baked in, not retro-measured) is acceptable.

inkatze added 2 commits April 8, 2026 15:13
Captures a structured, encrypted-at-rest baseline of Claude Code usage
metrics so improvement-plan items can be re-measured against a fixed
reference point. Schema covers per-project, per-machine, and main vs
subagent dimensions; includes permission prompts, hook failures by
name, slash command success rate, hot-file re-reads, conversation
outcomes, and subagent type breakdown. Snapshots are encrypted with
age using SSH-key recipients; schema and spec files stay plaintext.
Designed so both full-data and anonymous HTML reports can be
regenerated from the same snapshot by a deferred renderer.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new specs/metrics-baseline/ sibling spec that defines how to capture, encrypt, verify, and later re-measure a baseline snapshot of Claude Code usage metrics for attribution against improvement-plan changes.

Changes:

  • Introduces baseline requirements (dimensions/metrics), design decisions, implementation task order, and a manual verification checklist.
  • Specifies encrypted-at-rest snapshot storage using age + SSH recipients and a plaintext-protection guard.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
specs/metrics-baseline/requirements.md Defines required dimensions/metrics, encryption/storage constraints, and re-measurement protocol requirements
specs/metrics-baseline/design.md Documents rationale and key design choices (dimensions, encryption model, snapshot/report relationship)
specs/metrics-baseline/tasks.md Provides an ordered implementation plan for schema, encryption surface, first snapshot, verification, and cross-linking
specs/metrics-baseline/test-spec.md Manual verification checklist covering schema conformance, encryption hygiene, sanity checks, and diff hygiene

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/design.md Outdated
Comment thread specs/metrics-baseline/test-spec.md Outdated
Comment thread specs/metrics-baseline/test-spec.md Outdated
Comment thread specs/metrics-baseline/tasks.md Outdated
Comment thread specs/metrics-baseline/test-spec.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/requirements.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread specs/metrics-baseline/design.md Outdated
Comment thread specs/metrics-baseline/design.md Outdated
Comment thread specs/metrics-baseline/requirements.md Outdated
Comment thread specs/metrics-baseline/test-spec.md Outdated
Comment thread specs/metrics-baseline/test-spec.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@inkatze
inkatze merged commit 7030ba4 into main Apr 9, 2026
12 of 14 checks passed
@inkatze
inkatze deleted the spec/metrics-baseline branch April 9, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants