Skills.MD
# Session Share
Share Claude Code sessions between developers through portable file export/import.
**Version:** 1.0 | **Privacy:** Files are never uploaded to cloud unless you choose to share them
## Quick Start
```bash
# Export current session
scripts/export.sh
# Output: ~/session-shares/session-2024-01-20-my-feature.json
# Share the file via Slack, email, AirDrop, etc.
# Other developer imports
scripts/import.sh ~/Downloads/session-2024-01-20-my-feature.json
# Session appears in agent-deck, ready to continue
```
## Commands
### Export Session
Export the current Claude session to a portable file:
```bash
scripts/export.sh [options]
```
**Options:**
| Option | Description |
|--------|-------------|
| `--session <id>` | Export specific session (default: current) |
| `--output <path>` | Custom output path |
| `--include-thinking` | Include Claude's thinking blocks |
| `--no-sanitize` | Don't redact sensitive data |
**Examples:**
```bash
# Export current session
scripts/export.sh
# Export to specific location
scripts/export.sh --output /tmp/handoff.json
# Export specific session with thinking blocks
scripts/export.sh --session abc123 --include-thinking
```
**What gets exported:**
- All conversation messages (user and assistant)
- Tool calls and results
- File modifications tracked
- Session metadata
**What gets redacted (by default):**
- API keys and tokens
- Absolute paths (converted to relative)
- Thinking blocks (Claude's internal reasoning)
### Import Session
Import a shared session file and create an agent-deck session:
```bash
scripts/import.sh <file-path> [options]
```
**Options:**
| Option | Description |
|--------|-------------|
| `--title <name>` | Override session title |
| `--project <path>` | Import to specific project |
| `--no-start` | Don't auto-start the session |
**Examples:**
```bash
# Import and start
scripts/import.sh ~/Downloads/session-feature.json
# Import with custom title
scripts/import.sh session.json --title "Feature Work from Alice"
# Import without starting
scripts/import.sh session.json --no-start
```
## Workflow: Sharing a Session
### Developer A (Exporter)
1. Working in agent-deck session on a feature
2. Needs to hand off to Developer B
3. Runs: `scripts/export.sh`
4. Gets file: `~/session-shares/session-2024-01-20-feature.json`
5. Sends file to Developer B via Slack DM, email, or AirDrop
### Developer B (Importer)
1. Receives the session file
2. Runs: `scripts/import.sh ~/Downloads/session-2024-01-20-feature.json`
3. Session appears in agent-deck as "Imported: feature"
4. Starts session - Claude has full context from Developer A's work
5. Continues where Developer A left off
## Export File Format
```json
{
"version": "1.0",
"exported_at": "2024-01-20T15:30:00Z",
"exported_by": "alice",
"session": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Feature Implementation",
"original_project": "/Users/alice/my-project"
},
"context": {
"summary": "Last few user messages for quick context",
"modified_files": ["src/auth.ts", "src/middleware.ts"]
},
"messages": [ /* JSONL records as JSON array */ ],
"stats": {
"total_messages": 150,
"user_messages": 45,
"assistant_messages": 105
}
}
```
## Security & Privacy
### What's Redacted by Default
| Data Type | Redaction |
|-----------|-----------|
| API keys | Replaced with `[REDACTED]` |
| Tokens | Replaced with `[REDACTED]` |
| Home paths | Converted to `~` |
| Username in paths | Converted to `$USER` |
| Thinking blocks | Removed entirely |
### Best Practices
1. **Review before sharing** - Open the export file and scan for sensitive data
2. **Use direct transfer** - Slack DM, email, AirDrop are more private than cloud links
3. **Delete after import** - Remove the file once imported successfully
4. **Use `--include-thinking` sparingly** - Thinking blocks may contain sensitive reasoning
## Troubleshooting
| Issue | Solution |
|-------|----------|
| "Could not detect current Claude session" | Make sure you're in an agent-deck session with active Claude |
| "Session file not found" | Session may not have been saved yet; send a message first |
| Import shows wrong project | Use `--project /correct/path` to specify destination |
| Large file size | Use default settings (strips thinking blocks) |
## Technical Details
### Session Storage
Claude stores sessions in: `~/.claude/projects/<encoded-path>/<session-id>.jsonl`
Path encoding: `/Users/alice/project` becomes `-Users-alice-project`
### How Import Works
1. Reads export JSON file
2. Creates directory: `~/.claude/projects/<encoded-current-project>/`
3. Writes messages as JSONL: `<session-id>.jsonl`
4. Creates agent-deck session pointing to this path
5. Sets `claude-session-id` so restart uses `--resume`
### Dependencies
- `jq` - JSON processing (install: `brew install jq`)
- `agent-deck` - Session management
- `claude` - Claude Code CLI
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「session-share」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次