Skip to content

Instantly share code, notes, and snippets.

@sobri909
Created October 15, 2025 07:26
Show Gist options
  • Select an option

  • Save sobri909/6493d18c4e5ee731880e30130941bab5 to your computer and use it in GitHub Desktop.

Select an option

Save sobri909/6493d18c4e5ee731880e30130941bab5 to your computer and use it in GitHub Desktop.
Claude Code session wind down

Dev Log Entry Template

This template codifies the section patterns that have emerged across 40+ dev log entries. Use it as a guide for consistency, but adapt freely when the session calls for different structure.

Flexibility: If a particular session needs different sections or organization, use your judgment. This template captures common patterns, not rigid rules. Examples of when to diverge:

  • Investigation-heavy sessions may need more "Discovery" sections
  • Multi-issue sessions may need per-issue subsections
  • Planning sessions may emphasize "Design Decisions" over "Implementation"
  • Quick fixes may not need full structure (but document them anyway!)

The goal is comprehensive documentation for future sessions, not adherence to a format.

Header Format

# YYYY-MM-DDThh:mm+zzzz (Location) - Brief Title

Required Sections

Overview

High-level summary of what was accomplished. 2-3 sentences capturing the essence.

Purpose: Quick understanding without reading full entry.

Context

Why this work? What's the background?

  • Reference Linear issues (BIG-XXX)
  • Link to previous sessions if continuing work
  • Explain user requests or pain points being addressed

Purpose: Understanding motivation and how this fits into larger picture.

Problem Analysis OR Implementation Approach

For bug fixes:

  • Root cause discovery process
  • Investigation steps taken
  • What was broken and why

For features:

  • Architectural decisions
  • Approach chosen
  • High-level design

Purpose: Understanding the problem space or design approach before diving into code.

Implementation OR Solution

What code changes were made? What was built?

Be specific:

  • File changes with line numbers when relevant (e.g., TimelineProcessor.swift:234)
  • Key code patterns or algorithms
  • Database migrations, schema changes
  • Build issues encountered and how fixed
  • UI changes with before/after descriptions

Purpose: Detailed record of what was actually changed.

Testing

How was it validated?

Must include:

  • On-device testing results (required per version control rules for code changes)
  • Specific scenarios tested
  • Edge cases verified
  • What worked, what didn't
  • Performance measurements if relevant

Purpose: Proving the changes work and documenting test coverage.

Design Decisions

CRITICAL SECTION - Document "why X not Y" thinking using this pattern:

#### Why [Decision About What]?
**Considered**: [Alternative approach A]
- Pros: ...
- Cons: ...

**Rejected**: [Reason it didn't work]

**Chosen**: [Approach we took] because:
- [Rationale point 1]
- [Rationale point 2]

Examples of good design decision topics:

  • Why this data structure over that one
  • Why this API pattern vs alternatives
  • Why solve now vs defer
  • Why this level of abstraction
  • Why this testing approach

Purpose: Future sessions need to understand WHY decisions were made. This is often the most valuable section.

Key Learnings

What did we discover? What would we do differently?

Include:

  • Mistakes made and how corrected (be explicit!)
  • Unexpected behaviors or patterns discovered
  • Things that surprised us
  • Better ways to approach similar problems in future
  • "If I had to do this again, I would..."

Purpose: Capturing knowledge that prevents repeating mistakes and informs future similar work.

Files Modified

Complete list with repo context.

Format:

**LocoKit2**:
- `Sources/LocoKit2/Models/TimelineItem.swift` - Added preventAutoMerge field
- `Sources/LocoKit2/Database/Database+Schema.swift` - Migration for new column

**Arc Timeline Editor**:
- `Arc Timeline Editor/Views/Timeline/TimelineMap.swift` - Updated gesture handling

Purpose: Quick reference for what changed and where.

Commits

List all commits made, or note if uncommitted with rationale.

Format:

**LocoKit2** (`a1b2c3d`):
- Brief description of commit
- Key changes included

**Arc Timeline Editor** (`d4e5f6g`):
- Brief description

**Uncommitted**: [Explain why - usually waiting for testing or related work]

Purpose: Linking session to git history and documenting commit strategy.

Conditional Sections

Include these when relevant:

Remaining Work

Unfinished tasks, next steps, follow-up items.

Use when:

  • Session ended due to context limits mid-task
  • Discovered additional work during implementation
  • Follow-up tasks identified

Format: Bulleted list with enough detail for next session to pick up.

Open Questions

Things we need to figure out but haven't resolved yet.

Format:

**Question**: [Specific question]

**Context**: Why it matters

**Status**: Not blocking / Blocking for X

Mysteries and Uncertainties

Things we don't understand. Be explicit about unknowns.

Examples:

  • Unexpected behavior we observed but couldn't explain
  • Performance characteristics we don't understand
  • API behaviors that seem inconsistent
  • Edge cases we discovered but didn't fully investigate

Purpose: Honest documentation of gaps in understanding. Future sessions may need to investigate these.

References

Linear issues: List with status changes made Related sessions: Link to previous work on same feature Knowledge files: Which ones were read or updated External docs: Links to API docs, blog posts, etc.

Tips for Writing Good Dev Logs

  1. Write for your future self: You have no memory between sessions. What context would you need?

  2. Document mistakes: Failed approaches are valuable. Future sessions need to know what doesn't work.

  3. Be specific: "Fixed the bug" is useless. "Fixed race condition in TimelineObserver by adding 100ms debounce" is useful.

  4. Capture "why": Code shows "what", dev logs should show "why".

  5. Design Decisions are gold: These age best. Implementation details may change, but decision rationale remains valuable.

  6. Don't skip "Mysteries": Unknown behaviors need documentation so future sessions can investigate or work around them.

  7. More detail > less detail: 500-line entries are fine. Token efficiency comes from loading only relevant sessions, not skimping on detail.

Section Pattern Analysis

Based on analysis of weeks 39-42 (40+ entries):

Most common sections:

  • Files Modified (27 times) - universal
  • Overview (26 times) - universal
  • Key Learnings (16 times) - very high value
  • Commits (16 times) - tracking
  • Mysteries and Uncertainties (16 times) - documenting unknowns
  • Context/Problem Context (16 times) - motivation
  • Design Decisions (10 times) - very high value

Section naming consistency:

  • Use "Mysteries and Uncertainties" (not "Mysteries/Uncertainties" or "Mysteries & Uncertainties")
  • Use "Key Learnings" (not "Key Learning" or "Learnings")
  • Use "Design Decisions" (not "Key Decisions")
  • Use "Files Modified" (not "Changed Files" or "Modifications")
#!/bin/bash
# Dev Log Helper Script
# Gathers information and prompts for details needed for creating per-session dev log entries
# 1. Get current timestamp in ISO format
TIMESTAMP=$(date "+%Y-%m-%dT%H:%M%z")
echo "TIMESTAMP: $TIMESTAMP"
# 2. Get current week number and year
WEEK=$(date "+%V")
YEAR=$(date "+%Y")
echo "WEEK: $WEEK"
echo "YEAR: $YEAR"
# 3. Extract date and time components for filename
FILE_DATE=$(date "+%Y-%m-%d")
FILE_TIME=$(date "+%H%M")
echo "FILE_DATE: $FILE_DATE"
echo "FILE_TIME: $FILE_TIME"
# 4. Define path to current week's directory
LOG_DIR="/Users/matt/Projects/Arc Family/docs/devlogs"
WEEK_DIR="$LOG_DIR/${YEAR}_w${WEEK}"
echo "WEEK_DIR: $WEEK_DIR"
# 5. Create week directory if it doesn't exist
if [ ! -d "$WEEK_DIR" ]; then
mkdir -p "$WEEK_DIR"
echo "WEEK_DIR_CREATED: true"
else
echo "WEEK_DIR_EXISTS: true"
fi
# 6. List existing sessions in current week chronologically
echo "CURRENT_WEEK_SESSIONS:"
if [ -d "$WEEK_DIR" ]; then
ls -1 "$WEEK_DIR" | while read -r session; do
echo " - $session"
done
fi
# 7. Find most recent previous session (may be in previous week)
LATEST_SESSION=""
# First check current week
if [ -d "$WEEK_DIR" ]; then
LATEST_SESSION=$(ls -t "$WEEK_DIR" | head -1)
fi
# If current week has sessions, use latest; otherwise check previous weeks
if [ -z "$LATEST_SESSION" ]; then
# Find all week directories, sort reverse chronologically
for week_dir in $(ls -dt "$LOG_DIR"/????_w?? 2>/dev/null); do
if [ -d "$week_dir" ] && [ "$week_dir" != "$WEEK_DIR" ]; then
LATEST_SESSION=$(ls -t "$week_dir" | head -1)
if [ -n "$LATEST_SESSION" ]; then
PREV_SESSION_PATH="$week_dir/$LATEST_SESSION"
break
fi
fi
done
fi
if [ -n "$LATEST_SESSION" ] && [ -z "$PREV_SESSION_PATH" ]; then
PREV_SESSION_PATH="$WEEK_DIR/$LATEST_SESSION"
fi
if [ -n "$PREV_SESSION_PATH" ] && [ -f "$PREV_SESSION_PATH" ]; then
echo "PREVIOUS_SESSION_PATH: $PREV_SESSION_PATH"
echo "READ_PREVIOUS_SESSION: true"
else
echo "READ_PREVIOUS_SESSION: false"
fi
# 8. Find same-day sessions (for loading conventions)
echo "SAME_DAY_SESSIONS:"
if [ -d "$WEEK_DIR" ]; then
ls -1 "$WEEK_DIR" | grep "^${FILE_DATE}" | while read -r session; do
echo " - $WEEK_DIR/$session"
done
fi
# 9. Prompt for session description (interactive)
echo ""
echo "=== Session Details ==="
read -p "Brief description (3-5 words, e.g., 'json-importer-testing'): " DESCRIPTION
# Sanitize: lowercase, spaces to hyphens, remove special chars except hyphens
DESCRIPTION=$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed 's/[^a-z0-9-]//g')
echo "DESCRIPTION: $DESCRIPTION"
# 10. Prompt for issue IDs (optional, comma-separated)
read -p "Issue IDs (optional, comma-separated, e.g., 'BIG-196,BIG-198'): " ISSUES
# Sanitize: uppercase, remove spaces, validate format
ISSUES=$(echo "$ISSUES" | tr '[:lower:]' '[:upper:]' | tr -d ' ')
if [ -n "$ISSUES" ]; then
# Convert comma-separated to underscore-separated
ISSUES=$(echo "$ISSUES" | tr ',' '_')
echo "ISSUES: $ISSUES"
FILENAME="${FILE_DATE}_${FILE_TIME}_${ISSUES}_${DESCRIPTION}.md"
else
echo "ISSUES: (none)"
FILENAME="${FILE_DATE}_${FILE_TIME}_${DESCRIPTION}.md"
fi
# 11. Construct full session file path
SESSION_FILE_PATH="$WEEK_DIR/$FILENAME"
echo "SUGGESTED_FILENAME: $FILENAME"
echo "SESSION_FILE_PATH: $SESSION_FILE_PATH"
# 12. Check if suggested filename already exists
if [ -f "$SESSION_FILE_PATH" ]; then
echo "!! WARNING: File already exists at this path !!"
fi
echo ""
echo "=== Loading Recommendations ==="
echo "LOAD_PREVIOUS: true (always load immediately previous session)"
if [ -n "$(ls -1 "$WEEK_DIR" 2>/dev/null | grep "^${FILE_DATE}")" ]; then
echo "LOAD_SAME_DAY: true (found other sessions from today)"
fi
echo ""
echo "DEVLOG_HELPER_COMPLETE"

Session End

Write a development log entry for the completed work session.

Description

Creates a detailed development log entry following the Arc project's per-session file standards, ensuring all work is properly documented. Sessions may end due to task completion, context limits, or natural break points - this command handles all cases.

Command

# Run the devlog helper script to gather all necessary information and prompt for session details
cd "/Users/matt/Projects/Arc Family" && ./devlog_helper.sh

Prompt

I need to write a development log entry for the work session I just completed.

  1. CRITICAL AND REQUIRED: First, run the devlog_helper script which will prompt for session details:

    Bash(command: "cd \"/Users/matt/Projects/Arc Family\" && ./devlog_helper.sh", description: "Running devlog helper script")
    

    The script will:

    • Display current timestamp for your log entry header: ## YYYY-MM-DDThh:mm+zzzz (Location)
    • Show existing sessions in current week
    • Identify previous session to load
    • Prompt for brief session description (3-5 words)
    • Prompt for issue IDs if applicable (e.g., BIG-196, BIG-198)
    • Suggest filename following format: YYYY-MM-DD_HHMM_ISSUES_description.md
    • Provide loading recommendations per conventions

    DO NOT invent or guess the timestamp - it must be generated at time of writing.

    For location:

    • Check the timezone in the timestamp against the previous log entry
    • If the timezone is the same (e.g., both +0800), assume the same location unless told otherwise
    • Common locations by timezone:
      • +0800: Bali, Singapore
      • +0700: Bangkok
      • +0900: Tokyo
    • Only ask for location if timezone differs from previous entry or if uncertain
  2. Load context following the conventions (see CLAUDE.md "Dev Log Loading Conventions"):

    Always load previous session (script output shows PREVIOUS_SESSION_PATH):

    Read(file_path: "[PREVIOUS_SESSION_PATH from script output]")
    

    Load same-day sessions if working on recent stuff (script shows SAME_DAY_SESSIONS):

    Read(file_path: "[each session path listed]")
    

    Load intervening sessions if continuing work on same issue:

    • Use grep to find all sessions mentioning the issue ID(s)
    • Load all sessions between first and last occurrence chronologically
    • This captures architectural dependencies from intervening work

    Example:

    Bash(command: "grep -l 'BIG-196' /Users/matt/Projects/Arc\\ Family/docs/devlogs/2025_w42/*.md", description: "Find BIG-196 sessions")
    # Then load all sessions between first and last match
    
  3. Write the entry following these guidelines:

    • First, read the template: /Users/matt/Projects/Arc Family/docs/knowledge/dev_log_template.md
    • This template codifies patterns from 40+ entries - use it as a guide, not a straitjacket
    • Read through our entire conversation to understand all work completed
    • Document ALL details to facilitate potential handover to a new chat context
    • Include clear descriptions of work completed, key decisions and rationales
    • Document any mistakes made AND how they were corrected
    • Document any mysteries or uncertainties introduced
    • List all files modified
    • Include remaining TODOs or dangling work items
    • Remember more detail is better than less - you have no memory between chat contexts
    • Flexibility: Use additional sections when they make sense for the specific session
  4. Format the entry following this structure:

    Header: # YYYY-MM-DDThh:mm+zzzz (Location) - Brief Title

    Required Sections (every entry):

    ## Overview
    High-level summary of what was accomplished. 2-3 sentences capturing the essence.
    
    ## Context
    Why this work? What's the background? Reference Linear issues, previous sessions, or user requests.
    
    ## Problem Analysis OR Implementation Approach
    - For bug fixes: Root cause discovery, investigation process
    - For features: Architectural decisions, approach taken
    - Include "Considered/Rejected/Chosen" patterns for design decisions
    
    ## Implementation OR Solution
    What code changes were made? What was built? Be specific about:
    - File changes with line numbers when relevant
    - Key code patterns or algorithms
    - Build issues encountered and fixed
    
    ## Testing
    How was it validated? Include:
    - On-device testing results (required for code changes per version control rules)
    - Edge cases tested
    - What worked, what didn't
    
    ## Design Decisions
    Critical section! Document "why X not Y" thinking:
    - **Considered**: Alternative approaches
    - **Rejected**: Why they didn't work
    - **Chosen**: Rationale for the approach taken
    Use this format for significant decisions.
    
    ## Key Learnings
    What did we discover? Include:
    - Mistakes made and how corrected
    - Unexpected behaviors or patterns
    - Things that surprised us
    - Better ways to approach similar problems in future
    
    ## Files Modified
    Complete list with repo context (LocoKit2 vs Arc Timeline Editor)
    
    ## Commits
    Include commit hashes and messages (or note if uncommitted with rationale)

    Conditional Sections (include when relevant):

    ## Remaining Work
    Unfinished tasks, next steps, follow-up items
    
    ## Open Questions
    Things we need to figure out but haven't yet
    
    ## Mysteries and Uncertainties
    Things we don't understand. Be explicit about unknowns.
    
    ## References
    Linear issues (with status updates), related dev log entries, knowledge files, external docs
  5. Create the new session file:

    • Use the SESSION_FILE_PATH from devlog helper script output
    • Write the complete entry to that path
    • DO NOT append to a weekly file - each session gets its own file
  6. After creating the entry:

    • Review and UPDATE the following files based on our work session (take ownership, don't just suggest):
      • Relevant knowledge base sections in /Users/matt/Projects/Arc Family/docs/knowledge/
      • Project manifests at:
        • /Users/matt/Projects/Arc Family/docs/Arc-Editor/arc_manifest.md
        • /Users/matt/Projects/Arc Family/docs/LocoKit2/locokit2_manifest.md
    • Knowledge files exist purely for AI consumption - update them proactively to document:
      • New patterns discovered
      • Architectural decisions and rationales
      • Common pitfalls and solutions
      • Implementation examples
    • Create new knowledge files if needed for significant new patterns
    • These are YOUR documentation for future sessions - maintain them actively

Important Notes

  • Session vs Task: Sessions end for various reasons - task completion, context limits, natural break points. The dev log should document the work completed in the session, not necessarily a complete task.
  • Multiple Issues: Sessions may touch multiple issues. Include all relevant issue IDs in the filename (comma-separated in prompt, underscore-separated in filename).
  • No Issue Sessions: Some sessions (like planning, discussion, tooling updates) may not have Linear issues. That's fine - omit the issue portion of the filename.
  • Same-Day Sessions: If this is the 2nd/3rd/etc session today, previous session will be from earlier today. Load all same-day sessions for dense context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment