This repository has been archived on 2026-05-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
risv3-relay/README.md
ac 50d957e14e chore: seed repo with .gitignore, .env.example, README skeleton
Initial commit. Establishes:
- .gitignore: .env (secrets), .venv, __pycache__, runtime dirs
  (logs/, state/, queue/, dispatch/). Removes the duplicate .env
  entry and the .env.example exclusion that was preventing the
  example file from being tracked.
- .env.example: ANTHROPIC_API_KEY/MODEL placeholders, NTFY_TOPIC
  (auto-generated on first run), STATUS_PORT, HISTORY_CHAR_CAP.
- README: install + run quickstart.

The daemon implementation lands on a feature branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:13:57 +00:00

46 lines
1.7 KiB
Markdown

# risv3-relay
Relay daemon between Claude Code instances and a Claude.ai chat-equivalent session via the Anthropic API.
## What it does
When CC produces output that would normally be pasted to a Claude.ai chat for review or a decision, the daemon does the relay automatically:
1. CC drops a JSON envelope into `queue/`.
2. Daemon picks oldest-first, appends to a running conversation history, calls the Anthropic API.
3. If the response contains `[NEEDS-JC]` in its first 200 characters, the daemon pauses and notifies via [ntfy.sh](https://ntfy.sh).
4. Otherwise, the response is written to `dispatch/<session_id>/input.txt` for the originating CC session to consume.
JC can override at any time by writing to `state/jc_input.txt`.
## Install
```sh
git clone git@localhost:AC/risv3-relay.git
cd risv3-relay
python3 -m venv .venv
.venv/bin/pip install -e '.[dev]'
cp .env.example .env
# edit .env — add ANTHROPIC_API_KEY
```
## Run
```sh
.venv/bin/python -m relay run
```
The daemon prints the ntfy subscription URL on startup. Subscribe to it from your phone/laptop to receive `needs_jc` and error notifications.
## Project layout
- `relay/` — Python package
- `tests/` — pytest tests
- `queue/`, `dispatch/`, `state/`, `logs/` — runtime directories created on first run; gitignored
- `config.yaml` — registered CC sessions and per-session settings
- `.env` — secrets and per-host overrides; gitignored
## Status
First-PR scope: daemon skeleton, queue + dispatch loop, single-CC-session integration, basic logging, ntfy notifications, conversation history with summarization. See `docs/` and PR descriptions for follow-up scope (status web UI, multi-session, error recovery, cost tracking, systemd unit).