Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: refactor claude code to use agentapi module #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
35C4n0r wants to merge 18 commits into coder:main
base: main
Choose a base branch
Loading
from 35C4n0r:feat-claude-agentapi

Conversation

Copy link
Collaborator

@35C4n0r 35C4n0r commented Aug 30, 2025
edited
Loading

Closes #302

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 added 5 commits August 31, 2025 00:18
# 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

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

@matifali matifali Sep 4, 2025

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

Copy link
Collaborator Author

@35C4n0r 35C4n0r Sep 5, 2025

Choose a reason for hiding this comment

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

@matifali thanks for linking this, added it to the module.

Copy link
Member

Choose a reason for hiding this comment

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

@35C4n0r Can we also mention the CLAUDE_SESSION_TOKEN here?

Copy link
Collaborator Author

35C4n0r commented Sep 10, 2025

Linked the issue, the issue also asks for subdomain, will add that today.

matifali reacted with thumbs up emoji

Copy link
Collaborator Author

35C4n0r commented Sep 10, 2025

Linked the issue, the issue also asks for subdomain, will add that today.

added subdomain 👍🏻

Copy link
Contributor

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

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

LGTM

Provided we are cool with the shift of standardization in variables for AI Modules this looks good to me. I have tested and it works fine.


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.

@35C4n0r Can we also mention the CLAUDE_SESSION_TOKEN here?

agent_id = coder_agent.example.id
workdir = "/home/coder/project"
# --- Authentication --- required for 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
# --- Authentication --- required for tasks

# OR
claude_code_oauth_token = "xxxxx-xxxx-xxxx"
# --- Versioning ---
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
# --- Versioning ---

claude_code_version = "1.0.82" # Pin to a specific version
agentapi_version = "v0.6.1"
# --- Task Configuration ---
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
# --- Task Configuration ---

continue = true # will fail in a new workspace with no conversation/session to continue
model = "sonnet"
# --- Permissions & Tools ---
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
# --- Permissions & Tools ---

# --- Permissions & Tools ---
permission_mode = "plan"
# --- MCP Configuration ---
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
# --- MCP Configuration ---


Run Claude Code as a standalone app in your workspace. This will install Claude Code and run it without any task reporting to the Coder UI.
Run Claude Code as a standalone CLI in your workspacewithout task reporting to the Coder UI.
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
Run Claude Code as a standalone CLI in your workspace without task reporting to the Coder UI.
Run and configure Claude Code as a standalone CLI in your workspace.

| -------------------------------- | ------------------------------------------------------------- | ------------------------------ |
| `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. | `""` |
Copy link
Member

Choose a reason for hiding this comment

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

What is it for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll remove the environment variable section, it's causing confusion.
ref: https://coder-uae3647.slack.com/archives/C08PHACTZRB/p1756400068946909?thread_ts=1756398053.136979&cid=C08PHACTZRB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@matifali matifali matifali requested changes

@DevelopmentCats DevelopmentCats DevelopmentCats approved these changes

Requested changes must be addressed to merge this pull request.

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

claude-code module: refactor to use agentapi

AltStyle によって変換されたページ (->オリジナル) /