SkillAgentSearch skills...

sofos-code

Terminal-based AI coding assistant with Claude/OpenAI support, secure local tools, web search, and MCP integrations.

Install / Use

claude mcp add alexylon -- npx -y github:alexylon/sofos-code

If the server publishes to npm under a different name, use that package instead — check the repo README.

About this skill
🔌

MCP Server

Model Context Protocol server

Quality Score

81/100

Supported Platforms

Claude Code
Claude Desktop

Sofos Code

CI   Crates.io

Sofos Code is a terminal-based AI coding assistant for software projects. It connects Claude or OpenAI models to local tools for reading code, editing files, running approved commands, searching the web, viewing images, and using external tools through the Model Context Protocol (MCP).

Sofos is written in Rust and runs in your terminal. Its access model is explicit: project files are available by default, while external paths and higher-risk actions require approval or configuration.

Sofos runs on macOS, Linux, and Windows. On macOS and Linux, the default shell mode uses an operating-system sandbox when the required platform support is available. On Windows, command confinement is disabled in this release. The bash executor still runs commands through the sh.exe provided by Git for Windows, which Sofos can find at the standard install path even when an integrated terminal does not expose Git on PATH.

<div align="center"><img src="/assets/screenshot.png" style="width: 800px;" alt="Sofos Code terminal screenshot"></div>

Table of contents


What Sofos does

Sofos provides an AI assistant with controlled access to your project from inside the terminal. It can:

  • inspect files and directories;
  • search code with ripgrep;
  • edit files with exact replacements or Morph Apply;
  • create, move, copy, and delete files with permission checks;
  • run approved build, test, and inspection commands;
  • fetch documentation and use provider-native web search;
  • open local image files or remote image URLs;
  • accept image pastes from the clipboard;
  • keep a visible task plan during multi-step work;
  • save and resume conversations;
  • connect to external tools through MCP servers.

The assistant acts through visible tool calls. Dangerous commands are blocked, deletion prompts for confirmation, and access outside the workspace is controlled by separate permission scopes.


Key features

  • Terminal interface — Inline viewport at the bottom of your terminal while normal scrollback remains available.
  • Claude and OpenAI support — Shared provider layer with provider-specific streaming, reasoning, web search, and cache handling.
  • Streaming Markdown — Responses render as they arrive, including code blocks, headings, lists, tables, blockquotes, and links.
  • Iterative tool use — The model can use tools across multiple steps, with a hard limit to prevent endless loops.
  • Safe file editing — Exact edits, chunked writes, visual diffs, atomic writes, and optional Morph Apply.
  • Explicit permissions — Separate Read, Write, and Bash grants for paths outside the workspace.
  • Bash safety checks — Command tiers and structural checks for parent traversal, hidden subcommands, ANSI-C quoting, unconfined redirection, and dangerous Git operations.
  • Access presets — Five permission modes: read-only, sandboxed-ask, sandboxed-retry, sandboxed-strict, and unsandboxed.
  • Image vision — Local image files, remote image URLs, and pasted clipboard images.
  • MCP integration — Tools from stdio or streamable HTTP MCP servers.
  • Session persistence — Saved conversations with compatible model, permission preset, and cost counters restored.
  • Cost visibility — Token totals, cache usage, and cost estimates priced per response at the rates of the model that answered it.
  • Context compaction — Local and provider-supported compaction for older conversation context.

Installation

Requirements

Set at least one provider API key:

  • ANTHROPIC_API_KEY for Claude models; or
  • OPENAI_API_KEY for OpenAI models.

Optional tools and keys:

  • ripgrep, recommended for fast code search through search_code;
  • MORPH_API_KEY, required for the morph_edit_file tool.

On Linux, the sandboxed-* presets need Bubblewrap (bwrap) for operating-system command confinement. Without it, Sofos starts unsandboxed and the sandboxed presets are disabled. Install it with your distribution's package manager:

# Debian / Ubuntu
sudo apt update
sudo apt install bubblewrap

# Fedora / RHEL
sudo dnf install bubblewrap

# Arch
sudo pacman -S bubblewrap

Bubblewrap also relies on kernel support for user namespaces, which is enabled by default on most modern distributions.

Prebuilt binary

Download the latest binary from GitHub Releases.

# macOS / Linux
tar xzf sofos-*.tar.gz
sudo mv sofos /usr/local/bin/

# Windows
# Extract the .zip archive and add the extracted folder to PATH.

On macOS, Gatekeeper may block the first run. Open System Settings → Privacy & Security, then choose Allow Anyway for the Sofos binary.

Install with Cargo

cargo install sofos

Install from source

git clone https://github.com/alexylon/sofos-code.git
cd sofos-code
cargo install --path .

Keep .sofos/ out of version control. It stores sessions, local permissions, and personal settings. AGENTS.md is project-level context and is intended to be version controlled.


Quick start

Set a provider key:

export ANTHROPIC_API_KEY='your-anthropic-key'
# or
export OPENAI_API_KEY='your-openai-key'

Optionally enable Morph Apply edits:

export MORPH_API_KEY='your-morph-key'

Start the interactive assistant:

sofos

Use a different model:

sofos --model gpt-5.6-sol
sofos --model claude-opus-5 -e high

Run one prompt and exit:

sofos -p "Review the error handling in src/error.rs"

Start with inspection tools only:

sofos --readonly

Resume a saved session:

sofos --resume

Usage

Interactive commands

| Command | Description | |---|---| | /resume | Open the session picker and resume a saved conversation. | | /clear | Clear the current conversation history and start a new session id. | | /compact | Compact older context to reduce token usage. | | /effort | Open the reasoning-effort picker. The picker lists only the levels supported by the active model. Use Up / Down to select, Enter to switch, and Esc to cancel. | | /effort low\|medium\|high\|xhigh\|max | Switch directly to a reasoning level. Unsupported levels print a clear error. | | /mode | Open the reasoning-mode picker. standard and pro; pro is disabled outside the GPT-5.6 family. Use Up / Down to select, Enter to switch, and Esc to cancel. | | /mode standard\|pro | Switch reasoning mode. pro is accepted only on the GPT-5.6 models; other models print a clear error. | | /model | Open the model picker. Use Up / Down to select, Enter to switch, and Esc to cancel. Models this session cannot switch to are greyed out and skipped: the other provider's models, because the API client is fixed at startup, and any model that rejects the active reasoning effort, reasoning mode, or output-token ceiling. Type /model <name> to see the reason a particular model is unavailable. | | /model <name> | Switch directly to a model on the active provider. To switch provider, restart Sofos with --model <name>. | | /permissions | Open the permission preset picker. The presets are read-only, sandboxed-ask, sandboxed-retry, sandboxed-strict, and unsandboxed. Use Up / Down to select, Enter to switch, and Esc to cancel. Where sandboxing is unavailable, such as Windows, the sandboxed-* presets are shown but disabled. | | /permissions <preset> | Switch directly to a permission preset. | | /exit, /quit, /q, Ctrl+D | Save the session and exit with a cost summary. | | Esc or Ctrl+C while busy | Interrupt the current AI turn. |

Input behaviour

  • Enter submits the current message.
  • Shift+Enter inserts a newline when the terminal supports it.
  • Alt+Enter and Ctrl+Enter are newline fallbacks.
  • Ctrl+U deletes from the cursor to the start of the line.
  • Ctrl+W deletes the previous word.
  • Ctrl+K deletes from the cursor to the end of the line.
  • These editing shortcuts match common readline behaviour used by bash, zsh, and fish.
  • Alt+Up and Alt+Down move through previously submitted prompts. Sofos preserves the current draft and restores it when you move past the newest entry.
  • Typing / at the start of the input opens command suggestions. Use Up / Down to select, Enter to run the selected command, Tab to insert it into the input, and Esc or Ctrl+C to dismiss the list.
  • You can keep typing while the model is working. New messages are queued and processed in order.
  • If the model is inside a tool loop, a queued message is delivered at the next tool-result boundary. This lets you steer the current turn without interrupting it.
  • The status line shows the model, permission mode, reasoning setting, running token totals, and cache token counters when available.

One-shot prompts

One-shot mode sends a prompt, runs the assistant turn, saves the session, prints a summary, and exits.

sofos -p "Find the likely cause of the failing tests"
sofos -p "Create a high-level summary of this crate" --readonly

Redirecting the output to a file or another program produces plain text: colour and other terminal escape sequences are written only when the output is going to a terminal.

Image vision

Ask about an image by mentioning the file path or URL in your message. Sofos will call view_image to open it.

What is wrong in ./screenshots/error.png?
Describe ./docs/architecture-diagram.webp.
Review https://example.com/chart.png
What do you see in the images in ./assets/?

For a folder, Sofos lists the directory first, then opens each image one by one.

Clipboard paste:

Ctrl+V    # Inserts a numbered marker such as ①.

Supported formats are JPEG, PNG, GIF, and WebP. Local images are limited to 20 MB. Images larger than 2048 pixels on the long side are scaled down proportionally before being sent to the model, so large screenshots do not inflate token usage unnecessarily. Images outside the workspace require Read permission the first time, like any other external file.


CLI reference

-p, --prompt <TEXT>          Run one prompt and exit.
    --readonly               Start in read-only mode with inspection tools only.

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars10
CategoryCustomer
Updated1mo ago
Forks1

Languages

Rust

Security Score

97/100

Audited on Jul 26, 2026

1 info