resume-context
Ask OpenClaw about your coding sessions and project notes — powered by the
resume CLI and cached via Redis.
Usage
In the OpenClaw dashboard or any connected channel, say:
- - "Claw give me a briefing on resume" → session briefing with what you worked on
- "Claw what was I working on for [project]?" → same
- "Claw show me my notes for [project]" → project notes
- "Claw what notes do I have on [project]?" → same
How it works
- 1. OpenClaw receives your message and triggers this skill
- The skill finds your project directory (searches ~/Documents/Projects/, ~/, ~/projects/)
- Checks Redis cache — if fresh (< 5 min), returns instantly
- On cache miss: runs
resume show or resume notes in your project directory - INLINECODE2 calls your LLM (Anthropic/Ollama) to generate a plain-English briefing
- Result is cached in Redis and returned to you
Architecture
You → OpenClaw → resume-context skill
↓
Redis GET (cache hit → instant)
↓ (cache miss)
resume show / resume notes
↓
LLM briefing generation
↓
Redis SET (5 min TTL)
↓
Response back to you
Step 1 — Classify intent
- - "briefing", "working on", "session", "status", "catch me up" → INLINECODE3
- "notes", "note" → INLINECODE4
- Ambiguous → run notes first (fast), then show
Step 2 — Resolve project path
Extract project name from the message (e.g. "for resume" → "resume").
Search in order:
- 1. INLINECODE5
- INLINECODE6
- INLINECODE7
- INLINECODE8
CODEBLOCK0
Prefer the match that contains a .resume/ subdirectory. If no project named,
find the most recently active session:
CODEBLOCK1
Step 3 — Run the bridge
CODEBLOCK2
Step 4 — Return output
The bridge returns JSON with an output field — return it as-is.
If cached: true, add "(answered from cache)".
If empty: "No session data found. Is resume running in that project?"
Requirements
1. Install resume
cargo install --git https://github.com/nickleodoen/resume
Then set up the shell hook so resume captures your commands:
resume init --install-hook
# Open a new terminal (or source ~/.zshrc / ~/.bashrc)
Start a session in your project:
CODEBLOCK5
2. Set ANTHROPICAPIKEY
Add to your shell profile (
~/.zshrc or
~/.bashrc):
export ANTHROPIC_API_KEY=sk-ant-...
resume uses this to generate plain-English briefings via Claude.
3. Get a Redis URL (free)
Sign up at
Redis Cloud → New Subscription → Free Tier.
Copy the connection string from the database dashboard — it looks like:
INLINECODE15
4. Node.js 18+
Required to run the bridge script (
resume-mcp.js).
Environment variables
| Variable | Required | Default | Description |
|---|
| INLINECODE17 | ✅ | — | Redis connection string |
| INLINECODE18 |
❌ |
300 | Cache TTL in seconds |
|
RESUME_BIN | ❌ |
~/.cargo/bin/resume | Path to resume binary |
Install
CODEBLOCK7
Add to ~/.openclaw/openclaw.json:
CODEBLOCK8
resume-context
向 OpenClaw 询问你的编码会话和项目笔记——由 resume CLI 驱动,并通过 Redis 缓存。
使用方法
在 OpenClaw 仪表盘或任何已连接的频道中,输入:
- - Claw 给我一份 resume 简报 → 获取你工作内容的会话简报
- Claw 我最近在 [项目] 上做了什么? → 同上
- Claw 显示我的 [项目] 笔记 → 项目笔记
- Claw 我在 [项目] 上有什么笔记? → 同上
工作原理
- 1. OpenClaw 接收你的消息并触发此技能
- 技能找到你的项目目录(搜索 ~/Documents/Projects/、~/、~/projects/)
- 检查 Redis 缓存——如果数据新鲜(< 5 分钟),立即返回
- 缓存未命中:在你的项目目录中运行 resume show 或 resume notes
- resume 调用你的 LLM(Anthropic/Ollama)生成纯英文简报
- 结果缓存到 Redis 并返回给你
架构
你 → OpenClaw → resume-context 技能
↓
Redis GET(缓存命中 → 即时返回)
↓(缓存未命中)
resume show / resume notes
↓
LLM 简报生成
↓
Redis SET(5 分钟 TTL)
↓
响应返回给你
步骤 1 — 意图分类
- - 简报、正在做、会话、状态、更新 → resume show
- 笔记、记录 → resume notes
- 模糊意图 → 先运行 notes(快速),再运行 show
步骤 2 — 解析项目路径
从消息中提取项目名称(例如 for resume → resume)。
按顺序搜索:
- 1. ~/Documents/Projects/<名称>
- ~/<名称>
- ~/projects/<名称>
- ~/code/<名称>
bash
find ~ -maxdepth 4 -type d -name <项目名称> 2>/dev/null | grep -v node_modules | grep -v .git | head -5
优先匹配包含 .resume/ 子目录的路径。如果未找到指定项目,则查找最近活跃的会话:
bash
ls -t ~/.resume/projects/ 2>/dev/null | head -3
步骤 3 — 运行桥接脚本
bash
REDIS
URL=$REDISURL node {baseDir}/resume-mcp.js show <项目路径>
REDIS
URL=$REDISURL node {baseDir}/resume-mcp.js notes <项目路径>
步骤 4 — 返回输出
桥接脚本返回包含 output 字段的 JSON——直接原样返回。
如果 cached: true,则添加(来自缓存)。
如果为空:未找到会话数据。该项目中是否正在运行 resume?
要求
1. 安装 resume
bash
cargo install --git https://github.com/nickleodoen/resume
然后设置 shell 钩子,使 resume 捕获你的命令:
bash
resume init --install-hook
打开新终端(或 source ~/.zshrc / ~/.bashrc)
在你的项目中启动会话:
bash
cd ~/your-project && resume
2. 设置 ANTHROPICAPIKEY
添加到你的 shell 配置文件(~/.zshrc 或 ~/.bashrc):
bash
export ANTHROPIC
APIKEY=sk-ant-...
resume 使用此密钥通过 Claude 生成纯英文简报。
3. 获取 Redis URL(免费)
在
Redis Cloud 注册 → 新建订阅 → 免费套餐。
从数据库仪表盘复制连接字符串,格式如下:
redis://default:password@host:port
4. Node.js 18+
运行桥接脚本(resume-mcp.js)所需。
环境变量
| 变量 | 必需 | 默认值 | 描述 |
|---|
| REDISURL | ✅ | — | Redis 连接字符串 |
| RESUMECACHE_TTL |
❌ | 300 | 缓存 TTL(秒) |
| RESUME_BIN | ❌ | ~/.cargo/bin/resume | resume 二进制文件路径 |
安装
bash
通过 ClawHub
openclaw skills install resume-context
手动安装
cp -r resume-context ~/.openclaw/skills/
cd ~/.openclaw/skills/resume-context && npm install
添加到 ~/.openclaw/openclaw.json:
json
{
skills: {
entries: {
resume-context: {
enabled: true,
env: {
REDIS_URL: redis://your-redis-url:6379
}
}
}
}
}