Skip to content

Document {id} placeholder in RECALL_*_CMD env vars #21

Description

@tmad4000

Issue

The RECALL_CLAUDE_CMD / RECALL_CODEX_CMD / RECALL_FACTORY_CMD / RECALL_OPENCODE_CMD env vars accept a {id} placeholder that recall substitutes with the session ID before launching. This is implemented in src/session.rs L102:

/// Env var format: "program arg1 arg2 {id}" where {id} is replaced with session ID
let cmd = cmd.replace("{id}", &self.id);

…but neither the README nor recall --help mentions the placeholder. As a result, a user who wants to add flags to the launch command (e.g. --dangerously-skip-permissions) will naturally write:

export RECALL_CLAUDE_CMD="claude --dangerously-skip-permissions"

…which silently drops the session ID. Selecting a Claude session in the TUI then launches a brand-new Claude (no --resume), and because Claude's stdin isn't a TTY in recall's exec context, it falls into --print mode and errors:

Error: Input must be provided either through stdin or as a prompt argument when using --print

recall list JSON also reflects the lossy resume command in the resume_command field, which makes the bug only visible if you happen to compare against the unset-env-var baseline.

Suggested fix

A one-line README addition under the customization / env-vars section, e.g.:

Note: Custom commands must include {id} where the session ID should go.
Example: RECALL_CLAUDE_CMD="claude --resume {id} --dangerously-skip-permissions"

Optionally, recall could:

  1. Warn at startup if a RECALL_*_CMD is set without {id}.
  2. Auto-append --resume {id} / resume {id} if the placeholder is missing and the command matches a known launcher.

Happy to send a PR for the README change if useful.

Repro

export RECALL_CLAUDE_CMD="claude --dangerously-skip-permissions"
recall list | jq '.sessions[] | select(.source=="claude") | .resume_command' | head -1
# → "claude --dangerously-skip-permissions"   (session ID dropped)

export RECALL_CLAUDE_CMD="claude --resume {id} --dangerously-skip-permissions"
recall list | jq '.sessions[] | select(.source=="claude") | .resume_command' | head -1
# → "claude --resume <uuid> --dangerously-skip-permissions"   (correct)

Version

recall 0.5.0 on macOS 15.4 (M5 MacBook).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions