Feature Request: Add type: "prompt" for SessionStart hooks to enable auto-execution of setup tasks

Resolved 💬 4 comments Opened Mar 21, 2026 by Lucero-brilliante Closed Apr 18, 2026

Problem

There is currently no reliable way to auto-execute a Claude prompt or tool at session start. This makes it impossible to automate session setup tasks like creating recurring cron jobs, reading memory files, or initializing project-specific workflows.

What I tried (all failed)

| Approach | Result |
|----------|--------|
| CLAUDE.md instructions (even with emphatic wording like "MUST", "IMMEDIATELY", "NO EXCEPTION") | Claude reads them but does not consistently act on them |
| SessionStart hook (type: "command") | Hook fires, but stdout is not delivered to Claude for new sessions (see #10373) |
| SessionStart hook + CLAUDE.md combined | Still unreliable — Claude does not treat hook context or CLAUDE.md as actionable |

My use case

I want a 10-minute recurring cron job (CronCreate) to be automatically set up at session start, saving conversation progress to memory files. This ensures nothing is lost on unexpected session termination. Currently, I have to manually remind Claude every single time — despite having it configured in CLAUDE.md AND a SessionStart hook.

Proposed solution

Allow type: "prompt" in SessionStart hooks that triggers a Claude prompt with full tool access before the first user message:

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup",
        "hooks": [
          {
            "type": "prompt",
            "message": "Read MEMORY.md and create a recurring cron job (CronCreate, every 10 minutes) to save conversation state to memory."
          }
        ]
      }
    ]
  }
}

This would allow Claude to execute tools like CronCreate, Read, etc. automatically at session start — reliably and without user intervention.

Why this matters

  • Memory persistence depends on regular saves — manual triggers are unreliable
  • CLAUDE.md is not executable — it's treated as guidance, not instruction
  • SessionStart hook output doesn't reach Claude for new sessions (#10373)
  • Multiple users have requested this (see related issues below) — all were auto-closed due to inactivity, not because a solution was found

Environment

  • Windows 11 Pro
  • Claude Code CLI
  • PowerShell / Windows Terminal

Related closed issues (all unresolved)

  • #10373 — SessionStart hooks not working for new conversations (OPEN, confirmed bug)
  • #26112 — Allow hooks to invoke MCP tools (or add post-init hook phase)
  • #4274 — Enhance Hooks with Integrated Types
  • #25543 — Allow Claude Code to display messages from startup hooks
  • #10808 — Autonomous Messages After SessionStart Hook
  • #13422 — CLAUDE.md startup/exit session protocols ignored
  • #7571 — System reminder disclaimer prevents CLAUDE.md startup instructions from executing

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗