agentleFS
maxwell2732maxwell2732/claudecode-research-harness-workflow/skills/session-init/SKILL.md

session-init

Skill42 starsChanged 6 days agoMITView on GitHub

Internal sub-skill for session startup checks, Plans.md status, git state, and harness-mem resume pack. Invoked by session/startup workflows only. Do NOT load for: implementation, reviews, or mid-session tasks.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check file sizes before session start:

    line 49
  2. Very specific:

    Always specify current project name for project

    line 89
  3. Very specific:

    Use of the first result from harness_mem_sessions_list(project, limit=1) is limited to read-only (resume check).

    line 91
  4. Distinctive:

    Run the following in parallel:

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Init Skill

A skill for checking the environment and understanding the current task status at session start.


Invocation Conditions

This skill is called internally from session / SessionStart-type flows. The user-facing entry point is /session or the normal session start flow.

Legacy trigger phrases:

  • "Start session"
  • "Begin work"
  • "Start today's work"
  • "Check status"
  • "What should I do?"
  • "start session"
  • "what should I work on?"

Overview

The Session Init skill automatically checks the following at Claude Code session start:

  1. Git state: Current branch, uncommitted changes
  2. Plans.md: In-progress tasks, requested tasks
  3. AGENTS.md: Role assignments, review of prohibitions
  4. Previous session: Review of carry-over items
  5. Latest snapshot: Summary of progress snapshot and diff from previous session

Execution Steps

Step 0: File State Check (Automatic Cleanup)

Check file sizes before session start:

# Check Plans.md line count
if [ -f "Plans.md" ]; then
  lines=$(wc -l < Plans.md)
  if [ "$lines" -gt 200 ]; then
    echo "⚠️ Plans.md has ${lines} lines. Recommend organizing with 'organize it'"
  fi
fi

# Check session-log.md line count
if [ -f ".claude/memory/session-log.md" ]; then
  lines=$(wc -l < .claude/memory/session-log.md)
  if [ "$lines" -gt 500 ]; then
    echo "⚠️ session-log.md has ${lines} lines. Recommend organizing with 'organize session log'"
  fi
fi

Display a suggestion if cleanup is needed (does not affect work).

Step 0.5: Legacy Local Memory Compatibility Handling (Optional)

The current standard is the Unified Harness Memory in Step 0.7. Checking legacy local memory compatibility is generally unnecessary; reference it individually only for special migration checks.

Note: In normal operation, skip this step and treat the common DB Resume Pack as the sole resume entry point.

Step 0.7: Unified Harness Memory Resume Pack (Required)

Retrieve resume context from the Codex / Claude / OpenCode shared DB (~/.harness-mem/harness-mem.db).

Required call:

harness_mem_resume_pack(project, session_id?, limit=5, include_private=false)

Operational rules:

  • Always specify current project name for project
  • Obtain session_id in order: $CLAUDE_SESSION_ID → .session_id in .claude/state/session.json
  • Use of the first result from harness_mem_sessions_list(project, limit=1) is limited to read-only (resume check); do not use for writes via record_checkpoint / finalize_session
  • Inject retrieval results into session start context
  • On retrieval failure, check daemon state with harness_mem_health(), note the failure, and continue
  • Recovery order: scripts/harness-memd doctor → scripts/harness-memd cleanup-stale → scripts/harness-memd start

Step 1: Environment Check

Run the following in parallel:

# Git state
git status -sb
git log --oneline -3
# Plans.md
cat Plans.md 2>/dev/null || echo "Plans.md not found"
# AGENTS.md key points
head -50 AGENTS.md 2>/dev/null || echo "AGENTS.md not found"

Step 2: Understand Task Status

Extract from Plans.md:

  • cc:WIP - Tasks continuing from previous session
  • pm:requested - Tasks newly requested by PM (compatible: cursor:requested)
  • cc:TODO - Unstarted but assigned tasks

Step 3: Output Status Report

## 🚀 Session Started

**Date/Time**: {{YYYY-MM-DD HH:MM}}
**Branch**: {{branch}}
**Session ID**: ${CLAUDE_SESSION_ID}

---

### 📋 Today's Tasks

**Priority tasks**:
- {{pm:requested (compatible: cursor:requested) or cc:WIP tasks}}

**Other tasks**:
- {{List of cc:TODO tasks}}

---

### ⚠️ Notes

{{Key constraints/prohibitions from AGENTS.md}}

---

**Ready to start work?**

Output Format

At session start, present the following information concisely:

ItemContent
Current branche.g., staging
Priority tasksMost important 1–2 items
NotesSummary of prohibitions
Next actionSpecific suggestion

Related Commands

  • /work - Task execution (parallel execution supported)
  • /sync-status - Plans.md progress summary
  • /maintenance - Automatic file cleanup

Notes

  • Always check AGENTS.md: Understand role assignments before starting work
  • If Plans.md is missing: Guide to /harness-init
  • If previous work was interrupted: Confirm whether to continue

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.