by rekursiv-ai
A coding-agent CLI and strongly-typed Python library -- self-mutating, hot-swapping, multi-provider, with async tool calls and bidirectional recursive spawn.
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
# Add to your Claude Code skills
git clone https://github.com/rekursiv-ai/sagentGuides for using ai agents skills like sagent.
See how sagent compares with popular alternatives.
A coding-agent TUI, CLI, and strongly-typed Python library -- self-mutating, hot-swapping, multi-provider, with async tool calls and bidirectional recursive spawn.
uvx sagent@latest
See Install for additional details.
Async runtime.
Hot self-mutation.
Every Provider, every auth.
llama.cpp server, all behind one binary.Unified cost tracking.
--max-budget-usd N caps the whole tree.Self-directing agent fleets.
AgentSend: "switch to luna, crank thinking, recompact and drop the file reads."Recursive agent messaging.
AgentSend to any peer, so coordination is a tree, not a star.Richer built-in tools.
PaperDetails walks citation graphs; PaperFetch fetches PDFs.WebSearch, WebFetch with markdown extraction, atomic read/write tracking on file tools.Unix-aligned and pipeable.
stdin, stdout, exit codes, and --output-format json are first-class.jq, drop into ipython (same prompt_toolkit underneath).Misaligned Bash tool calls are auto promoted to dedicated types.
ls files/ is auto-promoted to List(files/) tool call.Universal session format.
extra.All spawns' sessions (ancestors and/or descendants) can be focused.
Send a message to parent to autocreate an autopiloting agent.
Apache 2 license.
One runtime, every surface.
Agent class powers the CLI, your application code, and recursive sub-agents.Typed Python objects.
Agent, Tool, Model, Provider, and the session records are protocols and dataclasses you import, compose, and unit-test.basedpyright, pyrefly, and ty.Example:
from sagent.agent.agent import Agent
from sagent.providers.catalog import ModelCatalog
from sagent.tools.glob_tool import Glob
from sagent.tools.grep import Grep
from sagent.tools.read import Read
async with ModelCatalog() as catalog:
async with Agent(
model=catalog["google"]["gemini-pro-3.1"],
system_prompt="You are a scientist.",
tools=[Read(), Glob(), Grep()],
) as agent:
print(await agent.send("analyze the CSV in ./data/"))
uv tool install sagent && sagent
# Later: uv tool upgrade sagent
If you're missing uvx/uv,
brew install uv
sudo apt install -y curl
curl -LsSf https://astral.sh/uv/install.sh | sh
Optionally, for faster glob and grep,
brew install fd ripgrep
sudo apt install -y fd-find ripgrep
To add sagent to your own project as a library,
uv add sagent
Or run from a source checkout,
git clone --depth 1 https://github.com/rekursiv-ai/sagent.git
cd sagent
uv run sagent --help
Sagent supports all subscriptions and API KEYs.
| Provider | Env variable / Command |
|---|---|
Anthropic |
ANTHROPIC_API_KEY, or workload identity |
AnthropicCLI |
sagent login --provider acli |
OpenAI |
OPENAI_API_KEY, or workload identity |
Google |
GOOGLE_API_KEY |
GoogleCLI |
sagent login --provider gcli |
Moonshot |
MOONSHOT_API_KEY |
DashScope |
DASHSCOPE_API_KEY |
MiniMax |
MINIMAX_API_KEY |
SelfHosted |
|
LlamaCpp |
LLAMA_CPP_MODEL + LLAMA_CPP_SERVER |
See Providers for the provider matrix, inference rules, and OpenAI-compatible provider setup.
Install the local runtime extra from a checkout:
uv sync --extra selfhosted
Or add it to your project from PyPI:
uv add "sagent[selfhosted]"
Then pass a HuggingFace repo ID or local snapshot path:
sagent --provider SelfHosted --model Qwen/Qwen3.6-27B+bfloat16+cuda
sagent --provider SelfHosted --model Qwen/Qwen3.6-27B+cuda+bfloat16
For a small smoke test:
sagent --provider SelfHosted --model Qwen/Qwen3-0.6B+float16+cuda \
--effort none --max-tool-call-rounds 1
SelfHosted options use + suffixes after the model name. Device, dtype, and compile can appear in any order, but each category can appear once.
The LlamaCpp provider is a second local option: it manages a
llama-server subprocess and talks to it over its OpenAI-compatible
endpoint. Point LLAMA_CPP_SERVER at a built llama-server binary and
LLAMA_CPP_MODEL at a .gguf file, then run
sagent --provider LlamaCpp --model qwen3.6-27b-12gb.
See Self-hosted Models for options, local snapshot paths, and runtime requirements.
Sagent calls the tools of MCP servers. Manage them with sagent mcp, which
takes the arguments claude mcp does; each command has --help, and each is
also /mcp.COMMAND at the prompt:
sagent mcp add git -- uvx mcp-server-git # a local command
sagent mcp add -t http linear https://mcp.linear.app/mcp # a remote URL
sagent mcp add -t http github https://api.githubcopilot.com/mcp/ \
-H 'Authorization: Bearer ${GITHUB_TOKEN}' # read at connect
sagent mcp login linear # OAuth sign-in to a remote server; --headless over ssh
sagent mcp list # each server, and whether it connects
sagent mcp get linear # one server
sagent mcp logout linear # forget its sign-in
sagent mcp remove linear # and the server
add writes this project's servers; -s user writes every project's. A
session reads the servers it starts with; one already open keeps its own.
Each tool becomes mcp__<server>__<tool>. An on_demand server is one tool,
mcp__<server>, that lists, describes, and runs its tools, so a large server
costs no tokens until used. Its options beyond add's flags go in with
add-json, as the entry another tool's mcpServers JSON holds:
sagent mcp add-json linear '{"url": "https://mcp.linear.app/mcp", "loading": "on_demand"}'
A remote server that signs users in with OAuth, as Linear and Notion do, needs
one sign-in before it connects. One that takes a token instead, as GitHub's
does, reads it from its header. Config copied from Claude Code, Cursor, or Pi
works as it is: pass the file with --mcp-config PATH.
In code, open the servers and pass their tools:
from pathlib import Path
from sagent.agent.agent import Agent
from sagent.providers.catalog import ModelCatalog
from sagent.tools.mcp import McpSession, servers
from sagent.tools.read import Read
async with ModelCatalog() as catalog, McpSession(servers(Path.cwd())) as mcp:
model = catalog["google"]["gemini-pro-3.1"]
async with Agent(model=model, tools=[Read(), *mcp.tools()]) as agent:
...
See the sagent.tools.mcp docstring for every field.
Sagent is an agent runtime, not a s
sagent is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by rekursiv-ai. A coding-agent CLI and strongly-typed Python library -- self-mutating, hot-swapping, multi-provider, with async tool calls and bidirectional recursive spawn. It has 129 GitHub stars.
sagent's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/rekursiv-ai/sagent" and add it to your Claude Code skills directory (see the Installation section above).
sagent is primarily written in Python. It is open-source under rekursiv-ai on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh sagent against similar tools.
No comments yet. Be the first to share your thoughts!