Session Interaction Logger
Comprehensive, detailed logging of every AI-assisted interaction for audit trails, evaluation evidence, and project history documentation.
Overview
This skill enhances the existing session-logger hook to capture full interaction detail — not just events, but the complete content of prompts, AI reasoning, decisions made, files modified, commands executed, and test results. All logs are stored in logs/copilot/ as structured JSON for easy parsing and report generation.
When to Use This Skill
- •At the start of every coding session (automatic via hook)
- •After each user prompt to log the full request context
- •When making code changes to record what was modified and why
- •When running commands to capture inputs and outputs
- •When asked to export or generate an audit report
- •When preparing deliverables for AI-usage evaluation
Why This Skill Exists
This project is being evaluated on:
- •Full project history with prompts, context, and chat histories used to steer the AI
- •Robust automated tests (Unit and Integration) proving correctness and reliability
- •Clear documentation of decisions, assumptions, and how output was refined
This skill provides artifact #1 — a complete, verifiable record of all AI interactions.
Log Files
All logs are written to logs/copilot/ (created automatically):
| File | Purpose | Format |
|---|---|---|
session.log | Session start/end events | JSONL |
prompts.log | Prompt submission events | JSONL |
interactions.log | Full interaction detail (prompt + response + context) | JSONL |
file-changes.log | Every file created/modified/deleted with diffs | JSONL |
commands.log | Every terminal command and its output summary | JSONL |
decisions.log | Architectural and design decisions with rationale | JSONL |
session-report.md | Human-readable session summary (on-demand export) | Markdown |
Log Schema
interactions.log
{
"timestamp": "2026-02-14T10:30:00Z",
"sessionId": "abc123",
"sequenceNumber": 1,
"type": "user-prompt | ai-response | clarification | refinement",
"content": "Full text of the prompt or response",
"context": {
"activeFile": "src/main/java/com/addi/challenge/Main.java",
"openFiles": ["..."],
"taskInProgress": "Implement lead validation"
},
"metadata": {
"tokensEstimate": 150,
"toolsUsed": ["read_file", "create_file"],
"filesReferenced": ["design-doc.md"]
}
}
file-changes.log
{
"timestamp": "2026-02-14T10:35:00Z",
"sessionId": "abc123",
"action": "create | modify | delete",
"filePath": "src/main/java/com/addi/challenge/domain/Lead.java",
"reason": "Implement Lead record per design doc section 3.2",
"linesAdded": 25,
"linesRemoved": 0,
"diffSummary": "Created Lead record with fields: id, firstName, lastName, email, birthDate, nationalId"
}
commands.log
{
"timestamp": "2026-02-14T10:40:00Z",
"sessionId": "abc123",
"command": "./gradlew test",
"purpose": "Run unit tests after implementing Lead validation",
"exitCode": 0,
"outputSummary": "BUILD SUCCESSFUL - 12 tests passed",
"duration": "3.2s"
}
decisions.log
{
"timestamp": "2026-02-14T10:32:00Z",
"sessionId": "abc123",
"decision": "Use Java Records for domain model",
"rationale": "Records provide immutability, auto-generated equals/hashCode/toString, and align with Java 25 best practices",
"alternatives": ["Traditional POJO with Lombok", "Plain class with manual methods"],
"context": "Design doc section 3.2 specifies immutable domain objects",
"category": "architecture | design | implementation | testing | tooling"
}
Step-by-Step Workflows
Workflow 1: Log a Full Interaction
After every user prompt and your response, append to logs/copilot/interactions.log:
- •Generate a
sessionId(reuse from session start or generate UUID) - •Increment
sequenceNumberfor ordering - •Log the user's prompt with
type: "user-prompt" - •Log your response summary with
type: "ai-response" - •Include context: active file, task being worked on, tools used
Script: Use scripts/log-interaction.sh to append entries:
.github/skills/session-interaction-logger/scripts/log-interaction.sh \ --type "user-prompt" \ --content "Implement the Lead domain record" \ --active-file "Main.java" \ --session-id "$SESSION_ID"
Workflow 2: Log File Changes
Every time you create, modify, or delete a file:
- •Record the file path, action type, and reason
- •Summarize the diff (lines added/removed, key changes)
- •Append to
logs/copilot/file-changes.log
Workflow 3: Log Commands
Every time a terminal command is executed:
- •Record the command, its purpose, and output summary
- •Include exit code and duration
- •Append to
logs/copilot/commands.log
Workflow 4: Log Decisions
When making architectural or design decisions:
- •State the decision clearly
- •Document the rationale and alternatives considered
- •Reference relevant context (design doc sections, requirements)
- •Append to
logs/copilot/decisions.log
Workflow 5: Export Session Report
When asked to export or generate a report, run:
.github/skills/session-interaction-logger/scripts/export-session-report.sh
This generates logs/copilot/session-report.md with:
- •Session timeline
- •All prompts and response summaries
- •Files created/modified with reasons
- •Commands executed with results
- •Decisions made with rationale
- •Test results summary
Integration with Existing Hooks
This skill enhances the existing session-logger hook scripts. The hooks capture events automatically; this skill adds content-level detail on top of those events.
| Hook | Existing Behavior | Enhanced Behavior |
|---|---|---|
sessionStart | Logs timestamp + cwd | Also initializes session ID, creates interaction log header |
sessionEnd | Logs timestamp | Also generates session summary stats |
userPromptSubmitted | Logs timestamp | Also captures full prompt text and context |
Best Practices
| Practice | Why |
|---|---|
| Log immediately after each action | Ensures nothing is lost if session ends unexpectedly |
| Use structured JSON (JSONL) | Enables programmatic analysis and report generation |
| Include rationale with every change | Evaluators want to see why, not just what |
| Summarize diffs, don't dump raw code | Keeps logs readable while preserving intent |
| Track sequence numbers | Allows reconstructing the exact order of interactions |
| Reference design doc sections | Links implementation decisions to requirements |
Privacy & Security
- •
logs/is in.gitignore— logs never get committed by accident - •No secrets, tokens, or credentials are logged
- •Prompt content is logged as-is; ensure no sensitive data in prompts
- •To disable: set
SKIP_LOGGING=trueenvironment variable
Quick Reference
# View latest interactions tail -20 logs/copilot/interactions.log | jq . # Count interactions in current session wc -l logs/copilot/interactions.log # View all decisions cat logs/copilot/decisions.log | jq . # Export full session report .github/skills/session-interaction-logger/scripts/export-session-report.sh # View file change history cat logs/copilot/file-changes.log | jq '.filePath + " - " + .action + " - " + .reason'