Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
36cebbd
feat: refactor claude code to use agentapi module
35C4n0r Aug 30, 2025
6c5fbee
ref: bun fmt
35C4n0r Aug 30, 2025
02c8c4a
Merge branch 'main' into feat-claude-agentapi
35C4n0r Aug 30, 2025
9411582
feat: additional documentation
35C4n0r Aug 30, 2025
7fb8b86
ref: bun fmt
35C4n0r Aug 30, 2025
2b23801
feat: need to test if this works
35C4n0r Aug 30, 2025
4d53c76
feat: option to disable agentapi
35C4n0r Sep 4, 2025
fb2578c
revert changes
35C4n0r Sep 5, 2025
f5970dd
fix: fix tests
35C4n0r Sep 5, 2025
e51b46f
fix: fix tests
35C4n0r Sep 5, 2025
76fbed1
feat: add default
35C4n0r Sep 5, 2025
da5a5ee
feat: remove bedrock flag
35C4n0r Sep 7, 2025
edbf22d
feat: remove bedrock flag
35C4n0r Sep 7, 2025
70dbf5f
feat: add subdomain
35C4n0r Sep 10, 2025
06bb857
chore: format test
35C4n0r Sep 10, 2025
90d54c8
chore: resolve claude comments
35C4n0r Sep 12, 2025
a8eb4a7
feat: set subdomain default to false
35C4n0r Sep 12, 2025
b821ddd
Merge branch 'main' into feat-claude-agentapi
DevelopmentCats Sep 12, 2025
0551991
feat: address comments
35C4n0r Sep 13, 2025
d356bf2
feat: address comments
35C4n0r Sep 13, 2025
4a34f8d
chore: bun fmt
35C4n0r Sep 13, 2025
9406c9f
chore: address comments
35C4n0r Sep 13, 2025
20d115a
feat: add some new variables
35C4n0r Sep 15, 2025
6676679
feat: add some new variables
35C4n0r Sep 15, 2025
9e4c4eb
Merge branch 'main' into feat-claude-agentapi
35C4n0r Sep 15, 2025
8f8f28d
chore: improve README.md
35C4n0r Sep 15, 2025
dd22db2
chore: remove continue from example
35C4n0r Sep 16, 2025
bac0a4b
Update registry/coder/modules/claude-code/main.tf
35C4n0r Sep 16, 2025
43e1a08
Update registry/coder/modules/claude-code/README.md
35C4n0r Sep 16, 2025
c4fae64
chore: add claude_api_key variable to first usage example
DevelopmentCats Sep 18, 2025
a9fe876
feat: add explicit example for usage with claude code subscription
35C4n0r Sep 18, 2025
8475c27
Merge branch 'main' into feat-claude-agentapi
35C4n0r Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ref: bun fmt
  • Loading branch information
35C4n0r committed Aug 30, 2025
commit 7fb8b86ed58790600d303acece7557edbd8909eb
18 changes: 9 additions & 9 deletions registry/coder/modules/claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ module "claude-code" {

The module can be further configured using environment variables set on the Coder agent. This allows for more advanced or dynamic setups.

| Variable | Description | Default |
| ------------------------------------ | ------------------------------------------------------------------------------ | ---------------------------------------------- |
| `CLAUDE_API_KEY` | Your Anthropic API key. | `""` |
| `CODER_MCP_CLAUDE_SYSTEM_PROMPT` | A custom system prompt for Claude. | "Send a task status update..." |
| `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. | `""` |
| Variable | Description | Default |
| -------------------------------- | ----------------------------------------------------------------------------- | ------------------------------ |
| `CLAUDE_API_KEY` | Your Anthropic API key. | `""` |
| `CODER_MCP_CLAUDE_SYSTEM_PROMPT` | A custom system prompt for Claude. | "Send a task status update..." |
| `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. | `""` |

An example of setting these on a `coder_agent` resource:

```tf
resource "coder_agent" "main" {
# ... other agent config
env = {
CLAUDE_API_KEY = var.anthropic_api_key
CLAUDE_API_KEY = var.anthropic_api_key
CODER_MCP_CLAUDE_SYSTEM_PROMPT = <<-EOT
You are a helpful assistant that can help with code.
EOT
Expand Down
19 changes: 12 additions & 7 deletions registry/coder/modules/claude-code/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("claude-code", async () => {
const resp = await execContainer(id, [
"bash",
"-c",
'cat /home/coder/.claude-module/install.log',
"cat /home/coder/.claude-module/install.log",
]);
expect(resp.stdout).toContain(version_to_install);
});
Expand Down Expand Up @@ -129,9 +129,9 @@ describe("claude-code", async () => {
mcpServers: {
test: {
command: "test-cmd",
type: "stdio"
}
}
type: "stdio",
},
},
});
const { id } = await setup({
moduleVariables: {
Expand Down Expand Up @@ -159,7 +159,7 @@ describe("claude-code", async () => {
const resp = await execContainer(id, [
"bash",
"-c",
'cat /home/coder/.claude-module/agentapi-start.log',
"cat /home/coder/.claude-module/agentapi-start.log",
]);
expect(resp.stdout).toContain(prompt);
});
Expand Down Expand Up @@ -264,8 +264,13 @@ describe("claude-code", async () => {
});
await execModuleScript(id);

const installLog = await readFileContainer(id, "/home/coder/.claude-module/install.log");
expect(installLog).toContain("Configuring Claude Code to report tasks via Coder MCP");
const installLog = await readFileContainer(
id,
"/home/coder/.claude-module/install.log",
);
expect(installLog).toContain(
"Configuring Claude Code to report tasks via Coder MCP",
);
});

test("dangerously-skip-permissions", async () => {
Expand Down
1 change: 0 additions & 1 deletion registry/coder/modules/claude-code/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ printf "ARG_PERMISSION_MODE: %s\n" "$ARG_PERMISSION_MODE"
printf "ARG_TASK_PROMPT: %s\n" "$ARG_TASK_PROMPT"
printf "ARG_WORKDIR: %s\n" "$ARG_WORKDIR"


echo "--------------------------------"

# see the remove-last-session-id.sh script for details
Expand Down
2 changes: 1 addition & 1 deletion registry/coder/modules/claude-code/testdata/claude-mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ set -e
while true; do
echo "$(date) - claude-mock"
sleep 15
done
done
Loading