[PR #563] Extract plan messages from Claude Code transcripts #570

Closed
opened 2026-03-02 04:14:00 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/git-ai-project/git-ai/pull/563

State: closed
Merged: Yes


Summary

  • Detect Claude Code plan file writes/edits (to ~/.claude/plans/*.md) in JSONL transcripts and emit Message::Plan instead of Message::ToolUse
  • Track running plan state via HashMap so Edit operations reconstruct the full plan content (not just the diff)
  • Fix Ubuntu CI race condition in skills_installer test by adding #[serial] + temp HOME isolation

Closes #370

Details

Claude Code writes plans to files outside the repo (e.g. ~/.claude/plans/abstract-frolicking-neumann.md) via Write and Edit tool calls. These were previously recorded as ToolUse messages in transcripts, making plans invisible to consumers.

This PR:

  1. Plan detection (is_plan_file_path): Identifies files under ~/.claude/plans/ ending with .md
  2. Plan extraction (extract_plan_from_tool_use): Extracts plan content from Write/Edit tool calls, maintaining a running HashMap<String, String> of plan state per file path so that Edit operations (string replace) produce the full updated plan text
  3. Parser integration: Both Claude Code and Droid JSONL parsers now emit Message::Plan for plan tool calls
  4. CI fix: The test_install_and_uninstall_skills_lifecycle test was racing with codex tests that mutate HOME; added #[serial] and with_temp_home isolation

Test plan

  • 13 new unit tests covering plan detection, extraction, state tracking, serialization, and full JSONL parsing
  • Test fixture claude-code-with-plan.jsonl with realistic plan Write, Edit, and non-plan code Edit
  • All existing tests continue to pass
  • CI green on Ubuntu, macOS, and Windows

🤖 Generated with Claude Code


Open with Devin
**Original Pull Request:** https://github.com/git-ai-project/git-ai/pull/563 **State:** closed **Merged:** Yes --- ## Summary - Detect Claude Code plan file writes/edits (to `~/.claude/plans/*.md`) in JSONL transcripts and emit `Message::Plan` instead of `Message::ToolUse` - Track running plan state via HashMap so Edit operations reconstruct the full plan content (not just the diff) - Fix Ubuntu CI race condition in `skills_installer` test by adding `#[serial]` + temp HOME isolation Closes #370 ## Details Claude Code writes plans to files outside the repo (e.g. `~/.claude/plans/abstract-frolicking-neumann.md`) via Write and Edit tool calls. These were previously recorded as `ToolUse` messages in transcripts, making plans invisible to consumers. This PR: 1. **Plan detection** (`is_plan_file_path`): Identifies files under `~/.claude/plans/` ending with `.md` 2. **Plan extraction** (`extract_plan_from_tool_use`): Extracts plan content from Write/Edit tool calls, maintaining a running `HashMap<String, String>` of plan state per file path so that Edit operations (string replace) produce the full updated plan text 3. **Parser integration**: Both Claude Code and Droid JSONL parsers now emit `Message::Plan` for plan tool calls 4. **CI fix**: The `test_install_and_uninstall_skills_lifecycle` test was racing with codex tests that mutate HOME; added `#[serial]` and `with_temp_home` isolation ## Test plan - [x] 13 new unit tests covering plan detection, extraction, state tracking, serialization, and full JSONL parsing - [x] Test fixture `claude-code-with-plan.jsonl` with realistic plan Write, Edit, and non-plan code Edit - [x] All existing tests continue to pass - [x] CI green on Ubuntu, macOS, and Windows 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/git-ai-project/git-ai/pull/563" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
kerem 2026-03-02 04:14:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#570
No description provided.