commit the hooks, and check the sync one is there
The container is destroyed when the session ends, and anything still on disk inside it goes with it — which is why mossbear init writes a Stop hook that pushes the session before that happens. Step 4 has already put it in your repo's .claude/settings.json:{
"hooks": {
"Stop": [
{
"hooks": [{ "type": "command", "command": "mossbear sync", "timeout": 180 }]
}
]
}
}
Commit that file. It lives in the repo rather than in the environment, so the same hooks fire on your own machine, and a session resumed from the cached filesystem still has them.This hook also refreshes any doc bundles the repo subscribes to, so a container that starts cold still gets them. It is safe to run while an agent is working: a file you or the agent edited is reported and left alone rather than overwritten, and the only files it removes are ones Mossbear itself wrote and can still match against what it wrote. Anything else in the folder is left where it is.
Set up before July 2026? Check the command in your settings file. Earlier versions wrote mossbear sync --no-docs, because the docs refresh was not yet safe to run unattended. Re-running mossbear init will not change it — it sees a sync hook already there and leaves your file alone rather than editing config you may have customized. Drop the flag by hand to get doc bundles refreshed at session end; actions upload either way.
A repo set up before this hook existed carries only the removed auden eval Stop hook — the state where actions are logged all session and never uploaded, which looks exactly like a dashboard that isn't receiving anything. Re-run mossbear init: it adds the sync hook and drops the dead eval one, merging rather than overwriting, so your other entries are left alone. mossbear doctor reports the same gap if you'd rather check first.
Track the whole file, every hook in it. Everything mossbear init writes there is machine-independent: the logger runs as the bare command mossbear-hook, resolved from your PATH, so the file is byte-identical on your laptop and in the container and stays that way.Settings written by older versions named the logger by an absolute path into one machine's home directory, which made a committed file churn wherever it travelled. If your repo still carries one, init migrates it to mossbear-hook the next time it runs and says so in its output; mossbear doctor reports which form a project is on.
Be clear on what each hook carries, because they are not the same job. mossbear sync uploads the actions the logger recorded, and the dashboard grades those server-side — that is what puts a run in your dashboard. It also reads the transcript of the session it is syncing, on your machine, to count the tokens that session spent; the counts sync, the transcript never does. Guide and skill suggestions still come only from a sync run with --transcripts-dir, which this hook does not pass. The SessionEnd hook adds one thing on top: it names the session as finished, so the server closes that run and grades it instead of waiting for its idle sweep.