feat: add context input telemetry event helper#9
Open
caioribeiroclw-pixel wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
TelemetryHooks.record_context_input_loaded(...)helper that emits acontext.input.loadedevent on the active session span.The event is intentionally privacy-preserving: callers pass paths/URIs, hashes, and categorical metadata, not raw prompts, raw context bodies, tool arguments, memory contents, secrets, or full transcripts.
Why
claude_telemetryalready makes tool/model execution observable. For headless Claude Code / CI runs, another useful debugging question is: which repo instructions, skills, hooks, or memory records entered the session before the model/tool spans happened?This is a small step toward the idea from #8 without changing default behavior or requiring the wrapper to inspect project context.
Checks
python3 -m py_compile claude_telemetry/hooks.py tests/test_hooks.pygit diff --checkI could not run
pytest/ruffin this container because Python packaging tools are not installed (pytest: command not found,python3 -m pip: No module named pip, andpython3 -m venvis missingensurepip).