S
SessionStart
HookFires on
SessionStartOnce, as a session begins — before you type anything.
Where this sits in a session
- Session start→
- Prompt submitted→
- Prompt expansion→
- Before tool use→
- After tool use→
- Notification→
- Before compaction→
- Subagent finished→
- Turn finished→
- Session end
Observes only — Emits messages or context. It never returns a permission decision.
What it runs
Executed automatically when the event fires — no prompt, no confirmation.
command· timeout 5s
node "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/inject-skill-context.js"command· timeout 5s
node "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/init-data-dir.js"command· timeout 5s
node "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/capture-model.js"Install it yourself
Paste into .claude/settings.json to run this hook without installing the whole plugin. Adjust the paths to point at your own copy of the scripts.
settings.json
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/inject-skill-context.js\"",
"timeout": 5
},
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/init-data-dir.js\"",
"timeout": 5
},
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/capture-model.js\"",
"timeout": 5
}
]
}
]
}
}Source (3 files)
Read this before installing — it runs on your machine with your permissions.
#!/usr/bin/env node
/**
* SessionStart hook: surface the carta-crm plugin name + version to the session.
*
* Emits a <carta-plugin name="..." version="..." /> tag into every session's
* context so the running plugin/version is attributable, matching
* carta-cap-table and carta-investors.
*
* Part of the official Carta AI Agent Plugin.
*/
const fs = require('fs');
const path = require('path');
// Read plugin name + version from the plugin manifest.
let pluginName = 'carta-crm';
let pluginVersion = 'unknown';
try {
const pluginJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../.claude-plugin/plugin.json'), 'utf8'));
pluginName = pluginJson.name || pluginName;
pluginVersion = pluginJson.version || 'unknown';
} catch {}
let inputData = '';
process.stdin.on('data', chunk => (inputData += chunk));
process.stdin.on('end', () => {
let hookEventName = 'SessionStart';
try {
const input = JSON.parse(inputData);
hookEventName = input.hook_event_name || hookEventName;
} catch {}
const output = {
hookSpecificOutput: {
hookEventName,
additionalContext: `<carta-plugin name="${pluginName}" version="${pluginVersion}" />`,
},
};
process.stdout.write(JSON.stringify(output));
process.exit(0);
});
Shipped by 1 plugin
Installing any of these installs this hook.
Reviews
Log in to leave a review.
No reviews yet — be the first.
Explore related
Other things in this space — across every part of the ecosystem, not just hooks.