Getting Started
Moatlog runs inside your project. Install the CLI, run one init command, restart Cursor, and your agent starts building behavioral memory automatically.
Install
Install the Moatlog CLI globally, or run commands with npx without installing.
npm install -g @moatlog/cliInstall the moatlog CLI globally
No install needed: npx @moatlog/cli init works from any project directory.
Init
From your project root, run init. This scaffolds everything Moatlog needs in one step — no manual hook scripts, MCP config, or cursor rules.
moatlog initScaffold hooks, MCP config, rules, and .moatlog/
init creates:
.cursor/hooks.jsonand hook scripts — capture reads, edits, prompts, and shell commands.cursor/mcp.json— wires the Moatlog MCP server into Cursor.cursor/rules/moatlog.mdc— tells agents to call get_task_context at session start.moatlog/— event log directory (added to .gitignore)
Existing files are skipped. Pass --force to overwrite.
Restart Cursor
Restart Cursor so hooks and MCP reload. Without a restart, the agent won't capture events or connect to get_task_context.
Verify
Confirm hooks are active and check moat strength.
moatlog statusShow hooks status and moat strength
You should see ● hooks active (.cursor/hooks.json). Work in Agent mode for a few minutes, then check again — depth and coverage grow as events accumulate.
The stop hook runs moatlog distill automatically. Run it manually anytime, or validate freshness with moatlog check-moat before committing moat.json.