🌐 Translation: Translated from Korean.

TL;DR

  • Key Features: Snippet system + Interactive buttons + File download
  • Results: Automate repetitive tasks, check status or send keystrokes with a single touch on mobile
  • Keywords: Snippets, Interactive buttons, File download, Cancel function
  • Target Audience: Developers who want to maximize productivity with remote-claude
  • Time Required: 10 minutes to understand, 5 minutes to set up

1. Why Do You Need a Snippet System?

Core Problem: Repetitive Long Prompts

When working with Claude Code, you often find yourself repeating similar commands:

Commands you have to type every time:

"Run build and execute tests"
"Fix ESLint errors"
"Analyze SEO and check keyword density"
"Translate Korean post to English"

Problems:

  • Typing the same prompts every time → Wasted time
  • Risk of typos → Inconsistency
  • Typing long sentences on mobile → Very inconvenient

The Snippet System Solution:

Register frequently used prompts once → Execute by name only

Register: /snippet add build-test "Run build and execute tests"
Execute: /run build-test

7 words → 2 words! ✨

The snippet system stores repetitive commands and executes them with short names. It’s the key to productivity improvement.


2. Complete Guide to the Snippet System

2.1 Basic Snippet Commands

The snippet system consists of 5 core commands:

Command Description Example
/snippet list List all snippets Includes 60-character preview
/snippet add <name> <prompt> Register new snippet /snippet add build "npm run build"
/snippet edit <name> <new-prompt> Edit snippet /snippet edit build "npm run build && npm test"
/snippet delete <name> Delete snippet /snippet delete build
/snippet show <name> View full content For long prompts

2.2 Snippet Naming Rules

Snippet names follow kebab-case format:

✅ Valid names:
build-test
fix-lint
seo-analyze
translate-ko-en

❌ Invalid names:
build_test      (underscores not allowed)
BuildTest       (uppercase not allowed)
build--test     (consecutive hyphens not allowed)
-build          (cannot start with hyphen)

Rules:

  • Only lowercase letters + numbers + hyphens
  • 1-50 characters
  • Cannot start/end with hyphen

2.3 Snippet Storage Location

Snippets are stored in ~/.remote-claude/snippets.json:

{
  "snippets": {
    "build-test": "npm run build && npm test",
    "seo-analyze": "SEO analysis: check keyword density, verify title under 60 chars",
    "translate-ko-en": "Naturally translate Korean to English"
  }
}

3. Practical Snippet Examples

3.1 Development Workflow Snippets

# Build + Test
/snippet add build-all "Build the project and run all tests. Analyze the cause if it fails."

# Lint Fix
/snippet add fix-lint "Auto-fix ESLint errors and show results."

# Type Check
/snippet add check-types "Check TypeScript type errors and suggest fixes."

3.2 Blog Writing Snippets

# SEO Analysis
/snippet add seo-check "Analyze SEO: verify keyword density 0.5-2.5% range, title under 60 chars, excerpt under 300 chars."

# Korean to English Translation
/snippet add translate "Translate Korean post to English. Preserve technical terms and naturally include SEO keywords."

# Post Draft
/snippet add draft-post "Create blog post draft. Include TL;DR, 7-section structure."

3.3 Snippet Usage Patterns

Pattern 1: Sequential Tasks

/run build-all
(check results)
/run fix-lint
(check results)
/run check-types

Pattern 2: Conditional Execution

/run seo-check
→ "Keyword density insufficient" result

"Increase keyword density to 1.5%"
→ Combining snippet + additional instructions

Automating repetitive tasks with the snippet system significantly boosts productivity.


4. Quick Responses with Interactive Buttons

4.1 Why Interactive Buttons?

Challenges when controlling Claude Code from mobile:

Traditional approach:
- Check status: Type /state command → Cumbersome
- Key input: Need terminal access → Impossible on mobile
- Check files: Need scp or sftp → Complicated

Interactive buttons:
- 📊 Check status → Single touch
- ⏎ Enter/arrow keys → Single touch
- 📥 File download → Single touch
- Fast and convenient ✨

Interactive buttons provide frequently used functions as Slack buttons.

4.2 Interactive Button Layout

remote-claude provides 9 interactive buttons:

Row 1: Core Functions (3)

Button Function Description
📊 Status Check Current state Claude Code screen, task queue status
📥 File Download Get files Download project files to Slack
🚫 Cancel Task Stop execution Immediately cancel current task

Row 2: Key Input (6)

Button Action Use Case
⏎ Enter Enter once Execute command
⏎⏎ Enter*2 Enter twice Consecutive confirmations
↑ ↓ ← → Arrow keys Cursor movement, history

4.3 Using the Status Check Button

When you press the 📊 Status Check button:

📊 Channel Status

Project: my-blog
Path: /Users/idongho/proj/blog
tmux session: my-blog-session

📋 Task Queue Status
Pending: 0
Running: 1
Completed: 5
Failed: 0

🖥️ Claude Code Current Screen
(last 80 lines captured)

Interactive buttons make it easy to check status even from mobile.


5. File Download Feature

5.1 What is File Download?

Use the 📥 File Download button or /download command to download project files to Slack.

Use Cases:

  • Check log files: error.log
  • Review config files: package.json
  • Check written code: src/index.ts
  • Review markdown drafts: content/posts/ko/my-post.md

5.2 How to Use File Download

Button Method:

Click 📥 File Download button
→ File selection modal appears (max 100 files, sorted by recent modification)
→ Select file
→ File uploaded to Slack

Command Method:



/download README.md
/download src/index.ts
/download content/posts/ko/my-post.md

The file download feature lets you access project files from anywhere.

5.3 Security Restrictions

File download has several restrictions for security:

File Size Limit:

Maximum 10MB
If exceeded: "⚠️ File size exceeds the limit."

Sensitive Files Blocked:

Blocked files:
❌ .env, .env.local, .env.production
❌ *.key, *.pem (encryption keys)
❌ credentials.json, password.txt
❌ ~/.ssh/, id_rsa, id_ed25519
❌ .git/config

Path Traversal Prevention:

❌ Blocked: /download ../../etc/passwd
❌ Blocked: /download ../../../.env
✅ Allowed: /download README.md
✅ Allowed: /download src/index.ts

The file download feature is designed to allow access only to necessary files while maintaining security.


6. Stop Execution with Cancel Function

6.1 What is the Cancel Function?

Use the 🚫 Cancel Task button or /cancel command to immediately stop a running task.

Use Cases:

  • Wrong command executed → Cancel immediately
  • Task taking longer than expected → Cancel and retry
  • Need to prioritize another task → Cancel current task

6.2 How to Use Cancel Function

Click 🚫 Cancel Task button

or

/cancel

→ Confirm currently running task
→ Stop Claude Code process
→ Remove from task queue
→ "✅ Task has been cancelled."

The cancel function lets you immediately stop incorrect tasks and save time.

6.3 Status After Cancel

Before cancel:
📋 Task Queue Status
Pending: 2
Running: 1 ← This task cancelled

After cancel:
📋 Task Queue Status
Pending: 2
Running: 0
Cancelled: 1 ← Cancelled task recorded

7. Automatic Message Splitting

7.1 Why is Message Splitting Needed?

Slack messages have a 3,500 character limit. What happens when Claude Code responses exceed this?

Problem scenario:
Claude Code response: 8,500 characters
Slack limit: 3,500 characters
→ Message send failure or truncation ❌

Automatic Message Splitting Solution:

8,500 character response
    ↓
Automatic split
    ↓
[1/3] 2,450 chars → Send
[2/3] 2,480 chars → Send
[3/3] 3,570 chars → Send (with buttons)

7.2 Splitting Logic

Automatic message splitting follows these rules:

  1. Line-based splitting: Split at line breaks, not mid-sentence
  2. Maximum 2,500 characters: Each message limited to 2,500 chars
  3. Numbering: Displayed as [1/3], [2/3], [3/3]
  4. Button placement: Interactive buttons only on the last message

7.3 Split Message Delivery

Delivery flow:

[1/3] First message → Send immediately
      ↓ 500ms wait
[2/3] Second message → Send
      ↓ 500ms wait
[3/3] Third message → Send (with buttons)

Retry Logic:

  • Maximum 3 retries
  • Exponential backoff: 1s → 2s → 4s
  • Automatic rate_limited error handling

Automatic message splitting ensures clean delivery of long responses.

7.4 Code Block Handling

When Claude Code responses contain code blocks:

Original:
```python
print("hello")

Problem:
Conflicts with Slack code block syntax

Solution:
Automatically convert “` → ”’
→ Display safely as text


---

## 8. Maximizing Productivity Workflow

### 8.1 Combining All Features

1️⃣ Register snippet (once)
/snippet add blog-publish “Analyze blog post SEO and publish”

2️⃣ Execute snippet
/run blog-publish

3️⃣ Confirm with interactive buttons
Claude Code: “Should I publish?”
→ Touch [✅ Yes] button

4️⃣ Long results auto-split
[1/2] SEO analysis results
[2/2] Publish complete message (with buttons)

5️⃣ Confirm with file download
📥 → Download content/posts/ko/my-post.md

6️⃣ Cancel if issues
🚫 → Stop task immediately


### 8.2 Mobile Optimization Tips

How to maximize productivity on smartphone:

| Situation | Solution |
|-----------|----------|
| Long command input | Use snippet system |
| Need key input | ⏎ Enter/arrow buttons |
| Check results | 📊 Status check button |
| Check files | 📥 File download |
| Made a mistake | 🚫 Cancel task |

Combining the snippet system with interactive buttons enables PC-level productivity even on mobile.

---

## Series Navigation

- [← Day 1: Local Environment Anywhere](/en/remote-claude-day1-local-dev-anywhere-en/)
- [← Day 2: Complete Slack Bot Setup Guide](/en/remote-claude-day2-slack-bot-setup-en/)
- [← Day 3: Managing Multiple Projects Simultaneously](/en/remote-claude-day3-multi-project-queue-en/)
- **Day 4: Maximizing Productivity** (Current)
- → Day 5: Smartphone Optimization (Coming Soon)

---

## References

- **GitHub**: [remote-claude](https://github.com/dh1789/remote-claude)
- **Slack API**: [Interactive Components](https://api.slack.com/interactivity)
- **Previous Posts in Series**: See Day 1-3

---

### Related Posts

- [Day 1: Local Environment Anywhere](/en/remote-claude-day1-local-dev-anywhere-en/)
- [Day 2: Complete Slack Bot Setup Guide](/en/remote-claude-day2-slack-bot-setup-en/)
- [Day 3: Managing Multiple Projects Simultaneously](/en/remote-claude-day3-multi-project-queue-en/)