Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Subagents that report through SubagentHandback never produce passive captures

Open Beginner friendly
#2,206 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, go, shell

Research direction

Start in the plugin's subagent-stop.sh hook, at the place where it reads last_assistant_message and stdout from the hook input on stdin. Extend that read to also parse agent_transcript_path, pulling the last assistant tool_use entry named SubagentHandback and using its input.message when non-empty. Build a small fixture transcript with a handback-only subagent and confirm the ## Key Learnings block reaches passive observations; the issue's own jq snippet and the referenced #653 / #1403 fixes are the model to follow.

Written by the indexing model from the issue text.

Description

status:needs-review type:bug
Existing Issue Search
  • I searched existing issues and will add evidence to a canonical tracker when applicable.
📝 Observed Consequence

Newer Claude Code versions often have subagents deliver their final report through the SubagentHandback tool. When that happens, nothing gets captured: the ## Key Learnings in the report never reach engram, and there's no error anywhere. Over 5 days I had 17 subagents like that and none of their learnings were saved (64 in total). Every subagent that ended with a normal text reply was captured fine.

🔄 Steps to Reproduce
  1. Use Claude Code v2.1.271 or later with the engram plugin.
  2. Run a subagent that hands back its report through SubagentHandback, without a plain text final message, and with a ## Key Learnings block in it.
  3. Check passive observations. Nothing new shows up.
✅ Expected Behavior

The learnings in the handback report get captured like any other subagent's.

❌ Actual Behavior

Nothing is captured.

Operating System

macOS

Release Version (Report Context)

3.6.0 (Claude Code plugin 0.1.14)

Agent / Client

Claude Code

📋 Relevant Logs

💡 Additional Context

According to the Claude Code hooks docs, when a subagent uses SubagentHandback, last_assistant_message only has the closing text and the report is the tool call's message input. subagent-stop.sh only reads last_assistant_message and stdout, so it never sees the report. This is not Windows-specific, it's just where I ran into it.

Locally I patched the hook to take the last SubagentHandback message from agent_transcript_path and prefer it when there is one:

HANDBACK=null
TRANSCRIPT=$(printf '%s' "$INPUT" | jq -r '.agent_transcript_path // empty')
TRANSCRIPT=${TRANSCRIPT%$'\r'}
if [ -n "$TRANSCRIPT" ] && [ -f "$TRANSCRIPT" ]; then
  HANDBACK=$(tail -n 50 "$TRANSCRIPT" 2>/dev/null | jq -Rnac '[inputs | fromjson? | select(type == "object" and .message?.role? == "assistant") | .message.content[]? | select(type == "object" and .type? == "tool_use" and .name? == "SubagentHandback") | .input.message?] | last' 2>/dev/null)
  HANDBACK=${HANDBACK%$'\r'}
  [ -n "$HANDBACK" ] || HANDBACK=null
fi

Then I pass it with --argjson handback "$HANDBACK" and use it as the content when it's a non-empty string. I only read the last 50 lines because some of my subagent transcripts are close to 200 MB. The \r trim is there because scoop's jq on Windows outputs CRLF.

A PostToolUse hook on SubagentHandback that reads tool_input.message might be a cleaner way to do it. Earlier fixes to this same hook: #653, #1403.

Dominant language
Go
Stars
7.1k
Forks
729
Avg merge
9h 44m
Merged PRs (30d)
278

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Gentleman-Programming/engram

All issues in Gentleman-Programming/engram

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.