Skip to content

chore(claude-code)!: strip boundary, agentapi, tasks, tools#861

Merged
matifali merged 5 commits intomainfrom
chore/claude-code-strip-boundary-agentapi-tasks
Apr 24, 2026
Merged

chore(claude-code)!: strip boundary, agentapi, tasks, tools#861
matifali merged 5 commits intomainfrom
chore/claude-code-strip-boundary-agentapi-tasks

Conversation

@matifali
Copy link
Copy Markdown
Member

@matifali matifali commented Apr 22, 2026

Summary

Reduces claude-code to a minimal install-and-configure module for the Claude CLI. Boundary, agentapi, task reporting, session tracking, tool allow/deny, and start orchestration are removed. Script execution is delegated to coder-utils v1.2.0. Starting Claude is now the caller's responsibility (template command, IDE launcher, or a custom coder_script).

Warning

This is a breaking change. See the migration guide below.

Changes

  • Delete scripts/start.sh. The module no longer launches Claude.
  • Replace the agentapi sub-module with coder-utils v1.2.0 for install/pre/post script orchestration.
  • Remove Boundary install, agentapi install, task reporting, session tracking, and tool allow/deny logic.
  • Remove the npm installation path. The module now always uses the official claude.ai/install.sh installer.
  • Render scripts/install.sh.tftpl once at plan time via templatefile() and pass the result directly to coder-utils, replacing the runtime base64 encode/decode wrapper and the redundant scripts/install.sh.
  • Make workdir optional. When set, the module pre-creates the directory and pre-accepts the Claude Code trust dialog for it. When unset, the module installs the CLI and configures authentication only; users accept trust dialogs interactively per project.
  • Scope MCP servers to Claude Code's user scope via claude mcp add-json --scope user so they are available across every project the workspace owner opens, instead of being tied to a single project directory.
  • Drop primaryApiKey from the standalone-mode config writer — credentials are already exported via coder_env, writing the key into ~/.claude.json had no effect.
  • Rename variable claude_api_keyanthropic_api_key (env ANTHROPIC_API_KEY).
  • Rename variable enable_aibridgeenable_ai_gateway.
  • AI Gateway now sets ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY) to the workspace owner's Coder session token, matching the AI Gateway centralized API key flow.
  • Fix configure_standalone_mode to also recognize CLAUDE_CODE_OAUTH_TOKEN so OAuth-only users get the onboarding bypass.
  • Add scripts output (pass-through from coder-utils) so upstream modules can serialize their coder_script resources behind this module's install pipeline via coder exp sync want.
  • Remove the task_app_id output.
  • Module logs now live at $HOME/.coder-modules/coder/claude-code/logs/ (was $HOME/.claude-module/).
  • Drop variables: report_tasks, system_prompt, claude_md_path, allowed_tools, disallowed_tools, enable_boundary, boundary_version, compile_boundary_from_source, use_boundary_directly, order, group, web_app, cli_app, web_app_display_name, cli_app_display_name, install_agentapi, agentapi_version, ai_prompt, subdomain, resume_session_id, continue, dangerously_skip_permissions, enable_state_persistence, permission_mode, install_via_npm.
  • README: reorder sections (migration warning → prerequisites → workdir → examples), add v4 migration warning with links to Coder Tasks and Boundary docs, move MCP scope note inline with the advanced config example, bump version references to 5.0.0.

Breaking Changes

Before After
claude_api_key anthropic_api_key
enable_aibridge enable_ai_gateway
AI Gateway set ANTHROPIC_API_KEY to session token AI Gateway sets ANTHROPIC_AUTH_TOKEN to session token
workdir required workdir optional
MCP servers scoped to project directory MCP servers scoped to user (available across all projects)
module.claude-code.task_app_id removed (no coder_app created)
permission_mode removed (pass via your own start script)
install_via_npm removed (module always uses the official installer)
ai_prompt, system_prompt, allowed_tools, disallowed_tools, report_tasks, session/continue vars, Boundary vars, agentapi vars, web_app/cli_app vars, order/group, enable_state_persistence removed
$HOME/.claude-module/*.log $HOME/.coder-modules/coder/claude-code/logs/*.log

Callers depending on any of the above must migrate. The module no longer starts Claude — provide your own coder_script or template command if you want it to launch automatically.

Validation

  • terraform fmt -recursive clean
  • terraform validate clean
  • terraform test → 13/13 pass
  • bun test registry/coder/modules/claude-code → 12/12 pass
  • shellcheck --severity=warning clean
  • prettier --check clean

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑‍💻

@matifali matifali marked this pull request as ready for review April 22, 2026 16:45
@matifali matifali force-pushed the chore/claude-code-strip-boundary-agentapi-tasks branch 8 times, most recently from 92718d5 to 42ff02a Compare April 22, 2026 17:59
@matifali matifali requested review from 35C4n0r and evgeniy-scherbina and removed request for evgeniy-scherbina April 22, 2026 18:01
@matifali matifali changed the title chore(claude-code): strip boundary, agentapi, tasks, tools chore(claude-code)!: strip boundary, agentapi, tasks, tools Apr 22, 2026
…tasks, tools

- Remove boundary variables and install logic.
- Drop agentapi module; orchestrate scripts through coder-utils instead.
- Remove start-script-only variables not shared with install
  (resume_session_id, continue, ai_prompt, dangerously_skip_permissions).
- Remove allowed_tools and disallowed_tools.
- Remove report_tasks, system_prompt, claude_md_path, and coder exp mcp /
  coder_report_task wiring.
- Rename claude_api_key to anthropic_api_key (ANTHROPIC_API_KEY).
- Rename enable_aibridge to enable_ai_gateway.
- Drop install_via_npm; always use the official claude.ai/install.sh installer.
- Tighten workdir description and drop dead module_dir_name/task_app_id.
- Move module logs to $HOME/.coder-modules/coder/claude-code/logs (matches
  coder-utils 1.3.0 nested layout).
@matifali matifali force-pushed the chore/claude-code-strip-boundary-agentapi-tasks branch 3 times, most recently from 3c9937a to 3885188 Compare April 24, 2026 11:19
matifali added a commit that referenced this pull request Apr 24, 2026
…le_directory (#874)

## Summary

Derives `coder-utils` script names from `module_directory` instead of a
separate `agent_name` input. The `module_directory` already encodes both
the namespace and the module name, so carrying both is redundant and
error-prone. Callers like `claude-code` no longer need to pass
`agent_name`.

Scripts this module materializes lose the `${agent_name}-utils-` prefix
because `module_directory` already namespaces them per-caller.

We will address multiple instances of coder-utils per caller in a future
iteration if needed.

## Versioning Note

Previous tags (`v1.0.0` through `v1.3.0`) have been deleted because no
published module ever consumed them — the module was effectively
unreleased. This PR ships the first real public version as **`v0.0.1`**,
treating it as a fresh start rather than a breaking bump from a version
that was never in production use.

## Changes

- Remove `agent_name` variable.
- Derive `caller_name = "${namespace}-${module_name}"` from
`module_directory`.
- Validate `module_directory` matches
`$HOME/.coder-modules/<namespace>/<module-name>`.
- Rename script files on disk from `${agent_name}-utils-<phase>.sh` to
plain `<phase>.sh`.
- Add a TS test for the `module_directory` validation.
- Ship as `v0.0.1` (first published version; all prior tags removed).

## Breaking Changes

| Before | After |
|---|---|
| `agent_name = "myagent"` | removed (derived from `module_directory`) |
| `module_directory = ".my-module"` | `module_directory =
"$HOME/.coder-modules/<ns>/<name>"` (validated) |
| Script files `${agent_name}-utils-install.sh` | `install.sh` |
| Script sync names `${agent_name}-install_script` |
`${namespace}-${module_name}-install_script` |

No callers were depending on the old format (prior tags were
unpublished).

## Validation

- `terraform fmt -recursive` clean
- `terraform validate` clean
- `terraform test` → 17/17 pass
- `bun test registry/coder/modules/coder-utils` → 5/5 pass
- `prettier --check` clean

## Consumer

#861 (`claude-code`) consumes this and is currently pinned
to the commit SHA until this merges and ships as `v0.0.1`.

> 🤖 This PR was created with the help of Coder Agents, and needs a human
review. 🧑‍💻
…ia templatefile

Render scripts/install.sh.tftpl once at plan time and pass the result
directly to coder-utils, replacing the runtime base64 encode/decode
wrapper and the redundant scripts/install.sh.

Sources coder-utils from a pinned commit on its refactor branch until
the `module_directory`-derived caller name lands in a tagged release.
…nd scope MCP to user

workdir is now optional. When set, the module still pre-creates the
directory and pre-accepts the Claude Code trust dialog for it. When
unset, the module installs the CLI and configures authentication only;
users accept trust dialogs interactively per project.

MCP servers are added at Claude Code's user scope via `claude mcp
add-json --scope user` so they are available across every project the
workspace owner opens, instead of being tied to a single project
directory. For project-local MCP servers, callers should commit a
`.mcp.json` to the project repository rather than passing it through
this module.

Drop primaryApiKey from the standalone-mode config writer. Claude Code
reads credentials from the ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN
env vars (which the module already exports via coder_env); writing the
key into ~/.claude.json had no effect on authentication.

Split the standalone-mode .claude.json writer into two steps: the
always-on auth/onboarding keys, and the optional `.projects[workdir]`
trust block that only runs when workdir is set.
@matifali matifali force-pushed the chore/claude-code-strip-boundary-agentapi-tasks branch from 3885188 to 46ce616 Compare April 24, 2026 12:23
Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Collaborator

@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.

Everything looks good to me. I think it honestly makes more sense for this module to stick with just the claude-code install and configuration since everyone seems to have their own methods of utilizing the module, and with /agents we would be moving away from tasks anyways to some extent.

@matifali matifali merged commit 124d05f into main Apr 24, 2026
4 checks passed
@matifali matifali deleted the chore/claude-code-strip-boundary-agentapi-tasks branch April 24, 2026 15:56
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.

3 participants