Use StackMemory's three power features in any repo.
npm install -g @stackmemoryai/stackmemoryCreate or pick an existing Obsidian vault, then configure:
cd /path/to/your/repo
mkdir -p .stackmemory
cat > .stackmemory/config.yaml << 'EOF'
version: "1.10.2"
obsidian:
vaultPath: /path/to/your/obsidian/vault
subdir: stackmemory
watchRaw: true
autoIndex: true
EOFWhat happens:
vault/stackmemory/frames/— every frame auto-serialized as.mdwith YAML frontmatter +[[wiki-links]]vault/stackmemory/index.md— auto-maintained index (frame counts, recent frames)vault/stackmemory/raw/— drop web clipper.mdfiles here, auto-ingested as framesvault/stackmemory/sessions/— session summaries with backlinks
Web Clipper setup:
- Install Obsidian Web Clipper
- Set clip destination to
vault/stackmemory/raw/ - Clipped articles auto-ingest into StackMemory
Open vault: just open the vault folder in Obsidian. Graph view shows frame relationships.
cd /path/to/your/repo
stackmemory boardOpens http://localhost:3456 with:
- Sidebar: active sessions + conductor agent status cards
- Terminal: xterm.js rendering live Claude Code stream-json output
- Input bar: send messages to running agent's stdin
Usage:
- Click + NEW
- Enter a prompt (e.g., "fix the auth bug in src/auth.ts")
- Pick model (sonnet/opus/haiku)
- Click START — Claude Code spawns, output streams live
- Send follow-up messages via input bar
- Click KILL to stop
API (for scripting):
# Create session
curl -X POST http://localhost:3456/api/sessions \
-H 'Content-Type: application/json' \
-d '{"prompt":"fix failing tests","model":"sonnet"}'
# Send message to session
curl -X POST http://localhost:3456/api/sessions/SESSION_ID/message \
-H 'Content-Type: application/json' \
-d '{"message":"now run the linter"}'
# List sessions
curl http://localhost:3456/api/sessions
# List conductor agents
curl http://localhost:3456/api/agentsOptions:
stackmemory board --port 8080 # custom port
stackmemory board --no-open # don't auto-open browsercd /path/to/your/repo
stackmemory ralph loopmax "fix all failing tests and lint errors" \
--criteria "All tests pass, lint clean, build succeeds" \
--model sonnetOptions:
-c, --criteria <text> Completion criteria (default: "All tests pass, lint clean, build succeeds")
--no-worktree Work in current dir instead of isolated git worktree
--max-loops <n> Max iterations, 0=infinite (default: 0)
--max-stuck <n> Respawn fresh after N stuck loops (default: 3)
--commit-every <n> Auto-commit frequency in tool calls (default: 25)
--model <model> Claude model: sonnet, opus, haiku (default: sonnet)
What happens:
- Creates git worktree in
/tmp/loopmax-wt-*(isolated branch) - Spawns
claude -p --dangerously-skip-permissions - Agent codes, tests, fixes — no planning, just execution
- Auto-commits after every loop
- If stuck for 5min → kills agent, 3 stuck in a row → checkpoint + respawn
- After each loop: runs
test:run + lint + build— stops when all pass - Drafts/logs saved to
/tmp/loopmax-drafts/
Set env vars and run Claude directly — the Stop hook auto-respawns:
LOOPMAX=1 \
LOOPMAX_TASK="fix all tests" \
LOOPMAX_CRITERIA="tests pass, lint clean, build succeeds" \
LOOPMAX_MODEL=sonnet \
claude -p "fix all failing tests" --dangerously-skip-permissionsHooks (auto-installed in ~/.claude/settings.json):
loopmax-respawn.js(Stop): when session ends, checks criteria, respawns if not metloopmax-autocommit.js(PostToolUse): auto-commits every 25 tool calls
State files:
/tmp/loopmax-drafts/hook-state.json— loop state for respawn/tmp/loopmax-drafts/prompt-loop-N.md— prompt sent to each loop/tmp/loopmax-drafts/output-loop-N.txt— output from each loop/tmp/loopmax-drafts/summary-loop-N.md— checkpoint summaries
# 1. Configure Obsidian vault
cat > .stackmemory/config.yaml << 'EOF'
version: "1.10.2"
obsidian:
vaultPath: ~/obsidian-vault
EOF
# 2. Start the board (background)
stackmemory board &
# 3. Launch LoopMax
stackmemory ralph loopmax "implement the user auth feature" \
--criteria "All tests pass, lint clean, build succeeds" \
--model sonnet- Board at http://localhost:3456 shows LoopMax progress
- Obsidian vault fills with frame
.mdfiles as context is captured - LoopMax loops autonomously until criteria met, committing progress to git
- Web clipper drops into
raw/→ auto-ingested as frames → visible in Obsidian graph
| Issue | Fix |
|---|---|
Board server not found |
Run from repo root or install stackmemory globally |
| Obsidian vault not initializing | Check vaultPath exists and is absolute path |
| LoopMax not respawning | Verify LOOPMAX=1 env var is set, check /tmp/loopmax-drafts/hook-state.json |
| Hooks not firing | Run `cat ~/.claude/settings.json |
| Tests timing out in LoopMax | Add --max-stuck 2 to respawn faster |