Prerequisites
This tool uses Bun Secrets to safely store items in your keychain and requires the userspace to have access to it.
While this is guaranteed on Windows and macOS machines, Linux users must have a compatible libsecret keychain available on the shell session.
Usage
machine-memory init (--local|--remote|--mcp)This command creates AGENTS.md when it does not exist, or replaces the content between the machine-memory:start and machine-memory:end markers when it already exists. Everything outside those markers is preserved.
The generated block tells future agents how to scan memory, which backend to use, and how to maintain durable project context. The selected backend is written into the block so its examples stay consistent with the command you ran.
Backend selection
Exactly one flag is required:
machine-memory init --localmachine-memory init --remotemachine-memory init --mcp| Flag | Agents should use | Notes |
|---|---|---|
--local |
CLI with --local |
SQLite at machine-memory.db |
--remote |
CLI with --remote |
Shared Worker; see remote |
--mcp |
MCP tools only | No CLI required; see MCP init |
For MCP-only repos without the CLI installed, use the public script instead:
curl -fsSL https://machine-memory.jfa.dev/init-mcp | bashOn Windows:
irm https://machine-memory.jfa.dev/init-mcp.ps1 | iexDetails: MCP → Init.
When to run it
Run this after changing the project’s memory workflow or backend policy. It is safe to run again: the managed block is updated in place rather than appended repeatedly.