Support a "Start" hook

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 7 comments · opened Jul 2, 2025 · closed Jul 29, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

I'd like to use hooks for some activity tracking. Perhaps I should plumb ~/.claude/projects but it would be useful to me if there were a hook for it.

View original on GitHub ↗

7 Comments

dave-shawley · 1 year ago

I was having a similar discussion today about the need to connect various MCP servers with project specific configuration and was going to suggest precisely this 🧠

possibilities · 1 year ago

@dave-shawley That sounds like something you would use --mcp-config for, no?

dave-shawley · 1 year ago
@dave-shawley That sounds like something you would use --mcp-config for, no?

We could if we checked in the claude config for the project. We have internal project tracking software that I would retrieve information from for the project and then wire up MCPs based on the project's configuration in the tracking software. For example, we have the Sentry project ID if the project is connected to Sentry. It would be nice if changes in our tracking software could be reflected without having to manually configure it in each project source repo.

possibilities · 1 year ago

@dave-shawley The mcp config can be located anywhere. If you need dynamic configuration you could do claude --mcp-config $(command-that-creates-mcp-config-and-sends-to-stdout)

Even if they added a start hook I'm not sure it would serve your purpose because at that point claude is running and you can't easily non-interactively configure MCPs.

dicksontsai collaborator · 1 year ago

I think another interesting idea here is that start hooks can inject fresh context (similar to custom slash commands, but with more flexibility) to the start of an agent loop. For example, one can configure Claude to have better context of the time as discussed in https://github.com/anthropics/claude-code/issues/2618

possibilities · 1 year ago

SessionStart hook satisfies this, closing

github-actions[bot] · 1 year ago

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.