Add Claude Code harness adapter - #1
Open
courtlandleer wants to merge 1 commit into
Open
Conversation
New harnesses/claude_code.py + registry line. No capture plugin needed: Claude Code transcripts already persist real per-call provider usage (merged from streamed chunks by message.id), hook-injected context (SessionStart + UserPromptSubmit attachments -- the injected-context lane), and tool calls paired to results. Compiled system prompt is not persisted by Claude Code, so the system layer is a stub plus the captured SessionStart injection. Sidechain (subagent) records are skipped. Sessions list uses a regex-cheap scan with an mtime cache.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Claude Code as a third harness:
harnesses/claude_code.pyplus one registry line, per the documented extension point.What it reads:
~/.claude/projects/<slug>/<uuid>.jsonltranscripts directly -- no capture plugin needed. Claude Code already persists what the other harnesses need plugins for:message.idinto one message per API calladditionalContextattachments feed the per-turn injected-context lane (UserPromptSubmit attachments are written after the user record they annotate, so the adapter binds them to the preceding user message)tool_use_idNot available: the compiled system prompt (Claude Code never writes it) -- system layer is a stub + the captured SessionStart injection. Sidechain records are skipped.
Perf: sessions list is a regex-cheap line scan with an mtime/size cache; 150 sessions index in ~0.7s cold, instant warm. Full JSON parse only on trace load.
Env overrides:
CLAUDE_HOME,ROTOM_CLAUDE_PROJECTS. Session ids prefixedcc:. README section added mirroring the OpenClaw one.Tested against live session stores on two machines (macOS, Python 3.9).