Skip to content

Conversation

@vaclisinc
Copy link
Contributor

@vaclisinc vaclisinc commented Aug 1, 2025

Summary

  • Added configuration option to disable subagent notifications
  • Implemented subagent activity tracking for inclusion in completion emails
  • Improved activity detail capture and display format
  • Add proper HTML escaping for email notifications.

Changes Made

1. Configuration Option

  • Added enableSubagentNotifications config option (defaults to false)
  • Subagent notifications can now be disabled to reduce notification noise

2. Activity Tracking

  • Created SubagentTracker utility to record subagent activities
  • Activities are included in completion emails as "Subagent Activities Summary"
  • Users get full visibility without frequent interruptions

3. Improved Display

  • Enhanced activity capture (up to 1000 chars vs 200)
  • Better visual formatting in emails
  • Detection for initialization-only captures
  • Added configuration for activity detail level

4. HTML escaping problem

  • Added _escapeHtml function to escape HTML entities
  • Applied escaping to all user-generated content in emails
  • Fixed the issue where HTML-like strings (e.g. <developer>) were being
    hidden

Test Plan

  • Tested disabling subagent notifications
  • Verified activities are tracked correctly
  • Confirmed activities appear in completion emails
  • Tested with multiple subagent executions
  • Ensure all HTML special characters are escaped and displayed in email

Fixes #9
Fixes #12

vaclisinc and others added 3 commits August 1, 2025 12:49
- Added 'enableSubagentNotifications' config option (default: false)
- Modified notification handler to check config before sending subagent notifications
- Created documentation explaining the feature
- Updated README with note about subagent notifications

This addresses the issue where frequent subagent notifications can be distracting.
Users can now control whether they receive notifications when subagents stop/start.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Track subagent activities instead of sending individual notifications
- Include subagent activity summary in completion emails
- Update email templates to display subagent activities
- Add SubagentTracker utility to manage activity tracking
- Update documentation to explain the new behavior

This provides a better user experience by:
1. Reducing notification noise from frequent subagent activities
2. Still providing full visibility into what subagents did
3. Consolidating all information in the completion email

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Enhanced activity capture to include up to 1000 characters (was 200)
- Improved email display format with better visual separation
- Added detection for initialization-only captures with helpful message
- Added configuration option for activity detail level
- Created comprehensive documentation explaining the timing limitation
- Added visual indicators for processing status

This addresses the issue where subagent outputs were truncated or only
showed initialization messages. Users now get better visibility into
what subagents are doing, with clear indication when full output is
available in tmux.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@vaclisinc
Copy link
Contributor Author

@JessyTsui The conflict doesn’t seem critical since the .json files are used as a local database. I’d actually suggest adding them to .gitignore to avoid future conflicts.

As for the README change — it’s because the subagent hook feature is now integrated into the main mail thread, so there’s no need to keep it disabled by default anymore.

And the subagent function demo looks like this:
image

vaclisinc and others added 3 commits August 1, 2025 14:00
- Add _escapeHtml function to properly escape HTML entities in emails
- Escape user-generated content to prevent HTML tags from being hidden
- Fix issue where <developer> and other HTML-like strings disappeared in emails
- Apply escaping to both main email content and subagent activity summaries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@vaclisinc
Copy link
Contributor Author

I solve the conflict, update some of the README (wrong date and add some notes for usage), and fix #12.

@JessyTsui
Copy link
Owner

@vaclisinc Great design decision to solve the notification noise issue.

The PR mentions ./docs/SUBAGENT_NOTIFICATIONS.md and 'docs/SUBAGENT_ACTIVITY_DETAILS.md', but I don't see the files in the PR. whats these

@vaclisinc
Copy link
Contributor Author

vaclisinc commented Aug 1, 2025

@JessyTsui Thanks! I had removed those two docs to keep the PR cleaner — they were just internal explanations generated by claude code.

Here’s a quick summary:

  • SUBAGENT_NOTIFICATIONS.md explained how to control whether subagent “waiting” notifications are sent via the enableSubagentNotifications config (default is false to reduce noise).
  • ISSUE_TEMPLATE_SUBAGENT.md described the original problem: subagents were sending too many emails, causing confusion in workflows. The proposed solution was to disable those hooks by default and let power users re-enable them if needed.

Happy to restore the docs if you think they’re useful to keep (in my older commit)!

@vaclisinc vaclisinc changed the title Fix #9: Add configuration to disable subagent notifications Fix #9 #12: Add configuration to disable subagent notifications Aug 1, 2025
@JessyTsui
Copy link
Owner

Cool Let's merge it

@JessyTsui JessyTsui merged commit 5159e53 into JessyTsui:master Aug 1, 2025
vaclisinc added a commit to vaclisinc/Claude-Code-Remote that referenced this pull request Aug 1, 2025
- Added entry for subagent notifications configuration (PR JessyTsui#10)
- Added entry for execution trace feature (issue JessyTsui#11)
- Maintained chronological order in changelog

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
JessyTsui added a commit that referenced this pull request Aug 1, 2025
* Add configuration option to disable subagent notifications

- Added 'enableSubagentNotifications' config option (default: false)
- Modified notification handler to check config before sending subagent notifications
- Created documentation explaining the feature
- Updated README with note about subagent notifications

This addresses the issue where frequent subagent notifications can be distracting.
Users can now control whether they receive notifications when subagents stop/start.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Add subagent activity tracking in completion emails

- Track subagent activities instead of sending individual notifications
- Include subagent activity summary in completion emails
- Update email templates to display subagent activities
- Add SubagentTracker utility to manage activity tracking
- Update documentation to explain the new behavior

This provides a better user experience by:
1. Reducing notification noise from frequent subagent activities
2. Still providing full visibility into what subagents did
3. Consolidating all information in the completion email

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Improve subagent activity details and documentation

- Enhanced activity capture to include up to 1000 characters (was 200)
- Improved email display format with better visual separation
- Added detection for initialization-only captures with helpful message
- Added configuration option for activity detail level
- Created comprehensive documentation explaining the timing limitation
- Added visual indicators for processing status

This addresses the issue where subagent outputs were truncated or only
showed initialization messages. Users now get better visibility into
what subagents are doing, with clear indication when full output is
available in tmux.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* delete redundant files and modify README

* Fix HTML escaping in email notifications

- Add _escapeHtml function to properly escape HTML entities in emails
- Escape user-generated content to prevent HTML tags from being hidden
- Fix issue where <developer> and other HTML-like strings disappeared in emails
- Apply escaping to both main email content and subagent activity summaries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Add full execution trace to email notifications

- Add getFullExecutionTrace method to capture complete terminal output
- Include execution trace in a scrollable section within emails
- Add CSS styling for visible scrollbars on desktop
- Clean trace output by removing command prompt boxes
- Add fallback message when trace is not available

This addresses issue #11 - providing transparency about task execution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Redesign email notification UI with improved terminal aesthetics

- Reorganize content hierarchy: user request at top, response second, trace at bottom
- Preserve terminal-style commands ($ cat, $ claude-code execute, etc.)
- Remove redundant session info footer
- Implement smart execution trace capture from user input to completion
- Add TraceCapture utility to track user input timestamps
- Improve visual hierarchy while maintaining terminal aesthetics
- Use border colors (orange for user, green for success) for better distinction
- Make execution trace collapsible and de-emphasized

This improves readability while preserving the terminal charm of the project.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Fix execution trace filtering to show only recent activity

- Change filter logic to find LAST user input instead of first
- Search backwards through content to find most recent "> " prompt
- Only include content from that point forward
- Add fallback to show last 100 lines if no user input found
- This ensures trace shows only relevant recent execution, not entire history

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Remove duplicate content from execution trace

- Skip the first user input line (already shown in main content)
- Skip the last Claude response (already shown in main content)
- Only show intermediate execution steps and tool usage
- Clean up empty lines at beginning and end
- This avoids redundancy and focuses trace on execution details

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Fix execution trace to properly remove complete user input and output

- Track multi-line user input and skip all continuation lines
- Detect when user input ends (empty line or next command)
- Stop before the last Claude response to avoid truncation
- Only show intermediate execution steps between input and output

This ensures the trace shows the complete execution process without
duplicating content already displayed in the main sections.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Fix multi-line user input capture and trace filtering

- Capture complete multi-line user input (not just first line)
- Join continuation lines with spaces for proper display
- Preserve all execution details in trace (tool calls, outputs)
- Only skip user input and final response, keep everything in between

* Add configuration toggle for subagent activities in email

- Added 'showSubagentActivitiesInEmail' config option (default: false)
- Modified claude-remote.js to check config before including subagent activities
- Created documentation explaining the configuration
- Allows users to choose between concise emails (execution trace only) or detailed emails (both summaries)

This addresses the redundancy between execution trace and subagent activities summary,
giving users control over email content.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Fix Git merge conflict in email template and document subagent config

- Removed Git merge conflict markers from email text template
- Added documentation for showSubagentActivitiesInEmail config in README
- Explained that subagent activities are disabled by default for concise emails

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Update README changelog for PR #10 and issue #11

- Added entry for subagent notifications configuration (PR #10)
- Added entry for execution trace feature (issue #11)
- Maintained chronological order in changelog

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* delete redundant files

* fix #15: add local database into .gitignore

* Fix execution trace display in email notifications

- Remove collapsible details tag for better email client compatibility
- Add configuration option to toggle execution trace display
- Fix HTML escaping issue for executionTraceSection variable

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Remove data files from git tracking

These session-specific data files should not be tracked in version control
as they are machine-specific and cause issues when pulling on other machines.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix typo(?) in changelog (#13)

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Naich <[email protected]>
Co-authored-by: JessyTsui <[email protected]>
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.

[bug] Angle brackets (<developer>) disappear in email due to HTML rendering [suggestion] Avoid sending separate emails for sub-agent stop events

2 participants