Skip to content

CLAUDE.md: document MCP write-tool workflow for no-local-checkout sessions - #167

Merged
d-morrison merged 1 commit into
mainfrom
docs/mcp-write-tools-remote-sessions
Jul 2, 2026
Merged

d-morrison merged 1 commit into
mainfrom
docs/mcp-write-tools-remote-sessions

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Summary

  • Discovered while implementing gha#152/Automate SENSITIVE_PATHS drift check for claude-code-action bumps #153 (this session had no local git
    clone at all — every branch, file edit, and PR went through the GitHub MCP
    tools).
  • CLAUDE.md's "GitHub access in remote / web sessions" section documented
    the read-side mapping (gh → MCP) thoroughly but had no guidance for the
    write side: creating a branch or editing a file with no local checkout to
    git commit/git push against.
  • Added a paragraph documenting the pattern (get_file_contents for the
    current blob sha → create_or_update_file with the full new content and
    that sha; re-fetch sha before every subsequent write) and two new table
    rows for create_or_update_file and create_branch.

Test plan

  • Docs-only change; not applicable to _selftest.yml.

Generated by Claude Code

…l checkout

Some remote/web sessions have no local git clone at all, not just a missing
gh CLI - every branch/file/PR change goes through the GitHub MCP write
tools. Document the get_file_contents -> create_or_update_file pattern
(full-file replace, sha required and must be re-fetched per write) and add
table rows for create_or_update_file and create_branch, discovered while
implementing gha#152/#153.
Copilot AI review requested due to automatic review settings July 2, 2026 06:54
@github-actions
github-actions Bot removed the request for review from Copilot July 2, 2026 06:55
@claude

claude Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 2m 49s —— View job


Todo

  • Gather context (PR diff, CLAUDE.md)
  • Review new CLAUDE.md content against repo conventions
  • Fact-check MCP tool names/parameters referenced
  • Post findings and verdict

Review

This is a docs-only addition to the "GitHub access in remote / web sessions" section of CLAUDE.md, documenting the write-side MCP workflow for sessions with no local git checkout at all.

Fact-check of the technical claims:

  • mcp__github__get_file_contents, mcp__github__create_or_update_file, and mcp__github__create_branch are all real tools in the GitHub MCP server's repos toolset (the first was already referenced elsewhere in this file before this PR).
  • The described semantics are correct against the underlying GitHub Contents API (PUT /repos/{owner}/{repo}/contents/{path}): sha is required to update an existing file (correctly hedged as "if it already exists" in the new table row) but not to create a new one; a stale sha does fail with a conflict, matching "re-fetch and retry rather than guessing"; and the endpoint indeed takes full file content only — there's no patch/diff mode.
  • Placement and formatting (bold callout paragraph + two new table rows before "CI runs & job logs") match the existing structure and verbosity of the surrounding section.

No blocking issues found. This is a pure documentation clarification with no code paths to break, and as CLAUDE.md itself notes, CLAUDE.md-only guidance changes with no consumer-visible effect are within the "nothing to log" changelog exemption — consistent with Require Changelog Entry currently showing green on this PR.

Verdict

Ready for merge

@d-morrison d-morrison added the no changelog label Jul 2, 2026 — with Claude
@d-morrison
d-morrison merged commit d3a155b into main Jul 2, 2026
17 of 18 checks passed
@d-morrison
d-morrison deleted the docs/mcp-write-tools-remote-sessions branch July 2, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant