⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
shared-session-context
Add reusable shared-session continuity to OpenClaw bots across channels such as Feishu, QQ, Telegram, or Discord. Use when installing, packaging, integrating, or validating a cross-channel shared-session bridge backed by structured objects like session summary, task state, continuation capsule, and recent exchanges.
Use with your AI agent
Open your project in any AI assistant that can read your files. Works with ChatGPT, Claude, Claude Code, Codex, Cursor, Hermes Agent, OpenClaw, Grok Bot, and more.
Your agent needs access to this page’s linked instructions and your project files. Copying does not install or execute anything.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
OpenClaw Shared Session Context
A bridge layer between OpenClaw and OpenViking for cross-channel shared session continuity.
This repository is not just an OpenClaw skill and not just a set of hook scripts. Its purpose is to connect:
OpenClawas the orchestration and reply hostOpenVikingas the shared state storage and retrieval backend- a reusable bridge layer that makes cross-channel continuity actually work
Architecture in One Sentence
OpenClaw decides when to read and write. OpenViking stores and serves the shared objects. This repository defines the protocol and the bridge between them.
Why This Exists
When one user talks to the same bot from different channels, context usually fractures:
- each channel becomes its own isolated session
- short continuation prompts like
continueorwhere were webecome weak - active task state drifts apart
The bridge in this repository solves that by making multiple channels read from and write to the same shared state backend.
Why Use This Instead of Simpler Approaches
| Approach | What it does well | Where it breaks | Why this bridge exists |
|---|---|---|---|
| Per-channel local session memory | simple, no extra backend | continuity breaks across Feishu / QQ / Telegram / Discord | one canonical user can continue from another channel |
| “Just write a skill” | easy to wire into one agent host | logic, storage contract, and deployment assumptions get mixed together | keeps the OpenClaw-facing skill thin and the backend contract explicit |
| Full transcript sync | maximum raw recall | expensive, noisy, hard to control, easy to over-share | prefers compact structured objects with clear read priority |
| Long-term memory extraction | useful for durable preferences and facts | weak for active task continuation right now | focuses first on short-horizon cross-channel continuity |
OpenViking Is Required
In the current implementation, OpenViking is not optional.
It is the backend that stores and retrieves the shared objects used for continuation:
session_summarytask_statecontinuation_capsulerecent_exchange
Without a working OpenViking backend, the current bridge does not work as designed.
What OpenClaw Does
OpenClaw is responsible for:
- receiving messages from chat channels
- deciding when to call the bridge before answer generation
- deciding when to call the bridge after answer generation
- generating the actual reply with injected context
What OpenViking Does
OpenViking is responsible for:
- storing shared objects under one canonical user identity
- serving those objects back across channel boundaries
- acting as the shared continuity backend instead of per-channel local session memory
What This Repository Does
This repository provides:
- protocol-level object definitions
- OpenViking-backed reference shell scripts
- OpenClaw integration notes
- example identity maps, config, summary, and exchange payloads
- demo, verification, rollout, and hardening docs
- a thin OpenClaw skill wrapper under
skill/shared-session-context
Core Objects
session_summarytask_statecontinuation_capsulerecent_exchange
Read Priority
continuation_capsule -> recent_exchanges -> task_state -> session_summary
Current Scope
- private chat continuation first
- manual identity mapping first
- OpenViking backend first
- OpenClaw hook integration first
Compatibility
| Component | Current expectation |
|---|---|
| OpenClaw | able to call before-answer and after-answer bridge scripts |
| OpenViking | exposes an OpenViking-style resource tree under OV_CONTEXT_ROOT |
| Shell runtime | bash |
| Python runtime | python3 |
| Identity mapping | explicit file-based mapping via OV_IDENTITY_MAP |
| Channels | private chat continuation first |
Failure Modes You Should Expect
- wrong identity mapping merges different channel users into one canonical user
- missing
OV_CONTEXT_ROOTorOV_IDENTITY_MAPprevents the bridge from resolving shared state - backend tree exists but objects are missing, so continuation falls back to partial context
- exchange writeback is skipped or malformed, so
recent_exchangesandcontinuation_capsulebecome weak - trying to start with multi-user or group-chat scope makes verification noisy and misleading
Not Included
- full transcript sync
- group chat sharing by default
- automatic long-term memory extraction
- a hosted backend service
Quick Start
- Clone this repository.
- Set:
OV_CONTEXT_ROOTOV_IDENTITY_MAP
- Run
scripts/check-prereqs.sh. - If needed, initialize the backend tree with
scripts/init-backend-tree.sh. - Run
scripts/demo.sh feishu demo-feishu-user cross-channel-default. - Confirm the output includes:
continuation_capsulerecent_exchangestask_statesession_summary
- Then wire
scripts/before-answer.shandscripts/after-answer.shinto your actualOpenClawflow.
For the shortest install path, see docs/usage.md.
You can also send this GitHub repository directly to your own OpenClaw instance and ask it to read and use the implementation. This repository is structured to be directly consumable by OpenClaw agents. See docs/openclaw-direct-consumption.md.
Verify It Actually Works
For a real terminal proof, see docs/demo-transcript.md.
Run the isolated demo with:
export OV_CONTEXT_ROOT="$(mktemp -d)"
mkdir -p "$OV_CONTEXT_ROOT"/{sessions,tasks,capsules,exchanges,memory/long-term}
export OV_IDENTITY_MAP="$PWD/examples/identity-map.demo.json"
./scripts/check-prereqs.sh
./scripts/demo.sh feishu demo-feishu-user cross-channel-default
If the final output shows continuation_capsule, recent_exchanges, task_state, and session_summary, the bridge is working against a valid OpenViking-style resource tree.
OpenClaw Skill Wrapper
A thin OpenClaw skill wrapper is included under skill/shared-session-context.
It should stay thin and should not duplicate backend logic.
The backend contract belongs to OpenViking, and the bridge contract belongs to this repository.
Recommended Packaging Strategy
- publish this repo as the bridge and reference implementation
- keep OpenViking explicit in all setup and architecture docs
- keep the skill as the OpenClaw-facing wrapper
- version the skill against tagged releases of this repo
Additional Docs
docs/usage.mddocs/quick-verification.mddocs/demo-transcript.mddocs/compatibility.mddocs/failure-modes.mddocs/architecture.mddocs/architecture-diagram.mddocs/openclaw-direct-consumption.mddocs/openclaw-integration-walkthrough.mddocs/agent-checklist.mddocs/faq.mddocs/use-cases.mddocs/why-openviking.mddocs/production-hardening.mddocs/release-strategy.mddocs/repository-maturity.md
License
MIT
// HOW IT'S BUILT
KEY FILES