Skip to content

Add sanitized Claude Code fixtures and a privacy gate - #14

Merged
thymeed merged 1 commit into
masterfrom
feat/claude-code-fixtures
Nov 13, 2026
Merged

thymeed merged 1 commit into
masterfrom
feat/claude-code-fixtures

Conversation

@thymeed

@thymeed thymeed commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

First step toward reading Claude Code transcripts. This PR adds test fixtures and the tooling that keeps them safe; it does not change the bridge or the dashboard.

Change

  • Add scripts/sanitize-claude-transcript.js, a read-only tool that turns a real Claude Code session (parent file, subagents/ files and their meta.json) into a fixture. Keys, values and ids are allowlisted or hashed, so no text, path or name survives. Ids are hashed with a random per-run salt, and numbers are zeroed outside known keys.
  • Add sanitized fixtures under test/fixtures/claude-code/real/: a Windows-style and a WSL-style project folder, two subagent transcripts with their meta.json, with neutral names.
  • Add test/unit/claude-code-format.test.js, which pins the line shapes seen on disk: Agent delegation, async_launched results, task notifications, repeated message.id lines whose usage can grow, timestamps and usage on every conversation line. Synthetic cases (an over-8 KB line, a cut-off last line, a partial-usage line) are labelled as such.
  • Add test/unit/fixture-privacy.test.js, which fails if any fixture file name or content holds owner names, home-path forms, JSON-escaped variants, or epoch-millisecond numbers, and checks that every key is allowlisted or hashed.
  • Add test/unit/sanitize-claude-transcript.test.js for the sanitizer itself.
  • Skip the fixtures in Prettier, and add the new files to the key-files table in CLAUDE.md (Prettier re-padded the table, so every row shows in the diff).

Notes for review

  • Fixtures are built from real sessions and contain no readable prompt, tool output, path or name.
  • Fixtures are about 150 KB, larger than a minimal set, because of per-line metadata.
  • CLAUDE.md Limits still describes the Cursor format only ("no timestamp, no usage"). Claude Code lines do carry both; that wording is left for a later change.

Verification

Run locally before pushing: npm run lint, npm run format:check and npm test all pass (212 tests, 0 failures). No user-facing behavior changed, so there was no hand check.

Add real-shape Claude Code fixtures (Windows and WSL-style project folders, subagent files and meta files) built by scripts/sanitize-claude-transcript.js, which allowlists keys and values and hashes ids with a per-run salt.

Add format tests that pin the verified Claude Code line shapes, a sanitizer test, and a privacy test that fails on owner names, home-path forms and epoch-millisecond numbers in any fixture file or folder name.

Gitignore CLAUDE.local.md and .scratch/.
@thymeed
thymeed force-pushed the feat/claude-code-fixtures branch from 75a9f20 to e4562fe Compare November 13, 2026 06:07
@thymeed
thymeed merged commit 1f7ea18 into master Nov 13, 2026
3 checks passed
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.

1 participant