Skip to content

[Feature Request] Auto-recover session context via CLAUDE.md prompt injection #77

@HamsteRider-m

Description

@HamsteRider-m

Problem / Use Case

When starting a new Claude Code session after /clear, users often want to continue previous work. Currently, transfer files are generated in ~/.ccb/transfers/, but Claude doesn't automatically read them.

Proposed Solution

Add a CLAUDE.md prompt block that instructs Claude to auto-recover context when user says trigger phrases like:

  • 中文: "基于上一轮对话" / "继续上次的工作" / "恢复上下文"
  • English: "resume context" / "continue previous session"

My Current Implementation (working locally)

<!-- CCB_SESSION_TRANSFER_START -->
## Session Context Recovery (CCB)

**Trigger phrases** (when user says any of these, execute the action below):
- 中文: "基于上一轮对话" / "继续上次的工作" / "恢复上下文"
- English: "resume context" / "continue previous session"

**Action** (MANDATORY when triggered):
1. Use Bash tool to find the most recent transfer file:
   ```bash
   ls -t ~/.ccb/transfers/claude-*.md 2>/dev/null | head -1
  1. Use Read tool to read the file content
  2. Summarize key context points for the user:
    • What was being worked on
    • Key files involved
    • Last action/status
  3. Ask user what they want to continue with

Prerequisites: CCB (Claude Code Bridge) must be installed.


## Questions for Discussion

1. Should this be auto-injected during CCB install, or documented for manual setup?
2. Should it be part of `CCB_CONFIG` block or a separate block?
3. Any other trigger phrases to consider?

## Environment
- CCB version: 5.2.2
- OS: WSL2 (Ubuntu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions