[FEATURE REQUEST] hook on session init
Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 9 comments · opened Jul 21, 2025 · closed Jul 29, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
I would like to start all my Claude Code sessions with a List(.)
I believe adding a hook for session init can be useful for this and other usecases.
Should run on /clear too
/compact should probably have his own hook too.
9 Comments
Adding another use-case here, I would love to be able to inject specific context into Claude Code depending on project state or remote state. For example if there are open tickets, if the user is using a meta-framework for Claude Code, etc...
Exactly why I created the issue, project CLAUDE.md is great for static data, but sometimes you need dynamic data on runtime.
I would like to start my session with a hook executing that allows me to to select memories to pull into context based on the task at hand. A command would be fine but this would be more consistent than me remembering to run a command.
The
SessionStarthook is now available in v1.0.62!Oh heck yes. I just blogged today about how I wanted to use this https://writeaheadblogg.ing/posts/claude-hooks-stop-burning-tokens-on-irrelevant-mem/
I, too, would find a compact hook potentially useful
@dicksontsai I assume a docs update is coming? https://docs.anthropic.com/en/docs/claude-code/hooks-guide#hook-events-overview
Looks like I had updated the reference https://docs.anthropic.com/en/docs/claude-code/hooks but not the guide https://docs.anthropic.com/en/docs/claude-code/hooks-guide#hook-events-overview. Thanks for the callout.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.