Skip to content

docs: Add agent-relay CLI patterns for direct visibility and log tailing#124

Merged
khaliqgant merged 12 commits intomainfrom
docs/lead-agent-cli-patterns
Jan 9, 2026
Merged

docs: Add agent-relay CLI patterns for direct visibility and log tailing#124
khaliqgant merged 12 commits intomainfrom
docs/lead-agent-cli-patterns

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

Enhanced lead agent documentation with practical agent-relay CLI patterns for real-time visibility and debugging.

Changes

  • Added agent-relay CLI usage guide (list agents, check status, view logs)
  • Documented agent-relay agents:logs with follow mode for real-time monitoring
  • Added common patterns for live agent monitoring during task execution
  • Provides alternative to relay message delays for direct visibility

Why This Matters

  • Lead agents need real-time visibility into spawned agent activity
  • Log tailing with -f flag enables live monitoring while agents work
  • Helps diagnose silent agents without waiting for relay messages
  • Faster troubleshooting of agent issues

Files Changed

  • .claude/agents/lead.md - Agent-Relay CLI patterns section

Testing

  • Tested with active agents: agent-relay agents
  • Verified log tailing: agent-relay agents:logs <name> -f
  • Confirmed help text: agent-relay agents:logs -h

Agent Relay and others added 11 commits January 9, 2026 21:04
…lay.json

BREAKING CHANGE: Trajectory config moved from repo-level (.relay/config.json)
to user-level centralized location.

Changes:
- Move relay config to ~/.config/agent-relay/relay.json (not repo-specific)
- Config applies globally to all projects via AGENT_RELAY_CONFIG_DIR env var
- Users opt-in to repo storage via central config: {"trajectories": {"storeInRepo": true}}
- Remove repo-level .relay/config.json (no longer needed)
- Update trajectory/config.ts with new getAgentRelayConfigDir() pattern
- Document trajectory system in lead.md with configuration instructions

Rationale:
- Centralized config avoids repo-specific clutter
- Single config applies to all projects in user's workspace
- Follows existing agent-relay pattern (AGENT_RELAY_CONFIG_DIR)
- Survives repo deletion; user can manage globally

Architecture:
- Primary: $AGENT_RELAY_CONFIG_DIR/relay.json
- Default: ~/.config/agent-relay/relay.json
- Trajectories stored in ~/.config/agent-relay/trajectories/<project-hash>/
- Optional: storeInRepo: true puts .trajectories/ in repo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…il spawn

Clarify that TRAJECTORIES_PROJECT and TRAJECTORIES_DATA_DIR are explicitly set
after spreading process.env, ensuring config-based values take precedence over
any parent shell environment variables.
Copy link
Copy Markdown
Member Author

Follow-up Work Captured in Beads

During this refactoring, we discovered an architectural limitation with the Trail CLI that has been documented as a beads task for future work:

bd-trail-config: Trail CLI Config File Reading

Issue: Trail CLI currently only reads trajectory storage location from the TRAJECTORIES_DATA_DIR environment variable set by the daemon. This creates a dependency where Trail CLI cannot work independently without the daemon pre-configuring the environment.

Solution: Trail CLI should be enhanced to read ~/.config/agent-relay/relay.json directly when the env var is not set, following the same centralized configuration pattern we've implemented in this PR.

Benefits:

  • Trail CLI can work standalone without daemon setup
  • Consistent behavior across all contexts (manual CLI invocations, daemon spawns, etc)
  • Config-driven approach instead of env var leakage between processes

Implementation Notes:

  • Check for config file before relying on TRAJECTORIES_DATA_DIR
  • Read from ~/.config/agent-relay/relay.json or $AGENT_RELAY_CONFIG_DIR/relay.json
  • Parse storeInRepo setting to determine storage location
  • Fall back to default ~/.config/agent-relay/trajectories/ if no config exists
  • Environment variables still take precedence (can override config)

See: .beads/beads.jsonl - task ID bd-trail-config

@khaliqgant khaliqgant merged commit ca61b6f into main Jan 9, 2026
6 checks passed
@khaliqgant khaliqgant deleted the docs/lead-agent-cli-patterns branch January 9, 2026 22:47
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