Fix Markdown/JSON rendering issues in tool calls#11
Closed
ShlomoStept wants to merge 3 commits intomainfrom
Closed
Fix Markdown/JSON rendering issues in tool calls#11ShlomoStept wants to merge 3 commits intomainfrom
ShlomoStept wants to merge 3 commits intomainfrom
Conversation
Add visual indicators and metadata extraction for Task and Agent tool calls that spawn subagent processes. This enhancement helps users understand when and why Claude Code spawns subagents during session processing. Features: - Detect Task and Agent tool calls as subagent spawning operations - Extract subagent_type (Explore, Plan, code-reviewer, etc.) - Show visual badge with subagent type in purple gradient - Display truncated prompt preview for context - Indicate resume operations when resuming existing agents - Find related agent session files in the same directory - Extract agent IDs from tool results Visual improvements: - Purple left border for subagent tools (distinct from other tools) - Gradient badge with lightning bolt icon - Prompt preview with styled container - Resume indicator for continued sessions Tests: - 16 new tests covering all subagent detection functionality - Tests for is_subagent_tool, extract_subagent_info - Tests for extract_agent_id_from_result with strict patterns - Tests for find_related_agent_sessions - Tests for render_subagent_tool rendering - CSS presence verification tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document proposed enhancements to improve usability, maintainability, and scalability of claude-code-transcripts: 1. Session Timeline View (Priority P1, Medium effort) - Interactive timeline visualization at top of session pages - Color-coded segments for different activity types - Click-to-navigate functionality - Temporal flow understanding for long sessions 2. Diff View for Edit Operations (Priority P1, Medium effort) - Unified diff display for old_string/new_string comparisons - Side-by-side and unified view modes - Syntax highlighting preserved - Uses standard library difflib 3. Keyboard Navigation (Priority P2, Low-Medium effort) - Comprehensive shortcuts for session navigation - Cell expansion/collapse with single keys - View mode switching (Markdown/JSON) - Accessibility improvements (WCAG 2.1) Each proposal includes: - Problem statement - Proposed solution with implementation details - Files to modify and key code changes - Estimated effort - User impact analysis - Technical considerations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update PLAN.md with comprehensive Phase 3 grading report: - Overall score: 85.01 (up from 83.24, +1.77) - Templates (macros.html): 86.20 (+1.0) - Core (__init__.py): 82.45 (+1.95) - Tests: 89.45 (+2.3) Key improvements: - C.1 Subagent Detection fully implemented - 16 new tests (157 total), all passing - FEATURE_PROPOSALS.md with 3 detailed proposals - New functions follow established patterns Cumulative improvement from Phase 2 initial: +3.73 points 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive subagent detection and visualization features for Task and Agent tool calls, addressing markdown/JSON rendering issues in assistant cells with tool calls.
Key changes:
- Added subagent detection system with visual badges and metadata display
- Implemented 16 new comprehensive tests for subagent functionality
- Enhanced HTML generation with specialized rendering for Task/Agent tools
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_generate_html.py |
Added 16 new tests covering subagent detection, extraction, and rendering functionality |
tests/__snapshots__/*.html |
Updated snapshot files to include new subagent CSS styles (purple gradients, badges, prompt previews) |
src/claude_code_transcripts/templates/macros.html |
Added new subagent_tool macro for rendering Task/Agent tools with specialized badge and prompt preview display |
src/claude_code_transcripts/__init__.py |
Implemented subagent detection functions (is_subagent_tool, extract_subagent_info, extract_agent_id_from_result, find_related_agent_sessions, render_subagent_tool) and added corresponding CSS styles |
PLAN.md |
Documented Phase 3 completion with subagent detection implementation, grading report showing improvement from 83.24 to 85.01 |
FEATURE_PROPOSALS.md |
Added new file with three detailed feature proposals: Session Timeline View (P1), Diff View for Edits (P1), and Keyboard Navigation (P2) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
Author
|
Closing - changes consolidated for upstream PR submission |
ShlomoStept
pushed a commit
that referenced
this pull request
Jan 9, 2026
* Add batch command for converting all sessions to HTML archive Adds a new `batch` command that converts all local Claude Code sessions into a browsable HTML archive with: - Master index listing all projects with session counts - Per-project pages listing sessions by date - Individual session transcripts (using existing generate_html) New features: - `find_all_sessions()` - discovers sessions grouped by project - `get_project_display_name()` - extracts readable names from encoded paths - `--dry-run` flag to preview what would be converted - `--include-agents` flag to include agent-* session files - Progress indicator during conversion Usage: claude-code-transcripts batch -o ./my-archive 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Refactor batch command for better code reuse and error handling - Move datetime import to module level for consistency - Add progress_callback parameter to generate_batch_html() for progress reporting - Add try/except around individual session conversion with failed_sessions tracking - Refactor batch_cmd() to use generate_batch_html() instead of duplicating the loop - Add --quiet/-q flag to suppress non-error output for scripting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix --quiet flag not respected in dry-run mode - Wrap dry-run output in `if not quiet` check - Add test for --quiet with --dry-run combination - Add .playwright-mcp/ to .gitignore - Rename html variable to html_content to avoid shadowing html module - Remove unused imports from test file 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add batch command documentation to README Document the new batch command that converts all local Claude Code sessions to a browsable HTML archive with master and project indexes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Rename batch command to all https://gistpreview.github.io/?be627e42c25a1ffdf39cfb2f9a79f1ff/index.html Refs simonw#11 (comment) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Simon Willison <swillison@gmail.com>
ShlomoStept
pushed a commit
that referenced
this pull request
Jan 9, 2026
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.
Summary
Known Issues Being Addressed
Test plan
uv run pytest🤖 Generated with Claude Code