BlogTasks and GitHub Issues
How do I put what Claude Code did back on the issue?
At the end of the session, ask Claude Code to write a summary to a file, then post it with gh issue comment 123 --body-file summary.md. Add --edit-last to update your previous comment rather than adding a new one each time. If you use Claude Code GitHub Actions, this part is automatic: results are posted as a comment on the issue that triggered the run.
The steps below use only the GitHub CLI and documented Claude Code features (October 2026).
What a good summary contains
A comment on the issue is for the next person who reads it, often you in two weeks. Keep it short and factual:
- What changed: files or modules, in one line each.
- Why: the cause found, if it was a bug.
- How it was checked: the tests or commands that were run, and their result.
- What is left: known gaps, follow-ups, anything the agent could not verify.
- Where it is: branch name or pull request.
Option 1: ask Claude Code at the end of the session
Anthropic's best-practices guide notes that Claude knows how to use gh for issues, pull requests and comments. Before you close the session, ask:
Write a summary of this session for issue #123 to summary.md:
what changed, why, how you verified it, what is left, and the branch name.
No secrets, tokens or internal URLs. Show it to me, then post it with
gh issue comment 123 --body-file summary.md
Asking to see it first gives you a chance to correct it before it is public. If you run this often, put the text in a skill so it becomes one command.
Option 2: post it yourself, after the session
If you'd rather keep posting in your own hands, generate the summary in print mode and pipe it to gh. claude -p --continue picks up the most recent conversation in the current directory, and gh issue comment reads the body from standard input with -F -:
claude -p --continue \
"Summarize this session for issue #123: what changed, why, how it was verified, what is left." \
> summary.md
$EDITOR summary.md
gh issue comment 123 --body-file summary.md
Or in one step, if you trust the output:
claude -p --continue "Summarize this session for issue #123 in markdown." \
| gh issue comment 123 -F -
Keep one comment per agent, not ten
Agents that report progress several times can bury the issue in comments. gh issue comment can edit instead of adding:
gh issue comment 123 --edit-last --create-if-none --body-file summary.md
--edit-last edits the last comment of the current user, and --create-if-none creates one if there isn't any yet. Note that "current user" is whoever gh is logged in as, so if you also comment by hand, the agent may edit your comment instead of its own.
Link the pull request too
A summary comment tells people what happened. A linked pull request closes the loop. Ask Claude to put a closing keyword in the PR description:
Closes #123
GitHub links the PR to the issue, and when it is merged into the default branch, the issue closes automatically.
Option 3: Claude Code GitHub Actions
With the GitHub Action installed (/install-github-app), mentioning @claude in an issue runs Claude Code in your repository's workflows. In interactive mode, progress and results appear as a comment on the triggering issue or PR, with no extra step. In automation mode (a workflow with a prompt input), results go to the workflow run log by default, unless the prompt tells Claude to post and it has a tool to do it.
Limits of these methods
- You have to remember. The summary is a prompt you type at the end. Sessions that end abruptly, or that you abandon, leave nothing on the issue.
- It posts as you.
ghuses your login, so the comment appears under your name. Readers can't tell it was written by an agent unless the text says so. - Review before posting. A summary can include paths, error output or values you don't want in a public issue. Read it first.
- One issue per session is up to you. Nothing checks that the session you summarize is the one that worked on issue 123.
With Kanbell
Kanbell is a macOS app with one window per project, real terminals and a task board that can be backed by GitHub Issues. For Claude Code, Kanbell publishes the session summary as a comment on the issue, so you don't have to write the summary prompt or the gh command yourself.
Agents can still read the board with the kanbell CLI (kanbell list, kanbell show). On GitHub, that CLI is read-only: any other comment, label or PR an agent creates goes through its own gh, under your account, as above. See how to connect Claude Code to GitHub Issues and how to start an agent from an issue without copy-pasting.
FAQ
Who appears as the author of the comment?
The account gh is logged in with. When Claude Code runs gh on your machine, the comment is posted under your GitHub account.
How do I avoid a new comment every time the agent reports?
Use gh issue comment --edit-last, which edits the last comment of the current user. Add --create-if-none to create one if none exists yet.
Can I generate the summary after the session has ended?
Yes. claude -p --continue resumes the most recent conversation in the current directory in print mode, so you can ask it for a summary and pipe the result to gh issue comment -F -.
Will merging the pull request close the issue?
Yes, if the pull request description links the issue with a supported keyword such as 'Closes #123' and the PR is merged into the default branch.