Open-source, Rust-native autonomous coding agent for DeepSeek V4 Pro and V4.1 Flash.
One agent or a four-specialist swarm, each in its own git worktree, under your supervision — on your machine, with your own key.
Docs · Install · Quickstart · Features · Safety · Architecture · Contributing · Discussions
A real raptor swarm run on DeepSeek V4.1 Flash: four specialists in parallel git worktrees, 5 min 19 s of work shown 8× faster. When agents tried to write and delete files outside their workspace, the tool policy asked first and both were declined; it is a guardrail, not a sandbox.
Agentic REPLraptor plans, edits and runs commands with your consent |
Four-agent swarm frontend · backend · test · security, in parallel |
Worktree isolation every agent works in its own git worktree |
| Built for DeepSeek V4 V4 Pro or V4.1 Flash, thinking mode, 1M-token context, prefix caching |
A real coding toolset exact-match edits, ranged reads, regex search, globs, plans, verified test runs |
Headless runsraptor run "task" for scripts and CI |
| Supervised review review → diff → test per worktree; raptor merge --execute for task worktrees, typed confirmation |
Deny-by-default tool policy catastrophic commands hard-denied, network tools need confirmation |
Local-first your machine, your DeepSeek key, no telemetry |
┌─ frontend-agent ──▶ .raptor/worktrees/<task>/frontend-agent ─┐
raptor swarm run ├─ backend-agent ──▶ .raptor/worktrees/<task>/backend-agent ─┤ raptor review <task> [role]
"Build a SaaS ──▶ ├─ test-agent ──▶ .raptor/worktrees/<task>/test-agent ─┼─▶ raptor diff <task> [role] ──▶ you commit and merge what you accept
landing page" └─ security-agent ──▶ .raptor/worktrees/<task>/security-agent ─┘ raptor test <task> from each role worktree, with git
live dashboard · tool policy · consent prompts nothing lands without you
Swarm output stays uncommitted inside the role worktrees until you have reviewed,
diffed and tested it; you then commit and merge what you accept from each
worktree with git. The single-task path (raptor task) adds a supervised
raptor merge <task-id> --execute that only runs after a typed confirmation.
raptoropens the interactive REPL. After the per-session file-system consent prompt, each request typed in a git repository launches the four-specialist swarm (four parallel DeepSeek sessions, each in its own worktree, so expect roughly four times the tokens of a single agent); outside a git repository, or when the swarm cannot start, a single agent works in the current directory. Without consent the REPL is chat-only. Every tool call goes through a deny-by-default policy with developer confirmations.raptor run "task"runs the same agent headless, for scripts and CI: progress on stderr, the final answer on stdout, a non-zero exit status on failure. Actions the REPL would ask about are declined unless you pass--yes.raptor swarm run "mission"(or/swarminside the REPL) launches a live four-specialist swarm — frontend, backend, test, and security agents — each working in its own isolated git worktree behind a real-time dashboard.raptor swarm "task"andraptor swarm implement <task-id> <role>produce supervised role plans (RAPTOR_PLAN.md) and implementation proposals (RAPTOR_IMPLEMENTATION_PROPOSAL.md) without touching your tree.raptor review,raptor diff, andraptor testinspect and test worktree results;raptor mergemerges single-task worktrees after a typed confirmation (swarm role branches are merged with plain git).raptor chatfor plain model chat,raptor tuifor a read-only dashboard,raptor doctorfor environment diagnostics.
| Command | What it does |
|---|---|
/help, ? |
Show the commands |
/swarm <mission> |
Launch the live four-specialist swarm |
/model |
Pick deepseek-v4-pro or deepseek-flash (saved as your default) |
/effort |
Cycle the thinking effort: low → high → max |
/thinking |
Turn DeepSeek's thinking mode off or on |
/stream |
Turn streamed output off or on |
/json |
Ask for JSON-only answers |
/balance |
Show your DeepSeek account balance |
/api |
Replace the saved API key (never displayed) |
/clear |
Start a fresh conversation |
/exit, /quit |
Leave |
| Tool | What it does |
|---|---|
read_file |
Reads a file; with offset/limit returns numbered line ranges of large files |
edit_file |
Replaces an exact, unique string (or every occurrence) — no whole-file rewrites |
write_file |
Creates a file or replaces its whole content |
search_files |
Regex search across the project, honouring .gitignore, skipping binaries |
find_files |
Finds files by glob (*.rs, src/**/*.ts) |
update_plan |
Keeps a checklist the REPL and the swarm dashboard show as progress |
list_directory, create_directory, change_directory |
Navigation |
run_command |
Runs build, test, lint and git commands; failures end with [exit code N], long output keeps its head and tail, timeout_secs up to 15 minutes |
Every call goes through the tool policy first. The agent reads RAPTOR.md,
AGENTS.md or CLAUDE.md from your repository as project instructions, and is
prompted to verify its work: build, run the tests, read the exit code, fix and
re-run.
| Model id | Model |
|---|---|
deepseek-v4-pro (default) |
DeepSeek V4 Pro |
deepseek-flash |
DeepSeek V4.1 Flash — faster and cheaper |
Pick one with /model in the REPL (remembered for later sessions), the
RAPTOR_MODEL environment variable, or raptor run --model <id>. /effort
cycles the thinking effort through low, high and max. Retired names such as
deepseek-v4-flash are mapped to their current equivalent. Requests use
DeepSeek's thinking mode with tool calls, a 128K output budget, automatic
retries with backoff, and a context guard that compacts the history at 75% of
the 1M-token window while keeping the original task. Details:
docs/deepseek-api.md.
DeepSeek is the implemented execution provider today. The Provider trait and
provider catalog are the extension point for others; see
ROADMAP.md.
Prerequisites: Git, and Rust 1.88 or newer with Cargo.
cargo install --locked --git https://github.com/RaptorLabsHQ/raptorcode raptor-cliOr from a clone (the repository pins Rust 1.95.0 through
rust-toolchain.toml, which rustup picks up automatically):
git clone https://github.com/RaptorLabsHQ/raptorcode.git
cd raptorcode
cargo install --path crates/raptor-cli --force --lockedEach GitHub release
carries a Linux .deb, a macOS universal archive and a Windows zip, each with a
.sha256 file and a build-provenance attestation. On Debian or Ubuntu:
sudo apt install ./raptor-code_1.2.0_amd64.deb
raptor --helpCheck a download before installing it:
sha256sum -c raptor-code_1.2.0_amd64.deb.sha256
gh attestation verify raptor-code_1.2.0_amd64.deb --repo RaptorLabsHQ/raptorcodeThe macOS and Windows builds are not code-signed yet. The Linux package is also available from https://raptorcode.dev.
The package is named raptor-cli; the installed commands are raptor and
raptorcode. Build the Debian package locally with ./scripts/package-deb.sh
(written to dist/).
Get an API key from https://platform.deepseek.com/api_keys. RaptorCode reads
DEEPSEEK_API_KEY from the environment, or asks for the key once on first run
and stores it in ~/.raptor/.credentials (owner-only permissions); every
command finds it the same way. A new key is checked with DeepSeek's free
balance endpoint, so no tokens are spent. The key is never printed, logged, or
committed, and /api inside the REPL manages it without echoing it.
raptor # startup screen, then the interactive REPL
raptor doctor # check the local environment
raptor chat "Explain this project"
raptor run "Fix the failing test in src/parser.rs" # headless, for scripts and CI
raptor run --yes --model deepseek-flash "Add a --json flag" # approve gray-zone actions, use Flash
raptor tui # read-only dashboardA live swarm leaves its work uncommitted in one worktree per role. Review it, then keep what you want with git:
raptor swarm run "Build a SaaS landing page with auth"
raptor review <task-id> [role] # inspect what each agent produced
raptor diff <task-id> [role]
raptor test <task-id>
git -C .raptor/worktrees/<task-id>/<role> add -A
git -C .raptor/worktrees/<task-id>/<role> commit -m "Add the landing page"
git merge raptor/<task-id>/<role> # from your main checkoutA single supervised task has its own merge command:
raptor task "Add router tests" # creates .raptor/worktrees/<task-id>
# edit and commit inside that worktree, then:
raptor review <task-id>
raptor test <task-id>
raptor merge <task-id> # dry run
raptor merge <task-id> --execute # asks for a typed confirmationFrom a source checkout, the same commands run through Cargo:
cargo run -p raptor-cli --bin raptor -- --help
cargo run -p raptor-cli --bin raptor -- doctorraptor
raptor --version
raptor init
raptor tui
raptor provider list
raptor agent list
raptor agent show <id>
raptor agent create --role <role> [--task <task-id>] [--provider <provider-id>] [--model <model-id>]
raptor agent policy
raptor chat "message"
raptor run [--yes] [--model <id>] [--effort low|high|max] "task"
raptor task "task description"
raptor task list
raptor task show <id>
raptor task abandon <id>
raptor task cleanup <id>
raptor swarm "task description"
raptor swarm implement <task-id> <role>
raptor swarm run "mission description"
raptor review <task-id> [role]
raptor diff <task-id> [role]
raptor test <task-id> [-- <command>]
raptor merge <task-id>
raptor merge <task-id> --execute
raptor doctor
RaptorCode treats model output and user-provided identifiers as untrusted.
- Agent work happens in isolated git worktrees under
.raptor/worktrees/; task, swarm, and agent metadata live under.raptor/tasks/,.raptor/swarms/, and.raptor/agents/. Creating a task or swarm lists/.raptor/in the repository's.git/info/exclude(local to your clone; no tracked file changes), so it stays out ofgit statusandgit add -A. - Task ids, role names, branch names, and paths are validated; path traversal is rejected and writes stay inside the worktree boundary (symlink-safe).
- Git and test commands use structured process arguments, never shell interpolation.
- Tool execution runs through a deny-by-default policy: catastrophic commands
are hard-denied; privileged commands, every
git push, known network tools (curl,wget,ssh,scp,rsync,nc, …) and writes outside the worktree ask for confirmation; recognised wrappers (bash -c,env,timeout,nohup,sudo, …) are unwrapped before the check. The policy is lexical: command substitution,xargsand interpreter one-liners are not inspected. It is a backstop, not a sandbox (seedocs/security.md). RAPTOR.md,AGENTS.mdorCLAUDE.mdfrom the repository is added to the agent's system prompt. In a repository you do not trust, read those files before running an agent there.- The planning (
raptor swarm) and proposal (raptor swarm implement) paths never execute model output or apply patches. raptor runapplies the same policy without a human present: hard denials stay denied, and actions that would need a confirmation are declined unless--yesapproves them.raptor chatsends only your message; it does not send repository contents,.envfiles, secrets, task metadata, or worktree files.- The dashboard is read-only. Merging requires
--executeand an exact typed confirmation.
Developers remain responsible for reviewing plans, proposals, diffs, tests, and
merges. The full design is in docs/security.md.
RaptorCode has no telemetry and no RaptorCode server: it talks only to
api.deepseek.com. Your prompts, plus whatever the agents read while they work
(file contents, command output), are sent to DeepSeek under your own API key,
subject to DeepSeek's terms. The key is stored only in ~/.raptor/.credentials
(or read from DEEPSEEK_API_KEY), and the model choice in ~/.raptor/model.
- Providers other than DeepSeek, MCP, a desktop UI, cloud sync, team accounts, or an enterprise policy engine.
- Resuming a swarm run after its agents reach the step limit; a stopped run's work stays in the role worktrees for review.
- OS-level sandboxing of the local agent (namespaces, seccomp, landlock); the userspace tool policy is a backstop, not a sandbox.
Persisted agent sessions and permission policy modeling exist as early local metadata foundations and are not yet an active policy enforcement system.
.
|-- crates/
| |-- raptor-agent/ frozen agent session model (see ROADMAP.md)
| |-- raptor-cli/ the `raptor` binary: REPL, headless runs, swarm orchestration, agent tools and tool policy
| |-- raptor-core/ shared types, validators, errors
| |-- raptor-git/ argv-based git operations and worktrees
| |-- raptor-providers/ provider trait, catalog, DeepSeek client
| |-- raptor-sandbox/ reserved (empty)
| |-- raptor-store/ atomic local state under .raptor/
| |-- raptor-tools/ test-command detection for `raptor test`, tool checks for `raptor doctor`
| `-- raptor-tui/ ratatui dashboard and startup screen
|-- docs/
|-- packaging/ AppStream metainfo for the .deb
|-- scripts/ release.sh, package-deb.sh
|-- templates/ swarm role templates
|-- CHANGELOG.md
|-- CODE_OF_CONDUCT.md
|-- CONTRIBUTING.md
|-- SUPPORT.md
|-- LICENSE-APACHE
|-- LICENSE-MIT
|-- ROADMAP.md
|-- SECURITY.md
|-- THIRD-PARTY-NOTICES.md
`-- Cargo.toml
The user documentation, with guides, the CLI reference and troubleshooting, is at raptorcode.dev/docs. The design notes in this repository:
- Architecture
- Security Design
- Task Workflow
- Development
- DeepSeek API Notes
- Release Process
- Roadmap
- Changelog
Contributions are welcome — see CONTRIBUTING.md for the
development setup, the CI checks, and the commit conventions that drive the
automated releases, and CODE_OF_CONDUCT.md for how we
work together. Report vulnerabilities privately as described in
SECURITY.md.
RaptorCode is dual-licensed under the MIT license and the Apache License 2.0, at your option. Copyright © 2026 Bob Vasic.
Releases v0.3.0 through v0.6.5 were published under a proprietary license;
from this repository onward all code is MIT OR Apache-2.0. Third-party
components keep their own permissive licenses; see
THIRD-PARTY-NOTICES.md.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in RaptorCode by you shall be dual licensed as above, without any additional terms or conditions.