Use when the user says "logout", "log", "/log", asks to log session, save session, or at end of session. Saves a structured session summary to Notion AI Session Log with linked Projects and Tasks. All properties MUST be filled.
Log Claude Code activity to the AI Session Log Source database in Notion, with Project and Task linked.
Before doing anything, read ~/.claude/skills/notion-config.md to get:
If notion-config.md is missing or incomplete, STOP and ask the user to fill it in first.
464f84cb-950c-456c-875a-e55530bef9a8f3f435b9-e9ab-4665-9e96-54f104a049f0cdf0fa82-6bf4-4163-8b16-0e5a52307ff8notion-config.md (shared Atomic AI token)| Property | Type | Required | How to fill |
|---|---|---|---|
| Session Name | title | MANDATORY | Descriptive title of what was done |
| Summary | rich_text | MANDATORY | One concise sentence |
| Person | people | MANDATORY | Your Notion User ID from config |
| Contributor | select | MANDATORY | Always set to Claude Code |
| Source | select | MANDATORY | Always set to Claude Code |
| Tags | multi_select | MANDATORY | At least one tag |
| Lesson Learned | rich_text | MANDATORY | Key takeaway — if nothing learned, write "Routine session" |
| Duration (hrs) | number | MANDATORY | Auto-calculated from session start time |
| Project | relation | MANDATORY | Link to AI Projects DB — NEVER leave empty |
| Task | relation | IF EXISTS | Link to AI Tasks DB — search and link if a matching task exists |
| Date | created_time | AUTO | Notion fills this automatically |
Choose from: Notion AI, Replit, Automation, Architecture, Workflow, Agent, MCP, Prompt Engineering, Group Digest, AI First Mover Group
START=$(cat ~/.claude/.session_start 2>/dev/null)
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
If ~/.claude/.session_start exists, calculate hours:
python3 -c "
from datetime import datetime
start = datetime.fromisoformat('$START'.replace('Z','+00:00'))
end = datetime.fromisoformat('$NOW'.replace('Z','+00:00'))
hrs = round((end - start).total_seconds() / 3600, 1)
print(f'Duration: {hrs} hours')
"
Read ~/.claude/skills/notion-config.md to get:
NOTION_USER_ID — for the Person propertyNOTION_TOKEN — shared Atomic AI tokenReview everything done in this session:
Project — MUST find one:
curl -s -X POST 'https://api.notion.com/v1/databases/f3f435b9-e9ab-4665-9e96-54f104a049f0/query' \
-H 'Authorization: Bearer NOTION_TOKEN' \
-H 'Content-Type: application/json' -H 'Notion-Version: 2022-06-28' \
-d '{"page_size": 30}'
Task — Search and link if exists:
curl -s -X POST 'https://api.notion.com/v1/databases/cdf0fa82-6bf4-4163-8b16-0e5a52307ff8/query' \
-H 'Authorization: Bearer NOTION_TOKEN' \
-H 'Content-Type: application/json' -H 'Notion-Version: 2022-06-28' \
-d '{"page_size": 20, "sorts": [{"timestamp": "last_edited_time", "direction": "descending"}]}'
curl -s -X POST 'https://api.notion.com/v1/databases/464f84cb-950c-456c-875a-e55530bef9a8/query' \
-H 'Authorization: Bearer NOTION_TOKEN' \
-H 'Content-Type: application/json' -H 'Notion-Version: 2022-06-28' \
-d '{"page_size": 5, "sorts": [{"timestamp": "created_time", "direction": "descending"}]}'
If today's page exists for this user → update it. If not → create new.
Properties — ALL must be set:
{
"Session Name": { "title": [{ "text": { "content": "Descriptive session title" } }] },
"Summary": { "rich_text": [{ "text": { "content": "One sentence summary" } }] },
"Person": { "people": [{ "id": "YOUR_NOTION_USER_ID" }] },
"Contributor": { "select": { "name": "🦐 Claude Code" } },
"Source": { "select": { "name": "Claude Code" } },
"Tags": { "multi_select": [{ "name": "Tag1" }, { "name": "Tag2" }] },
"Lesson Learned": { "rich_text": [{ "text": { "content": "What was learned" } }] },
"Duration (hrs)": { "number": 1.5 },
"Project": { "relation": [{ "id": "PROJECT_PAGE_ID" }] },
"Task": { "relation": [{ "id": "TASK_PAGE_ID" }] }
}
Content body — use Decision-Focused format (NOT changelog):
Session Log is NOT a changelog! Don't just list actions (did A, did B). Write a decision log + context.
Title format: Session: YYYY-MM-DD - [Short Topic]
Summary property: Only put 3-5 index sentences (so AI search can efficiently hit keywords). Full content goes in page body.
Page body — each major topic must include these sections:
## [Topic Number]. [Topic Name] — [One-sentence description]
### Discussion Process
What options were considered? What context led to this discussion?
### Decision
Which approach was chosen? Why?
### Rejected Alternatives
- ❌ [Option A] — [Why not chosen]
- ❌ [Option B] — [Why not chosen]
(Prevents repeating the same mistakes in the future)
### Standards Established
What new rules/conventions were created?
### Execution
What was actually done (brief)
### Pitfalls Encountered
What was done wrong and reverted? What approaches failed?
Must include at the end:
## New Skills / Standards Established (For Future Reference)
| Standard | Details |
|---|---|
| [Standard Name] | [Specific Details] |
## Lesson Learned
1. [Transferable takeaway]
## Next Session TODO
- [ ] [Specific task]
Writing principles:
After creating/updating:
Before sending the API call, verify:
🦐 Claude CodeClaude CodeActivate this skill when user says:
When updating an existing page for the same day: