Patrick Honkonen 3be876a83b
Add comprehensive session logging hooks
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.
2025-10-23 18:21:49 -04:00
2025-08-25 18:18:38 +00:00
2023-07-14 11:56:49 -05:00
2023-07-14 11:56:49 -05:00
2024-06-20 17:08:07 +01:00
2024-06-20 17:08:07 +01:00

Bitwarden Android

Contents

Compatibility

  • Minimum SDK: 29
  • Target SDK: 35
  • Device Types Supported: Phone and Tablet
  • Orientations Supported: Portrait and Landscape

Setup

  1. Clone the repository:

    $ git clone https://github.com/bitwarden/android
    
  2. Create a user.properties file in the root directory of the project and add the following properties:

  3. Setup the code style formatter:

    All code must follow the guidelines described in the Code Style Guidelines document. To aid in adhering to these rules, all contributors should apply docs/bitwarden-style.xml as their code style scheme. In IntelliJ / Android Studio:

    • Navigate to Preferences > Editor > Code Style.
    • Hit the Manage button next to Scheme.
    • Select Import.
    • Find the bitwarden-style.xml file in the project's docs/ directory.
    • Import "from" BitwardenStyle "to" BitwardenStyle.
    • Hit Apply and OK to save the changes and exit Preferences.

    Note that in some cases you may need to restart Android Studio for the changes to take effect.

    All code should be formatted before submitting a pull request. This can be done manually but it can also be helpful to create a macro with a custom keyboard binding to auto-format when saving. In Android Studio on OS X:

    • Select Edit > Macros > Start Macro Recording
    • Select Code > Optimize Imports
    • Select Code > Reformat Code
    • Select File > Save All
    • Select Edit > Macros > Stop Macro Recording

    This can then be mapped to a set of keys by navigating to Android Studio > Preferences and editing the macro under Keymap (ex : shift + command + s).

    Please avoid mixing formatting and logical changes in the same commit/PR. When possible, fix any large formatting issues in a separate PR before opening one to make logical changes to the same code. This helps others focus on the meaningful code changes when reviewing the code.

  4. Setup JDK Version 21:

    • Navigate to Preferences > Build, Execution, Deployment > Build Tools > Gradle.
    • Hit the selected Gradle JDK next to Gradle JDK:.
    • Select a 21.x version or hit Download JDK... if not present.
    • Select Version 21.
    • Select your preferred Vendor.
    • Hit Download.
    • Hit Apply.
  5. Setup detekt pre-commit hook (optional):

Run the following script from the root of the repository to install the hook. This will overwrite any existing pre-commit hook if present.

echo "Writing detekt pre-commit hook..."
cat << 'EOL' > .git/hooks/pre-commit
#!/usr/bin/env bash

echo "Running detekt check..."
OUTPUT="/tmp/detekt-$(date +%s)"
./gradlew -Pprecommit=true detekt > $OUTPUT
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
  cat $OUTPUT
  rm $OUTPUT
  echo "***********************************************"
  echo "                 detekt failed                 "
  echo " Please fix the above issues before committing "
  echo "***********************************************"
  exit $EXIT_CODE
fi
rm $OUTPUT
EOL
echo "detekt pre-commit hook written to .git/hooks/pre-commit"
echo "Making the hook executable"
chmod +x .git/hooks/pre-commit

echo "detekt pre-commit hook installed successfully to .git/hooks/pre-commit"

Dependencies

Application Dependencies

The following is a list of all third-party dependencies included as part of the application beyond the standard Android SDK.

The following is an additional list of third-party dependencies that are only included in the non-F-Droid build variants of the application.

Development Environment Dependencies

The following is a list of additional third-party dependencies used as part of the local development environment. This includes test-related artifacts as well as tools related to code quality and linting. These are not present in the final packaged application.

CI/CD Dependencies

The following is a list of additional third-party dependencies used as part of the CI/CD workflows. These are not present in the final packaged application.

Description
Bitwarden mobile app for Android.
Readme 280 MiB
2025-08-27 15:15:00 -05:00
Languages
Kotlin 99.8%
Ruby 0.1%