This commit introduces a comprehensive session logging system for Claude Code. The system uses a set of hooks to automatically capture all session activity for retrospective analysis, writing logs to the `.claude/skills/retrospecting/logs/` directory.
The primary goal of this feature is to enable detailed session analysis by the `retrospecting` skill. Logs are generated in two formats:
- **NDJSON (`.ndjson`):** A compact, machine-readable format optimized for programmatic analysis.
- **Markdown (`.md`):** A human-readable format for manual review of the session.
This change introduces the following components:
- **`logging_utils.py`**: A shared Python module that provides a `SessionLogger` class to handle the creation and appending of log entries in both NDJSON and Markdown formats. It includes fail-safe error handling to prevent logging issues from disrupting the user's session.
- **Session Hooks**: A suite of executable Python scripts in `.claude/hooks/` that are triggered by different events in a Claude Code session:
- `SessionStart`: Initializes log files when a session begins.
- `UserPromptSubmit`: Logs each prompt submitted by the user.
- `PostToolUse`: Records every successful tool execution.
- `Stop`: Captures Claude's final response by parsing the session transcript.
- `SubagentStop`: Logs the completion of a subagent task.
- `SessionEnd`: Finalizes the logs when the session concludes.
- **Documentation**:
- `README.md`: Explains the logging system, log formats, and maintenance.
- `SUMMARY.md`: Provides a high-level overview of the implementation.
- `VERIFICATION.md`: Contains steps to verify that the hooks are working correctly.
- **Testing**:
- `test_hooks.sh`: An automated test script to ensure all hooks are executable and function as expected.
- **Skill Integration**:
- Updates to the `retrospecting` skill (`SKILL.md`) to utilize the new logs for its analysis.
- New context files for the `retrospecting` skill: `session-analytics.md` and `retrospective-templates.md` to guide analysis and report generation.
- A `.gitignore` file is added to the `retrospecting` skill directory to exclude the `logs/` folder from version control.
This commit updates the `reviewing-changes/SKILL.md` document to improve readability. Code formatting (using backticks) has been applied to file paths, file extensions, and code-specific terms such as `StateFlow`, `@HiltViewModel`, and `biometricPrompt`.
This commit removes parenthetical line number references from the `reviewing-changes/SKILL.md` file. These references pointed to the `CLAUDE.md` file and were removed to improve readability and prevent them from becoming outdated as `CLAUDE.md` changes.
This commit updates the `.github/CODEOWNERS` file to establish ownership for Claude-related files.
A new rule has been added that assigns ownership of all files and subdirectories within the `.claude/` directory to the `@bitwarden/team-ai-sme` team. This ensures that the appropriate team is automatically requested for review on any pull requests modifying these files.
This commit introduces a new `reviewing-changes` skill to formalize the code review process for Bitwarden Android. The skill provides a structured, step-by-step guide for conducting comprehensive code reviews, covering context, compliance, documentation, and providing actionable feedback.
The primary `CLAUDE.md` file has been refactored to be more concise by removing redundant horizontal rule separators. Additionally, the `review-code.md` prompt has been updated to directly invoke the new `reviewing-changes` skill, simplifying the review initiation process.
This commit overhauls the `CLAUDE.md` file to provide a more comprehensive set of guidelines for AI-assisted development on the Bitwarden Android project.
The updated document establishes clear directives and standards, including:
* Core directives emphasizing adherence to project architecture, code style, and established patterns.
* An overview of module organization and key architectural patterns like MVVM, Hilt, and UDF.
* Security requirements that must be considered with every change.
* A structured workflow covering pre-implementation, implementation, and post-implementation steps.
* A list of anti-patterns to avoid.
* Guidelines for communication, decision-making, and when to seek clarification.
* A refined list of essential reference documents.