Skip to content

Conversation

ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Oct 1, 2025

Description

This PR updates the claude-code module to automatically include the Coder task-reporting system prompt whenever report_tasks = true, and to wrap the final system prompt in <system>…</system> when non-empty.

Previously, users needed to manually include this content in their system prompts to enable proper task reporting. When report_tasks = true, the system prompt is prepended with the Coder task-reporting, and any user system_prompt (if provided) is appended after it, ensuring consistent integration without manual copy/paste.

When report_tasks = false, the module includes only the user system_prompt (if any). If both report_tasks = false and system_prompt is empty, the system prompt sent to Claude is empty.

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/claude-code
New version: v3.0.2
Breaking change: [] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related to internal slack thread: https://codercom.slack.com/archives/C0992H8HGCS/p1759317555713269

@ssncferreira ssncferreira marked this pull request as ready for review October 1, 2025 15:17
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests!

@DevelopmentCats
Copy link
Contributor

The only issue that I see with this, is if someone wanted to disable report_tasks and just use this standalone, it would still direct the AI to report when it would not be possible. Not that this would necessarily be the end of the world experience wise.

@ssncferreira
Copy link
Contributor Author

@johnstcn @mafredri @DevelopmentCats thank you for the review.
What if we keep system_prompt as-is and introduce a new boolean variable include_coder_system_prompt that defaults to true? Meaning that:

  • if include_coder_system_prompt = true, we append whatever the user specifies in system_prompt, if any.
  • if include_coder_system_prompt = false, system_prompt fully replaces the prompt.

This would still be a breaking change, and we would need to update the documentation to recommend include_coder_system_prompt = true for proper integration with Coder. Wdyt?

@johnstcn
Copy link
Member

johnstcn commented Oct 2, 2025

What if we keep system_prompt as-is and introduce a new boolean variable include_coder_system_prompt that defaults to true? Meaning that:

  • if include_coder_system_prompt = true, we append whatever the user specifies in system_prompt, if any.
  • if include_coder_system_prompt = false, system_prompt fully replaces the prompt.

This would still be a breaking change, and we would need to update the documentation to recommend include_coder_system_prompt = true for proper integration with Coder. Wdyt?

My understanding is that the "breaking" part of this change would be defaulting include_coder_system_prompt to true. We could have a cutover period where we default this to false initially (current behaviour) and recommend that this is set to true in the documentation. We may decide to default this to true later. WDYT?

@ssncferreira
Copy link
Contributor Author

ssncferreira commented Oct 3, 2025

My understanding is that the "breaking" part of this change would be defaulting include_coder_system_prompt to true. We could have a cutover period where we default this to false initially (current behaviour) and recommend that this is set to true in the documentation. We may decide to default this to true later. WDYT?

That’s a good approach. We can release a minor version now with include_coder_system_prompt added (default to false) so users can opt in, and then change the default to true in the next major release 👍

@DevelopmentCats
Copy link
Contributor

My understanding is that the "breaking" part of this change would be defaulting include_coder_system_prompt to true. We could have a cutover period where we default this to false initially (current behaviour) and recommend that this is set to true in the documentation. We may decide to default this to true later. WDYT?

That’s a good approach. We can release a minor version now with include_coder_system_prompt added (default to false) so users can opt in, and then change the default to true in the next major release 👍

Sounds good to me! Once this is done I'll this to the list of things to expand to the other AI modules as well.

@ssncferreira ssncferreira requested a review from johnstcn October 6, 2025 11:25
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for implementing this change @ssncferreira!

@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label Oct 6, 2025
@ssncferreira ssncferreira added version:minor Add to PRs requiring a minor version upgrade and removed version:minor Add to PRs requiring a minor version upgrade labels Oct 6, 2025
@ssncferreira ssncferreira added version:patch Add to PRs requiring a patch version upgrade and removed version:minor Add to PRs requiring a minor version upgrade labels Oct 6, 2025
@ssncferreira ssncferreira requested a review from matifali October 6, 2025 18:24
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about these suggestions?

@ssncferreira ssncferreira merged commit d057a82 into main Oct 7, 2025
4 checks passed
@ssncferreira ssncferreira deleted the ssncferreira/feat-claude-code-system-prompt branch October 7, 2025 09:09
ssncferreira added a commit that referenced this pull request Oct 7, 2025
…#461)

## Description

Update `report_tasks_system_prompt` to include `coder_report_task`
summary rules.

## Type of Change

- [ ] New module
- [x] Bug fix
- [ ] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information

**Path:** `registry/coder/modules/claude-code`  
**New version:** `v3.0.3`  
**Breaking change:** [ ] Yes [x] No

## Testing & Validation

- [x] Tests pass (`bun test`)
- [x] Code formatted (`bun run fmt`)
- [x] Changes tested locally

## Related Issues

Follow-up from: #443
Related to: https://github.com/coder/coder/pull/20191/files#r2410441026
ssncferreira added a commit to coder/coder that referenced this pull request Oct 15, 2025
## Description

Update `claude_code` module `system_prompt` variable in template "Write
Coder on Coder". Claude-code module now incorporates Coder's inner
system prompt for proper integration with task reporting.

Related to PRs:
* #20053
* coder/registry#443 and
coder/registry#461

---------

Co-authored-by: Atif Ali <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:patch Add to PRs requiring a patch version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants