Fix the stale SessionStart hook example in the README

The step-5 hook snippet showed `smriti state my-project --compact` and
claimed it was what `smriti init` generates. `smriti init` actually
generates a space-agnostic hook (`smriti state --compact`) that resolves
the space from the repo's .smriti.json attachment — verified in
`_build_session_start_hook_command`. Correct the snippet and note the
space-agnostic resolution.

Caught while integrating the cli/README.md command-reference refresh,
closing the docs truth pass as one coherent unit.
This commit is contained in:
Himanshu Dongre 2026-05-20 00:30:47 +05:30
parent 2f7e994f5e
commit 8e4138c879

View file

@ -234,7 +234,7 @@ backend.
"hooks": [
{
"type": "command",
"command": "smriti state my-project --compact 2>/dev/null || echo 'Smriti backend not reachable. Start it with: make dev-local'"
"command": "smriti state --compact 2>/dev/null || echo 'Smriti backend not reachable. Start it with: make dev-local'"
}
]
}
@ -243,7 +243,7 @@ backend.
}
```
`smriti init` already writes this hook into `.claude/settings.json`, with the `smriti` path resolved for your machine — the block above is what it generates. With the hook in place, the state brief is injected automatically at session start; the agent doesn't need to remember to call `smriti_state`.
`smriti init` already writes this hook into `.claude/settings.json`, with the `smriti` path resolved for your machine — the block above is what it generates. The hook is space-agnostic — `smriti state --compact` resolves the space from the repo's `.smriti.json`, so one hook works in every project. With the hook in place, the state brief is injected automatically at session start; the agent doesn't need to remember to call `smriti_state`.
---