Automatically capture every Claude Code session to a structured Notion work log — no MCP, no extra API key required.
Local draft mode (default — sessions saved locally, organized on demand):
npx skills add huojian-jan/notion-worklog-skills@work-log -g -y
~/.agents/skills/work-log/setup.shNotion draft mode (sessions written to Notion instantly after each session):
npx skills add huojian-jan/notion-worklog-skills@work-log -g -y
~/.agents/skills/work-log/setup.sh
echo 'export WORK_LOG_DRAFT_TARGET=notion' >> ~/.zshrc && source ~/.zshrcwork-log is a Claude Code skill with two parts:
| Part | Trigger | What happens |
|---|---|---|
| SessionEnd hook | Automatic — every session end | Saves session metadata to a local file (or Notion). Non-blocking, runs in background. |
/work-log command |
Manual — you run it | Claude reads all captured sessions, groups by date + category, writes the formal log to Notion, clears local files. |
Session ends → session-end.sh (async, background)
→ local: ~/.claude/work-log-drafts/YYYY-MM-DD.jsonl (default)
notion: Notion draft page (NOTION_WORKLOG_DRAFT_PAGE_ID)
/work-log → reads drafts → AI summarizes → writes to Notion log page → keeps drafts
/work-log --clear → reads drafts → AI summarizes → writes to Notion log page → clears drafts
Two separate Notion pages (notion draft mode):
- Draft page (
NOTION_WORKLOG_DRAFT_PAGE_ID) — sessions auto-written here, date-grouped - Log page (
NOTION_WORKLOG_PAGE_ID) — formal structured log, written by/work-log
| Skill | Auto-capture | AI organize | Writes to Notion | No extra API key |
|---|---|---|---|---|
| session-log (michalparkola) | Yes | No | No | Yes |
| notion-knowledge-capture | No | No | Yes | No |
| work-log (this) | Yes | Yes | Yes | Yes |
npx skills add huojian-jan/notion-worklog-skills@work-log -g -ySessions are saved locally as .jsonl files. Run /work-log whenever you want to organize + push to Notion.
~/.agents/skills/work-log/setup.shAdd to ~/.zshrc:
export NOTION_API_TOKEN="your_token_here"Sessions are summarized and written to a Notion draft area automatically after each session ends.
~/.agents/skills/work-log/setup.sh
echo 'export WORK_LOG_DRAFT_TARGET=notion' >> ~/.zshrc && source ~/.zshrcAdd to ~/.zshrc:
export NOTION_API_TOKEN="your_token_here"
export WORK_LOG_DRAFT_TARGET=notionBoth modes require:
- A Notion integration token from notion.so/my-integrations
- The integration connected to your work log page (click
···→ Connections)
Sessions are captured automatically in the background. Run /work-log whenever you want to organize them.
/work-log # organize drafts → write to Notion log page → keep drafts
/work-log --clear # organize drafts → write to Notion log page → clear drafts
~/.claude/work-log-drafts/2026-04-12.jsonl:
{"ts":"2026-04-12 10:30","project":"blog_source","transcript":"..."}
{"ts":"2026-04-12 14:20","project":"notion-worklog-skills","transcript":"..."}2026年 ← H1
4月 ← H2
第二周(4月7日 - 4月13日) ← H3
4月12日 周六 ← bold
Notion 接入 ← bold blue (category)
· SessionEnd hook 自动写入草稿
· /work-log 整理并写入正式日志
─────────────────────────
产出:work-log skill v1.0
今日总结:打通 Notion 工作日志自动化全链路。
All config is via environment variables (add to ~/.zshrc):
| Variable | Default | Description |
|---|---|---|
NOTION_API_TOKEN |
— | Required for all Notion writes |
NOTION_WORKLOG_PAGE_ID |
— | Required — Notion log page (formal log written here) |
NOTION_WORKLOG_DRAFT_PAGE_ID |
falls back to PAGE_ID |
Notion draft page (sessions auto-written here in notion mode) |
WORK_LOG_DRAFT_TARGET |
local |
local or notion |
WORK_LOG_MIN_MESSAGES |
5 |
Min user messages to trigger capture |
WORK_LOG_DRAFTS_DIR |
~/.claude/work-log-drafts |
Local draft storage directory |
local (default) — no extra dependencies, no token needed at session end:
# default, nothing to setnotion — writes directly to a Notion draft callout after each session:
export WORK_LOG_DRAFT_TARGET=notion
# NOTION_API_TOKEN must be setFires automatically when a Claude Code session ends. Configured as async: true — never blocks your workflow.
Skips sessions with fewer than WORK_LOG_MIN_MESSAGES user messages (default: 5).
In local mode: saves {ts, project, transcript} to a dated .jsonl file. No AI call, instant.
In notion mode: runs claude --print to summarize the session, then writes the bullets directly to a dedicated Notion draft page (NOTION_WORKLOG_DRAFT_PAGE_ID). Uses Claude Code's own auth — no separate ANTHROPIC_API_KEY needed.
When you run /work-log, Claude:
- Reads drafts (local
.jsonlfiles or Notion draft page, depending on mode) - Summarizes and categorizes each session using its own in-context intelligence
- Groups entries by date, assigns 2–4 categories per day (max 4 bullets each)
- Writes structured blocks to the Notion log page (
NOTION_WORKLOG_PAGE_ID) - If
--clearwas passed: clears the draft area; otherwise keeps drafts intact
Check the hook log:
tail -f ~/.claude/work-log.logNothing appearing after sessions?
- Confirm
SessionEndhook is registered: check~/.claude/settings.json - Session might be below
WORK_LOG_MIN_MESSAGESthreshold (default: 5) - In
notionmode: confirmNOTION_API_TOKENis set and the integration has page access
/work-log says "no drafts"?
- Check
~/.claude/work-log-drafts/for.jsonlfiles - Confirm the hook script is executable:
chmod +x ~/.agents/skills/work-log/scripts/session-end.sh
- Claude Code with
claudeCLI in PATH curlandjq- Notion API token (for
/work-logNotion writes)
work-log 是一个 Claude Code skill,分两部分:
| 部分 | 触发 | 功能 |
|---|---|---|
| SessionEnd Hook | 自动,每次会话结束 | 把会话元数据保存到本地文件(或 Notion),后台运行,不阻塞前台 |
/work-log 命令 |
手动 | Claude 读取所有草稿,按日期+分类整理,写入 Notion 正式日志,清空草稿 |
| 环境变量 | 默认值 | 说明 |
|---|---|---|
NOTION_API_TOKEN |
— | 必填,用于写入 Notion |
NOTION_WORKLOG_PAGE_ID |
— | 必填,正式日志页面 ID |
NOTION_WORKLOG_DRAFT_PAGE_ID |
同 PAGE_ID |
草稿页面 ID(notion 模式) |
WORK_LOG_DRAFT_TARGET |
local |
local(本地文件)或 notion(写 Notion 草稿页) |
WORK_LOG_MIN_MESSAGES |
5 |
触发记录的最小用户消息数,短会话自动跳过 |
WORK_LOG_DRAFTS_DIR |
~/.claude/work-log-drafts |
本地草稿目录 |
local(默认) — 最简单,不需要额外配置:
会话结束时把原始数据存到 ~/.claude/work-log-drafts/YYYY-MM-DD.jsonl,执行 /work-log 时由 Claude 做摘要和分类。
notion — 会话结束后直接写入专属草稿页:
export WORK_LOG_DRAFT_TARGET=notion
export NOTION_WORKLOG_DRAFT_PAGE_ID="你的草稿页ID"两个独立的 Notion 页面:草稿页(每次会话自动写入)和日志页(/work-log 整理后写入)。
/work-log # 整理草稿 → 写入日志页 → 保留草稿
/work-log --clear # 整理草稿 → 写入日志页 → 清空草稿tail -f ~/.claude/work-log.log # 查看 hook 运行日志
ls ~/.claude/work-log-drafts/ # 查看本地草稿文件MIT