Skip to content

feat(consolidate): claude -p backend — works without an API key (0.20.0)#37

Merged
Shahinyanm merged 1 commit into
mainfrom
feat/consolidate-claude-p-backend
Jun 13, 2026
Merged

feat(consolidate): claude -p backend — works without an API key (0.20.0)#37
Shahinyanm merged 1 commit into
mainfrom
feat/consolidate-claude-p-backend

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

0.19.0's consolidate was API-key-only — unusable for anyone on a Claude subscription without an ANTHROPIC_API_KEY. This adds the local claude -p path.

consolidate::summarize now selects a backend:

  1. ANTHROPIC_API_KEY set → direct Haiku API (cheapest, ~1¢/run).
  2. else claude on PATH → claude -p (your subscription login, no API key needed; post-2026-06-15 bills extra + boots the env per call, so pricier).
  3. else → skips cleanly, writes nothing. No heuristic fallback.

Reuses the classifier's run_claude_json + ClaudeBinaryStdinRunner (recursion guard already set by base_claude_command). TJ_CONSOLIDATE_BACKEND=none force-disables.

Still manual-only, one call per run, never on a hook → cannot spend automatically.

Tests

Existing 5 core + 2 CLI green — the mock test still exercises the API path; the skip test forces TJ_CONSOLIDATE_BACKEND=none so it's deterministic even where claude is on PATH. Clean on default and --no-default-features.

🤖 Generated with Claude Code

The 0.19.0 consolidate was API-key-only, which left it unusable for anyone on
a Claude subscription without an ANTHROPIC_API_KEY (bd tj-09r8xz1kwa).

consolidate::summarize now selects a backend: direct Haiku API when
ANTHROPIC_API_KEY is set (cheapest, ~1c/run), else the local `claude -p`
binary via run_claude_json + ClaudeBinaryStdinRunner (subscription auth, no
key; recursion guard already set by base_claude_command), else Ok(None) so the
caller skips cleanly. TJ_CONSOLIDATE_BACKEND=none force-disables.

Still manual-only, one call per run, never on a hook → cannot spend
automatically. No backend => writes nothing, no heuristic fallback.

Tests: existing 5 core + 2 CLI green (mock test still exercises the API path;
skip test forces TJ_CONSOLIDATE_BACKEND=none so it's deterministic even where
`claude` is on PATH). Clean on default and --no-default-features.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Shahinyanm Shahinyanm merged commit e29039c into main Jun 13, 2026
13 of 14 checks passed
@Shahinyanm Shahinyanm deleted the feat/consolidate-claude-p-backend branch June 13, 2026 09:37
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