Skip to content

Conversation

35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Aug 30, 2025

Closes #

Description

Type of Change

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

Module Information

Path: registry/[namespace]/modules/[module-name]
New version: v3.0.0
Breaking change: [ ] Yes [ ] No

Testing & Validation

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

Related Issues

@35C4n0r 35C4n0r self-assigned this Aug 30, 2025
# Conflicts:
#	registry/coder/modules/claude-code/README.md
#	registry/coder/modules/claude-code/main.tf
#	registry/coder/modules/claude-code/scripts/agentapi-start.sh
#	registry/coder/modules/claude-code/scripts/agentapi-wait-for-start.sh
#	registry/coder/modules/claude-code/testdata/agentapi-mock.js
@@ -1,117 +1,160 @@
---
display_name: Claude Code
description: Run Claude Code in your workspace
description: Run the Claude Code agent in your workspace to generate code and perform tasks.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: Run the Claude Code agent in your workspace to generate code and perform tasks.
description: Run the Claude Code agent in your workspace.

- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template

The `codercom/oss-dogfood:latest` container image can be used for testing on container-based workspaces.
- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template for task reporting features.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template for task reporting features.

Not needed but please test.


The `codercom/oss-dogfood:latest` container image can be used for testing on container-based workspaces.
- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template for task reporting features.
- An **Anthropic API key** is required for tasks. You can get one from the [Anthropic Console](https://console.anthropic.com/dashboard).
Copy link
Member

Choose a reason for hiding this comment

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

Lets make Tasks also work with CLAUDE_SESSION_TOKEN. For Claude.ai Pro and Max plan users.
Here is community member talking about it.
https://discord.com/channels/747933592273027093/1404654368745193492/1404692501268529206

Comment on lines +43 to 49
data "coder_parameter" "task_prompt" {
type = "string"
name = "AI Prompt"
name = "AI Task Prompt"
default = ""
description = "Write a prompt for Claude Code"
description = "Initial task prompt for Claude Code."
mutable = true
}
Copy link
Member

Choose a reason for hiding this comment

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

Aren't we moving this into the module?

Comment on lines +51 to +55
module "coder-login" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/coder-login/coder"
version = "1.0.31" # Use a recent version
agent_id = coder_agent.example.id
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
module "coder-login" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/coder-login/coder"
version = "1.0.31" # Use a recent version
agent_id = coder_agent.example.id

This is not required.

Comment on lines +65 to 91
claude_api_key = var.anthropic_api_key # required for tasks

# --- Versioning ---
claude_code_version = "1.0.82" # Pin to a specific version
agentapi_version = "v0.6.1"

# --- Task Configuration ---
task_prompt = data.coder_parameter.task_prompt.value
continue = true # will fail in a new workspace with no conversation/session to continue
model = "sonnet"

# --- Permissions & Tools ---
permission_mode = "plan"

# --- MCP Configuration ---
mcp = <<-EOF
{
"mcpServers": {
"my-custom-tool": {
"command": "my-tool-server"
"args": ["--port", "8080"]
}
}
}
EOF
}
```
Copy link
Member

Choose a reason for hiding this comment

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

please consult the doc I shared for the structure we want.

| `CODER_MCP_CLAUDE_CODER_PROMPT` | A custom coder prompt for Claude. | `""` |
| `CODER_MCP_CLAUDE_CONFIG_PATH` | Path to the Claude configuration file. | `~/.claude.json` |
| `CODER_MCP_CLAUDE_MD_PATH` | Path to a `CLAUDE.md` file for project-specific instructions. | `~/.claude/CLAUDE.md` |
| `CLAUDE_CODE_USE_BEDROCK` | Set to `"true"` to use Amazon Bedrock. Requires additional AWS configuration. | `""` |
Copy link
Member

Choose a reason for hiding this comment

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

lets make Bedrock and Vertex configuration its own example.

Comment on lines +128 to +132
env = {
CLAUDE_API_KEY = var.anthropic_api_key
CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT
You are a helpful assistant that can help with code.
EOT
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this? can't we handle them through the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants