AI agents

Real-world examples

Example: Git workflow — branch, commit, PR

Prompt examples are illustrative; commands are verified against official docs.

Scenario: you finished a feature on a branch and want to commit cleanly and open a PR. All three tools can drive git through their shell tool; built-in git conveniences vary. Unverifiable capabilities are marked as such.

Workflow

  1. Review the diff before committing.
  2. Have the agent stage and commit with a good message.
  3. Generate a PR description and open the PR.

Claude Code

Review uncommitted changes first:

/diff

Commit through the agent (it runs git via its Bash tool):

Review the staged changes, then commit them with a conventional commit
message that summarizes the why, not just the what.

Commit/PR attribution (e.g. the co-authored-by trailer) is controlled by the attribution setting (commit, pr) in settings.json.

Isolated work: claude --worktree (or -w) starts the session in a dedicated git worktree at <repo>/.claude/worktrees/<name> — useful for letting the agent commit without touching your checkout.

PR flows:

Create a pull request with gh, including a summary of the changes and a
test plan in the description.
/pr-comments 142    # pull a PR's comments into the session

/install-github-app sets up the GitHub integration for hosted PR review. Note: the research notes do not verify a built-in Claude command that creates PRs — creation goes through gh as above.

Codex

Review changes (including untracked files) before committing:

/diff

Commit through the agent:

Stage and commit these changes with a conventional commit message.

Heads-up: in workspace-write sandbox mode, <root>/.git is a protected read-only path, so git commit may still require an approval prompt — that is expected behavior, not a bug.

Work on a branch without switching your own checkout:

Create a new branch feature/password-reset and move the current uncommitted
changes onto it.

PR description generation:

Generate a PR description for this branch vs. main: summary, key changes,
and test plan. Then open the PR with gh.

There is no verified Codex slash command that creates PRs; codex review --base main (see Example: Review changed code) covers the pre-merge review step.

Kimi Code

Review the diff via shell mode (! in the empty input box; output enters the conversation) — no built-in /diff command is verified:

!git status && git diff

Commit through the agent:

Stage these changes and commit with a conventional commit message that
explains the intent.

PR description generation:

Compare this branch against main and write a PR description (summary, key
changes, test plan), then create the PR with gh.

None of the git/PR steps above have dedicated Kimi Code commands — they run through the agent’s shell tool, so each git command triggers an approval in the default Always Ask mode (or runs automatically in Ask When Needed /yolo). Dedicated PR creation/review commands: unverified as of this writing.


Last verified: 2026-09-07

AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.