Skip to content

feat: add the Claude Agent SDK coding agent - #3

Merged
zimeg merged 11 commits into
mainfrom
clack/coding-agent-claude-agent-sdk
Oct 20, 2026
Merged

zimeg merged 11 commits into
mainfrom
clack/coding-agent-claude-agent-sdk

Conversation

@zimeg

@zimeg zimeg commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request adds a Claude Agent SDK implementation of the coding agent in claude-agent-sdk/, ported from openai-agents-sdk/ with the Python Claude design from bolt-python-coding-agent#16.

  • Matches the OpenAI Agents SDK version's experience: the same 16 tools with the same names, arguments, and descriptions, the same prompts, and the same approvals, stop, and archive behavior. listeners/, the framework-free agent/ files, and the listener, approvals, and workspace tests are copied unchanged, so only agent/agent.js, agent/guardrails.js, and agent/tools/ use the SDK.
  • Tools are closure factories, one per file like the starter agent's, built for each run and served by an in-process MCP server. Claude Code's built-in tools are off, and so are the machine's settings, CLAUDE.md files, and MCP servers. verbatimPrompts keeps an @path inside a Slack message from reading a local file. Uses claude-sonnet-5-5 for coding and claude-haiku-4-5 for routing.
  • Command approvals use the PreToolUse hook's defer decision. The run ends with the command waiting, and a click resumes the Claude Code session. The hook then allows or denies that same call.
  • A dropped approval, from a newer message or the stop button, is answered as not run at the start of the next turn. canUseTool denies it with interrupt, so closing it costs no model call.
  • A PostToolUse hook ends the run once a channel is created or archived. The stop button denies every tool call, a throwing tool reaches the model as an error result, and running out of turns ends with a message, keeping the session.
  • Names the tool server with --mcp-config as well as the SDK option. The TypeScript SDK registers it too late for the CLI to resume a deferred call, which then fails as "tool not available". The Python SDK already passes the flag itself.
  • Adds claude-agent-sdk/ to the lint and tests matrices, dependabot, the root README, and AGENTS.md.

tests/agent/runs.test.js drives the real SDK and bundled CLI against tests/fake-model.js, a local server that answers the Messages API from a script. The CLI's config goes to a temp directory, and the suite takes about 30s.

Testing

  • Copy claude-agent-sdk/.env.sample to .env, set ANTHROPIC_API_KEY, and start the app with slack run from claude-agent-sdk/.
  • Mention the agent in a thread with a question and confirm it answers in place, then with a task on a throwaway repo and confirm it links a new code channel.
  • In the code channel, approve a test or build command and confirm it runs, then deny one and confirm the agent carries on without running it.
  • Send a new message while an approval is pending and confirm the buttons show it was skipped and the agent answers the new message.
  • Press stop mid-turn and confirm the agent says it stopped and posts nothing more from that turn.
  • Say the work is done and confirm the summary is shared back to your original message and the channel is archived.

🤖 Generated with Claude Code

zimeg and others added 3 commits October 15, 2026 22:42
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…framework-free

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added the enhancement M-T: A feature request for new functionality label Oct 16, 2026
@zimeg zimeg self-assigned this Oct 16, 2026
zimeg and others added 6 commits October 19, 2026 21:09
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…-agent-claude-agent-sdk

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…CRET

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…th setup

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…-agent-claude-agent-sdk

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Base automatically changed from clack/coding-agent-openai-agents-sdk to main October 20, 2026 05:05
main's squash of #2 matches 1b9dd34, which this branch already merged.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added the semver:minor Use on pull requests to describe the release version increment label Oct 20, 2026

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🗣️ Wordings on the change before this might land?

Comment thread claude-agent-sdk/.slack/hooks.json
Comment thread claude-agent-sdk/agent/runtime.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👾 note: This handles SDK specific implementations alongside the guardrails.js file. Others are similar across providers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🧪 note: Landing this now for coverage but will follow up to align between samples.

Comment thread claude-agent-sdk/app-oauth.js
Comment thread claude-agent-sdk/package.json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📚 note: Leaving this without change for now but let's follow up to mirror pattern across other projects.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

🏁 Let's get this merged now and adjust ongoing before making this so public.

@zimeg
zimeg merged commit e145b21 into main Oct 20, 2026
5 checks passed
@zimeg
zimeg deleted the clack/coding-agent-claude-agent-sdk branch October 20, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant