Claude Code Block Collapser v24

Collapse code blocks with symmetrical dual controls, download functionality, double-click toggle, and typing animation - Auto-copy disabled - Fixed event handler error

目前為 2025-11-08 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
carrot4522
評價
0 0 0
版本
24
建立日期
2025-11-08
更新日期
2025-11-08
尺寸
26.7 KB
授權條款
GNU General Public License v3.0
腳本執行於

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

  • Long Conversations - Focus on current responses while keeping earlier code accessible
  • Code Reviews - Systematically manage multiple code blocks from Claude
  • Multi-File Projects - Handle multiple files efficiently in one conversation

🚀 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

  1. Install Tampermonkey browser extension
  2. Add Claude Code Block Collapser v24 userscript
  3. Visit https://claude.ai - script activates automatically
  4. Code blocks auto-collapse when Claude finishes typing

📝 Usage Tips

  • Double-click headers for fastest toggle
  • Wait for gray header before downloading
  • Access controls from either side
  • Download important code immediately

⚙️ 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! 🎉