guess

guess

Hi! I’ve been building ClaudeCode, an SDK that lets you embed Claude as an agent in your Elixir apps - not just a chatbot, but an AI that can take actions.

The Problem

Most AI integrations are text-in/text-out. Building anything useful means parsing responses, manually wiring tool calls, handling conversation state, and mocking everything by hand for tests.

The Solution: Hermes + ClaudeCode

ClaudeCode wraps the claude cli, giving Claude full agentic capabilities. Combined with hermes_mcp v0.14.1 — Documentation , Claude can call your Elixir functions directly:

  # Define a tool
  defmodule MyApp.Tools.RefundOrder do
    use Hermes.Server.Component, type: :tool

    schema do
      field :order_id, :string, required: true
    end

    def execute(%{order_id: id}, frame) do
      {:ok, refund} = MyApp.Orders.refund(id)
      {:reply, Response.json(Response.tool(), refund), frame}
    end
  end

  # Create an MCP server
  defmodule MyApp.SupportTools do
    use Hermes.Server, name: "myapp", version: "1.0.0", capabilities: [:tools]

    component MyApp.Tools.RefundOrder
    component MyApp.Tools.OrderLookup
  end

  # Start a session
  {:ok, session} = ClaudeCode.start_link(mcp_servers: %{"myapp" => MyApp.SupportTools})

  # Ask it to do something
  session
  |> ClaudeCode.stream("Customer jane@example.com wants a refund for her last order")
  |> ClaudeCode.Stream.tap(&IO.inspect/1)
  |> ClaudeCode.Stream.final_text()

Claude will call OrderLookup, find Jane’s order, call RefundOrder, and explain what happened. No decision trees. No hardcoded workflows.

Testing Without API Calls

  test "support agent processes refunds" do
    ClaudeCode.Test.stub(ClaudeCode, fn _query, _opts ->
      [
        ClaudeCode.Test.tool_use("OrderLookup", %{email: "jane@example.com"}),
        ClaudeCode.Test.tool_result(%{id: "ORD-123", total: 99.99}]),
        ClaudeCode.Test.text("Processing refund for order ORD-123..."),
        ClaudeCode.Test.tool_use("RefundOrder", %{order_id: "ORD-123", reason: "request"}),
        ClaudeCode.Test.tool_result(%{status: "processed"}),
        ClaudeCode.Test.text("Done! Refunded $99.99.")
      ]
    end)

    {:ok, session} = ClaudeCode.start_link()
    result = session |> ClaudeCode.stream("Refund Jane") |> ClaudeCode.Stream.final_text()

    assert result =~ "Refunded $99.99"
  end

Millisecond tests. No API calls. Full async: true support.

Also Included

  • OTP Supervision - Sessions restart on failure
  • Native Streaming - Elixir Streams, LiveView-ready
  • Multi-turn Memory - Context retained across queries
  • Concurrent Agents - Run multiple sessions with the actor model

Links

https://github.com/guess/claude_code

Early days - I’d love to hear what agents you’d build, or what’s missing that would make this useful for your projects.

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement