Can I run Claude/Codex coding agents in kagent as a declarative runtime?
In kagent (kagent-dev/kagent) I want to run Claude-based coding agents with the same declarative config as Python/Go ADK agents. The proposal to add
runtime: claudetospec.declarativewas closed as NOT_PLANNED, and one reporter's BYO Claude agent keeps crashing kagent agents with OOM. Are there any workarounds to run Claude/Codex agents in kagent today?Originally asked on GitHub: https://github.com/kagent-dev/kagent/issues/1676
4 answers
Status: the feature proposal was closed as NOT_PLANNED; no maintainer explanation appears in the thread. The discussion did not converge on a supported implementation for a
clauderuntime, so BYO remains the only path.Two community workarounds were described:
-
BYO agent + per-conversation sandbox Pod (partial). One contributor built a BYO image using kagent's ADK plus
sig-kubernetes/sandboxtemplates. Each new conversation gets a separate Pod named after the kagent conversation ID, and the BYO agent sets a shutdown time ofnow + 30 min. This worked for one-shot Claude Code runs, but kagent does not pass the original conversation ID over A2A, so you cannot keep chatting with the same Pod. Lifecycle is managed by the BYO agent. -
Treat the coding agent as a one-shot Tool image (recommended). After trying to wrap a CLI coding agent into BYO and bridge it with A2A, another contributor concluded that this stacking of glue layers was a bad idea. Their suggestion: bake the coding agent into an image with Git CLI and the compile/test toolchain, expose it as a Tool that the orchestrator invokes at runtime, and keep exploratory code changes on a local agent.
One commenter also reported that a BYO Claude Code agent crashed kagent agents with OOM; the thread does not explain the cause or a fix. A contributor pointed to the upcoming AgentHarness work as a possible future place for Claude and other coding-agent types, but that is not a committed maintainer plan in this thread.
Did this work for you?-
What @Prefix tried on GitHub (Partly worked)
BYO agent using kagent ADK and sig-kubernetes/sandbox; creates a Pod per conversation named after the kagent conversation ID, with shutdown set to now+30min. Works for one-shot Claude Code tasks, but A2A doesn't pass the original conversation ID so chat continuity with the same Pod is lost.
Source: https://github.com/kagent-dev/kagent/issues/1676#issuecomment-4522335409 (opens external site)
Did this work for you?What @0xLeo258 tried on GitHub (Didn't work)
Wrapping a CLI coding agent into BYO and bridging it with A2A; the contributor found this stacks complexity and doesn't solve the black-box one-shot nature of coding agents. Recommended exposing the agent as a Tool image instead.
Source: https://github.com/kagent-dev/kagent/issues/1676#issuecomment-4627680896 (opens external site)
Did this work for you?What @Prefix tried on GitHub (Didn't work)
Running a BYO Claude code agent as part of a chat-agent-to-fixing-agent workflow; the agent kept crashing kagent agents with OOM for no apparent reason.
Source: https://github.com/kagent-dev/kagent/issues/1676#issuecomment-4502945168 (opens external site)
Did this work for you?
Related questions
- kagent A2A agent invocation fails with 301 redirect on /api/a2a/kagent/<agent> path without trailing slash
- kagent 0.5.0 breaks Vertex AI project/location and Grafana MCP SSE URL in helm chart
- kagent + GPT-5: tools run but no answer, CPU busy; CancelledError: Cancelled by cancel scope — fixed?
- kagent with AWS Bedrock models: ModelConfig returns 404 model_not_found; is Bedrock supported?
- Does kagent have RBAC for OIDC users? How to restrict agent access?