AgentSkillsCN

create-session-log

在会话开始时,创建或恢复会话日志。无论是开启新会话、项目经理分配工作任务,还是在上下文精简后重新查找并续写现有日志时,都应使用此技能。这对于维护组织知识库至关重要。

SKILL.md
--- frontmatter
name: create-session-log
description: Create or resume a session log at session start. Use when starting a new session, when PM assigns work, or after context compaction to find and continue your existing log. Critical for maintaining institutional memory.
scope: cross-role
version: 1.0
created: 2026-01-21

create-session-log

Create a properly named and structured session log file at the start of a work session.

When to Use

Use this skill when:

  • Starting a new work session with any agent role
  • PM assigns you a role and tasks for the day
  • Resuming work after a break (check for existing log first)

Note on subagents:

  • If you are a Task tool subagent doing quick exploration/search that returns results directly, you do NOT create a session log.
  • If you are a programmer subagent (prog role) doing substantive implementation work (writing code, fixing bugs, running tests), you SHOULD create a session log unless the work is trivial enough to capture in a single entry in the coordinating agent's log.

Key Principle: One Log Per Role Per Day

A single consolidated log per role per day is preferable to fragmented logs, even if efforts are separate. Always check for an existing same-day log before creating a new one.

Procedure

Step 1: Check for Existing Same-Day Log

Before creating a new log, check if one already exists:

bash
ls dev/active/*$(date +%Y-%m-%d)*{role}*log.md

If found: Continue that log instead of creating a new one. Add a section:

markdown
### {TIME} - Session Resumed
- [Context of resumption]

If not found: Proceed to create new log.

Step 2: Determine File Name

Format: YYYY-MM-DD-HHMM-{role}-{tool}-{model}-log.md

Location: dev/active/

Components:

  • YYYY-MM-DD: Today's date
  • HHMM: Current time in 24-hour format (no colon)
  • {role}: Role slug (see table below)
  • {tool}:
    • code for Claude Code CLI
    • cursor for Cursor IDE
    • Omit entirely for direct API/Console (e.g., arch-opus-log.md)
  • {model}: opus, sonnet, or haiku

Step 3: Create File with Standard Header

markdown
# Session Log: {date}-{time}-{role}-{tool}-{model}

**Role**: {Full Role Name}
**Model**: {Tool} ({Model})
**Date**: {Day of Week}, {Month} {Day}, {Year}
**Start Time**: {Time in 12-hour format}

## Session Objectives

1. [Primary objective from PM]
2. [Secondary objectives if any]

## Work Log

### {Time} - Session Start
- Created session log
- [Initial context or task]

Step 4: Fill Initial Content

  • Record objectives from PM's instructions
  • Note any handoff context
  • Begin work log with first timestamped entry

Role Slug Reference

RoleSlugTypical Model
Lead Developerleadopus
Chief Architectarchopus
Communications Directorcommsopus/sonnet
Documentation Managerdocshaiku
Programmer (subagent)progsonnet/haiku
Chief Innovation Officercioopus
Chief Experience Officercxoopus
Head of Sapient Resourceshosropus
Product & Project Managerppmopus
Executive Summary Agentexecopus/sonnet
Spec Writerspecopus

Examples

Example 1: New Session Log

PM says: "Good morning! You are my docs agent. Create omnibus for yesterday."

Check: ls dev/active/*2026-01-22*docs*log.md → Not found

Create: dev/active/2026-01-22-0800-docs-code-haiku-log.md

markdown
# Session Log: 2026-01-22-0800-docs-code-haiku

**Role**: Documentation Management Specialist
**Model**: Claude Code (Haiku)
**Date**: Wednesday, January 22, 2026
**Start Time**: 8:00 AM

## Session Objectives

1. Create omnibus log for January 21, 2026
2. Check mailbox for requests

## Work Log

### 8:00 AM - Session Start
- Created session log
- PM confirmed omnibus for Jan 21 is primary task

Example 2: Resuming Existing Log

PM says: "Continue working on the anti-pattern index."

Check: ls dev/active/*2026-01-21*docs*log.md Found: 2026-01-21-0750-docs-code-haiku-log.md

Action: Open existing log and add:

markdown
### 2:30 PM - Session Resumed
- PM assigned continuation of anti-pattern index work
- Previous session completed Phase 2 experiment

Example 3: Lead Developer Log

Create: dev/active/2026-01-21-0900-lead-code-opus-log.md

markdown
# Session Log: 2026-01-21-0900-lead-code-opus

**Role**: Lead Developer
**Model**: Claude Code (Opus)
**Date**: Tuesday, January 21, 2026
**Start Time**: 9:00 AM

## Session Objectives

1. Review PR #543 and merge if passing
2. Coordinate Phase 2 implementation across subagents

## Work Log

### 9:00 AM - Session Start
- Created session log
- Checking mailbox for overnight messages

After Context Compaction (CRITICAL)

If you've just experienced context compaction (conversation was summarized to save tokens):

This is NOT a New Session

After compaction, you are mid-session, not starting fresh. Your log from earlier today must exist.

Mandatory Steps

  1. DO NOT create a new log - Your earlier log should exist
  2. Find and verify it:
    bash
    ls dev/active/*$(date +%Y-%m-%d)*{role}*log.md
    
  3. If found: Add resumption entry immediately:
    markdown
    ### {TIME} - Session Resumed (Post-Compaction)
    - Prior work: [what the summary indicates]
    - Continuing: [current task]
    
  4. If NOT found: STOP. This is a critical failure. Escalate to PM immediately. Do not proceed with implementation work.

Why This Matters

The session log is your institutional memory. After compaction, you've lost the detailed conversation but the log preserves:

  • What you were working on
  • Decisions made
  • Progress achieved
  • Context for continuing

Losing the log mid-session means losing hours of context that cannot be reconstructed from git commits alone.

Common Post-Compaction Mistake

Wrong: "I don't see a log, I'll create a new one" Right: "I don't see a log from earlier today - this is a critical failure, escalating to PM"

If you truly started fresh today and there's no prior log, that's fine - create one. But if you're post-compaction, the log MUST exist from before compaction.


Pattern Families

At session start, identify which pattern families apply to your work:

markdown
**Active pattern families this session**: [list applicable families]

Common families:

  • Completion Theater (045/046/047/049): Multi-phase work, closing issues
  • Investigation (006/041-043/060): Bug fixing, incident response
  • Grammar Application (050-058): Feature development, UX work
  • Multi-Agent Coordination (029/059/010/021/037): Cross-domain decisions

See PATTERN-FAMILIES.md for full family index.


Anti-Patterns to Avoid

Don't Do ThisWhyDo This Instead
Create multiple logs for same role same dayHard to synthesize for omnibusContinue existing log
Use wrong role slugBreaks discovery and omnibusUse exact slugs from table
Omit time from filenameAmbiguous, breaks sortingAlways include HHMM
Leave objectives blankLog lacks purpose contextFill from PM instructions
Skip the existence checkCreates duplicate logsAlways check first
Create new log after compactionLoses institutional memoryFind and continue existing log
Proceed without log after compactionCritical context lostSTOP and escalate to PM

Quality Checklist

After creating/resuming a session log:

  • File is in dev/active/
  • Filename follows convention exactly
  • Header metadata is complete
  • Objectives reflect PM's actual instructions
  • Work log has first timestamped entry
  • No duplicate same-day log for this role

After the Session

Session logs in dev/active/ may be archived to dev/YYYY/MM/DD/ after the session ends. This is typically handled by PM or documentation processes, not during the session itself.