Collapse code blocks with symmetrical dual controls, download functionality, double-click toggle, and typing animation - Auto-copy disabled - Fixed event handler error
目前為
Code Block Collapser for Claude.ai v24
📦 Claude Code Block Collapser - Tampermonkey Userscript
📋 Overview
Claude Code Block Collapser enhances code management on Claude.ai by transforming cluttered code blocks into clean, collapsible sections with dual symmetrical controls, ensuring a streamlined workspace while preserving full access to all code.
✨ Key Features
| Feature | Description |
|---|---|
| Collapsible Code Blocks | Minimize code blocks to save screen space and reduce visual clutter |
| Symmetrical Dual Controls | Copy, download, expand, and collapse buttons on both left and right sides |
| One-Click Copy & Download | Copy to clipboard or save as .txt files with visual feedback |
| Double-Click Toggle | Quickly expand/collapse by double-clicking headers or content |
| Typing Animation | Visual gradient shows when Claude is actively generating code |
🎯 Perfect Use Cases
🚀 How It Works
Typing Detection System
🟡 Active Phase: Animated gradient header, buttons disabled until complete 🔴 Complete: Gray header, all controls active and ready to use
Smart Recognition
Detects code blocks 20+ characters, extracts language labels and script titles from comments, supports all major programming languages.
Workflow
Auto-detects new code → Auto-collapses when complete → Dual controls appear → Copy/download/expand with one click → Visual feedback confirms actions
💡 Benefits
| Benefit | Impact |
|---|---|
| Reduced Scrolling | Save 60-80% vertical space in long conversations |
| Improved Focus | Keep attention on current discussion |
| Faster Workflow | Symmetrical controls accessible from either side |
| Safe Operations | Typing detection prevents premature actions |
🔧 Installation
📝 Usage Tips
⚙️ Customization
Configurable settings include minimum code length (20 chars), typing check interval (300ms), auto-collapse delay (500ms), and double-click timing (300ms).
🎓 Why This Matters
Problem: Claude.ai conversations with multiple code blocks become overwhelming. Excessive scrolling, no temporary hiding, no quick downloads, visual clutter.
Solution: Intelligent code management that collapses blocks to save 60-80% space, enables one-click downloads, and uses typing detection to prevent interruptions.
🌟 Ideal For
Software developers, students learning to code, technical writers, code reviewers, data scientists, and DevOps engineers working with Claude.ai.
🔗 Additional Information
| Detail | Information |
|---|---|
| Compatible With | Chrome, Firefox, Edge, Safari, Opera, Brave |
| Website Support | claude.ai and .claude.ai/ |
| Version | v24 - Event handler fixes, auto-copy disabled |
| License | GNU GPL v3.0 |
📞 Support & Feedback
Found a bug? Report it in the feedback section. Have a feature request? Let me know! Enjoying the script? Leave a review!
Thank you for using Claude Code Block Collapser! 🎉