Skip to content

CLAUDE.md block: after a merge, gc --remove - #17

Merged
github-actions[bot] merged 3 commits into
mainfrom
improve/F-17-clean-up
Oct 30, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
improve/F-17-clean-up

Conversation

@zolotarev

@zolotarev zolotarev commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Friction — sessions left merged branches and copies behind (seen ×1, one project).

Change

  • CLAUDE.md block, Commits line: "after a merge dpcli gc --remove" — points at the existing mechanism; gc lists only merged copies and branches.
  • VERSION 29, CHANGELOG.

Per review: the update.py branch cleanup is dropped (one sighting; the line is tried first). metrics.py --check passes (prompt_tokens 7033 within tolerance); 190 tests green.

Sent by dpcli contribute. Anonymized: no project names, paths or quotes.

🤖 Generated with Claude Code

@zolotarev zolotarev added the feedback Friction reported from real use label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

VERDICT: rework

  • Weak evidence: "seen ×1 in 1 task", no feedback issue, no +1s. Leftover merged branches/worktrees is a mechanical problem; check whether dpcli already has a branch/worktree cleanup command (or could do it on merge/done) before adding prose to every session's prompt.
  • templates/claude-md.md:14: a new line is paid on every agent run. "branches, copies, temp files, processes" is vague and "or unneeded" can make an agent delete unmerged work or someone else's process. Narrow it to "delete your branch/worktree after it is merged" and drop "processes"/"unneeded".
  • templates/claude-md.md:3: unrelated rewrite of the first line. It drops the cd …;/&& hint and the "may be refused" reason, which makes the rule less clear. Revert it, or put it in a separate PR with its own CHANGELOG line.
  • No test, though CLAUDE.md requires a test that reproduces the friction. At minimum assert that the template contains the cleanup rule. Better, cover the cleanup in code if the first point leads there.
  • CLAUDE.md:21: this repo's own rules file is not shipped to projects. It duplicates the template line and the friction is not about working on dpcli itself. Remove it.
  • Check tools/budgets.json (prompt_tokens 6898) still passes after the template change. The PR does not show a budget run.
  • VERSION 29 and the CHANGELOG entry are fine. CHANGELOG should mention the first-line rewrite if you keep it.

@zolotarev

Copy link
Copy Markdown
Owner Author

Rework per review:

  • Cleanup moved to code: update (via check_prs) removes a local improve/F-n-… branch once its PR is merged, only if the branch tip equals the PR's headRefOid (a branch with other commits is kept). If .dpcli is on that branch, it detaches first, so update goes on instead of being skipped forever (".dpcli is on improve/…"). Test: test_update.test_merged_pr_branch_is_dropped_and_update_goes_on.
  • Prose narrowed to a pointer at the existing mechanism, merged into the Commits line: "after a merge dpcli gc --remove"; no "processes" / "unneeded".
  • First-line rewrite reverted (the && / cd …; hint and the reason are back).
  • Line in this repo's CLAUDE.md removed.
  • Budgets: metrics.py --check passes (prompt_tokens 7033, within tolerance of 6898; code_lines 5921 of 5906). 191 tests green.

@github-actions

Copy link
Copy Markdown

VERDICT: rework

  • Scope mismatch: the PR body describes only the CLAUDE.md line, but lib/dpcli/commands/update.py gains drop_branches (+21 lines) and reorders check_prs/update_dist. The friction (1 occurrence, 1 project) was merged branches/worktrees in the project, which gc --remove already covers. Drop the update.py part, or open a separate PR with its own friction (".dpcli stuck on a merged improve/* branch") and evidence.
  • Lightness: the new code is ~20 lines plus a 26-line test for a single sighting. "No data — no feature"; the template line alone is enough to try first.
  • If update.py stays: git branch -D is justified only by the tip == headRefOid check. That is sound, but say so in the PR body. Also note the output order change (PR lines now follow update_dist lines only because of the update_dist(a) + lines swap) and add a test for --prs-only.
  • templates/claude-md.md:13: wording "after a merge gc --remove" is clear. It also makes agents delete branches on their own, which is fine since gc lists only merged ones. Check that tools/budgets.json prompt_tokens still passes (I could not run the budget check here).
  • Process OK: VERSION 29 and CHANGELOG line present, English, anonymized. I did not run the tests locally, so CI must be green before merge.

@zolotarev zolotarev changed the title sessions leave merged branches behind CLAUDE.md block: after a merge, gc --remove Oct 30, 2026
@github-actions

Copy link
Copy Markdown

VERDICT: accept

  • Real friction from use (merged branches/copies left behind), minimal fix: one clause in templates/claude-md.md:13 pointing at the existing gc --remove (commands/branches.py:269), which per its help only deletes copies and branches already merged into the main branch, so it is not destructive.
  • VERSION 29 and the CHANGELOG line are present and in English, with no project data.
  • Nit: seen only once, so it is borderline under "no data — no feature". It stays acceptable because it is about +10 tokens and the PR dropped the heavier update.py change.
  • Nit: no test pins the new line. A test that the rendered CLAUDE.md block mentions gc --remove would be cheap if you want one.
  • I could not run tools/metrics.py --check or the tests here. This review relies on the PR's reported results (190 tests green, prompt_tokens within tolerance).

@github-actions github-actions Bot removed the rework label Oct 30, 2026
@github-actions
github-actions Bot merged commit 8b25235 into main Oct 30, 2026
3 checks passed
@github-actions
github-actions Bot deleted the improve/F-17-clean-up branch October 30, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback Friction reported from real use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant