Call a script that records prompt activity.
Section: Hooks basics
Log prompts for auditing
json
json
{
"version": 1,
"hooks": {
"sessionStart": [
{
"type": "command",
"bash": "./scripts/audit-log.sh"
}
]
}
}Explanation
A common enterprise pattern is logging sessions for compliance or internal review.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Hooks basics
Run a session-start hook script
Trigger repo automation when a session begins.
Add an MCP server for one session from a file
Load additional MCP server config at runtime.
Disable all built-in MCP servers
Run without the default built-in servers.