Skip to content

feat(cli): add --json to recall for machine consumers#45

Merged
Shahinyanm merged 1 commit into
mainfrom
feat/loom-recall-json
Jun 14, 2026
Merged

feat(cli): add --json to recall for machine consumers#45
Shahinyanm merged 1 commit into
mainfrom
feat/loom-recall-json

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

recall already does semantic cross-project recall over global memory. This adds a --json flag so external callers (the Loom host) can consume hits as a JSON array — Loom shells out to task-journal recall "<context>" --json (same pattern it already uses for export) to surface "have we decided / ruled this out before?" during analysis.

  • New --json flag on the existing Recall command.
  • recall_hits_json helper (pure, unit-tested).
  • Empty / missing global memory → [] in JSON mode.

Backward compatibility

Additive. Without --json the human-readable output is byte-identical to before.

Verification

  • cargo test --workspace → all suites pass, 0 failed (~485 tests; tj-cli 118, +2 new)
  • smoke: task-journal recall "<q>" --json → valid JSON array, exit 0

🤖 Generated with Claude Code

The `recall` command already does semantic cross-project recall over
global memory; this adds a `--json` flag so external callers (the Loom
host) can consume the hits as a JSON array instead of human lines.

Additive and backward-compatible: without `--json` the human output is
unchanged. Empty / missing global memory prints `[]` in JSON mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Shahinyanm Shahinyanm merged commit 0bb52af into main Jun 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant