Getting Started

Moatlog runs inside your project. Install the CLI, run one init command, restart Cursor, and your agent starts building behavioral memory automatically.

1

Install

Install the Moatlog CLI globally, or run commands with npx without installing.

npm install -g @moatlog/cli

Install the moatlog CLI globally

No install needed: npx @moatlog/cli init works from any project directory.

2

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 init

Scaffold hooks, MCP config, rules, and .moatlog/

init creates:

  • .cursor/hooks.json and 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.

3

Restart Cursor

Restart Cursor so hooks and MCP reload. Without a restart, the agent won't capture events or connect to get_task_context.

4

Verify

Confirm hooks are active and check moat strength.

moatlog status

Show 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.