Skip to content

Commit edaeda4

Browse files
committed
Rename project context file from .sofosrc to AGENTS.md; change screenshot
1 parent 2e2302b commit edaeda4

6 files changed

Lines changed: 39 additions & 20 deletions

File tree

.sofosrc renamed to AGENTS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Sofos is a terminal-based AI coding assistant powered by Anthropic's Claude API.
2626
- **Loop-based handling** allows Claude to use multiple tools in sequence iteratively
2727

2828
3. **Two-Level Instructions** (src/session/history.rs)
29-
- `.sofosrc`: Project-level, version controlled
29+
- `AGENTS.md`: Project-level, version controlled
3030
- `.sofos/instructions.md`: Personal, gitignored
3131
- Both appended to system prompt at startup
3232

@@ -101,11 +101,11 @@ src/
101101
- Supports both regular and server-side tools (like web_search)
102102

103103
**src/ui/diff.rs**
104-
- Generate contextual diffs showing only changed code blocks
105-
- Uses `similar` crate for accurate line-by-line diffing
106-
- Formats output with colored backgrounds (red for deletions, blue for additions)
104+
- Generate contextual diffs with syntax highlighting and line numbers
105+
- Uses `similar` crate for diffing, `syntect` for syntax coloring
106+
- Dark backgrounds (#5e0000 deletions, #00005f additions) with syntax-colored code
107107
- Context lines (default: 2) show unchanged code around changes
108-
- Used by morph_edit_file tool to display what changed
108+
- Used by edit_file, write_file, and morph_edit_file tools
109109

110110
**src/session/history.rs**
111111
- SessionMetadata: Preview and timestamps for session list
@@ -315,10 +315,10 @@ cargo test -- --nocapture # Show println output
315315

316316
### Adding a New Tool
317317

318-
1. Define tool in `src/tools/types.rs` (get_tools or get_tools_with_morph)
319-
2. Implement execution in appropriate file (filesystem.rs, bashexec.rs, etc)
320-
3. Add match arm in `src/tools/mod.rs` (ToolExecutor::execute)
321-
4. Test the new tool thoroughly
318+
1. Add variant to `src/tools/tool_name.rs` (ToolName enum, as_str, from_str)
319+
2. Define tool schema in `src/tools/types.rs` and add to tool lists
320+
3. Implement execution in `src/tools/mod.rs` (ToolExecutor::execute match arm)
321+
4. Add tests in `src/tools/tests.rs`
322322
5. Update README.md with tool description
323323

324324
### Modifying Bash Command Permissions
@@ -392,7 +392,7 @@ This prints:
392392

393393
**Always:**
394394
- Test security features when making changes to filesystem or bash tools
395-
- Update both README.md and this .sofosrc when adding features
395+
- Update both README.md and this CLAUDE.md when adding features
396396
- Run `cargo test` before committing
397397
- Add helpful error messages for user-facing errors
398398

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to Sofos are documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
- `edit_file` tool for targeted string replacement edits (no external API required)
9+
- `glob_files` tool for recursive file pattern matching (`**/*.rs`, `src/**/mod.rs`)
10+
- `web_fetch` tool for fetching URL content as readable text
11+
- Syntax highlighting inside diffs with line numbers
12+
- Streaming infrastructure for Anthropic SSE API (disabled pending incremental markdown rendering)
13+
14+
### Changed
15+
- Renamed project instructions file from `.sofosrc` to `AGENTS.md` per the [AGENTS.md](https://agents.md) convention for providing project context to AI agents
16+
- Replaced yanked `pulldown-cmark-mdcat` with `pulldown-cmark` + custom ANSI markdown renderer
17+
- Improved diff display: darker backgrounds (#5e0000 / #00005f), syntax-colored code, line numbers
18+
- Tool output with ANSI formatting (diffs) no longer dimmed
19+
720
## [0.1.20] - 2026-03-23
821

922
### Added

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A blazingly fast, interactive AI coding assistant powered by Claude or GPT, impl
66

77
Tested on macOS but should work on Linux and Windows as well.
88

9-
<div align="center"><img src="/assets/sofos_code.png" style="width: 800px;" alt="Sofos Code"></div>
9+
<div align="center"><img src="/assets/screenshot.png" style="width: 800px;" alt="Sofos Code"></div>
1010

1111
## Table of Contents
1212

@@ -40,13 +40,16 @@ Tested on macOS but should work on Linux and Windows as well.
4040
- **Image Vision** - Analyze local or web images
4141
- **Session History** - Auto-save and resume conversations
4242
- **Custom Instructions** - Project and personal context files
43-
- **File Operations** - Read, write, list, create (sandboxed)
43+
- **File Operations** - Read, write, edit, list, create (sandboxed)
44+
- **Targeted Edits** - Diff-based `edit_file` for precise string replacements
4445
- **Ultra-Fast Editing** - Optional Morph Apply integration (10,500+ tokens/sec)
46+
- **File Search** - Find files by glob pattern (`**/*.rs`)
4547
- **Code Search** - Fast regex search with ripgrep
4648
- **Web Search** - Real-time info via Claude's/OpenAI's native search
49+
- **Web Fetch** - Read documentation and web pages
4750
- **Bash Execution** - Run tests and builds (read-only, sandboxed)
4851
- **MCP Integration** - Connect to external tools via Model Context Protocol
49-
- **Visual Diffs** - Colored change display
52+
- **Visual Diffs** - Syntax-highlighted diffs with line numbers
5053
- **Iterative Tools** - Up to 200 tool calls per request
5154
- **Context Compaction** - Summarizes older messages instead of dropping them
5255
- **Cost Tracking** - Session token usage and cost estimates
@@ -72,7 +75,7 @@ git clone https://github.com/alexylon/sofos-code.git
7275
cd sofos-code && cargo install --path .
7376
```
7477

75-
**Important:** Add `.sofos/` to `.gitignore` (contains session history and personal settings). Keep `.sofosrc` (team-wide instructions).
78+
**Important:** Add `.sofos/` to `.gitignore` (contains session history and personal settings). Keep `AGENTS.md` (team-wide instructions).
7679

7780
## Usage
7881

@@ -157,9 +160,9 @@ For Claude, it enables the thinking protocol and `--thinking-budget` controls to
157160
For OpenAI (gpt-5 models), `/think on` sets high reasoning effort and `/think off` sets low reasoning effort.
158161
The `--thinking-budget` parameter only applies to Claude models.
159162
160-
## Custom Instructions
163+
## Custom Instructions/Context
161164
162-
**`.sofosrc`** (project root, version controlled) - Team-wide conventions, architecture (see this project's `.sofosrc` for example)
165+
**[`AGENTS.md`](https://agents.md)** (project root, version controlled) - Project context for AI agents, team-wide conventions, architecture
163166
**`.sofos/instructions.md`** (gitignored) - Personal preferences
164167
165168
Both loaded at startup and appended to system prompt.
@@ -173,13 +176,16 @@ Conversations auto-saved to `.sofos/sessions/`. Resume with `sofos -r` or `/resu
173176
**File Operations:**
174177
- `read_file` - Read file contents
175178
- `write_file` - Create or overwrite files
179+
- `edit_file` - Targeted string replacement edits (no API key needed)
176180
- `morph_edit_file` - Ultra-fast code editing (requires MORPH_API_KEY)
177-
- `list_directory` - List directory contents
181+
- `list_directory` - List a single directory's contents
182+
- `glob_files` - Find files recursively by glob pattern (`**/*.rs`, `src/**/test_*.py`)
178183
- `create_directory`, `delete_file`, `delete_directory`, `move_file`, `copy_file` - Standard file ops
179184

180185
**Code & Search:**
181186
- `search_code` - Fast regex-based code search (requires `ripgrep`)
182187
- `web_search` - Real-time web information via Claude's/OpenAI's native search
188+
- `web_fetch` - Fetch URL content as readable text (documentation, APIs)
183189
- `execute_bash` - Run tests and build commands (read-only, sandboxed)
184190

185191
**Image Vision:**
@@ -190,7 +196,7 @@ Conversations auto-saved to `.sofos/sessions/`. Resume with `sofos -r` or `/resu
190196

191197
**Note:** Only `read_file`, `list_directory`, and `image` can access paths outside workspace when explicitly allowed in config. All other operations are workspace-only.
192198

193-
Safe mode (`--safe-mode` or `/s`) restricts to: `list_directory`, `read_file`, `web_search`, `image`.
199+
Safe mode (`--safe-mode` or `/s`) restricts to: `list_directory`, `read_file`, `glob_files`, `web_search`, `web_fetch`, `image`.
194200

195201
## MCP Servers
196202

@@ -334,7 +340,7 @@ src/
334340
└── builtin.rs # Command implementations
335341
```
336342
337-
See `.sofosrc` for detailed conventions.
343+
See `AGENTS.md` for detailed conventions.
338344
339345
## Release
340346

assets/screenshot.png

683 KB
Loading

assets/sofos_code.png

-499 KB
Binary file not shown.

src/session/history.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl HistoryManager {
229229
}
230230

231231
pub fn load_custom_instructions(&self) -> Result<Option<String>> {
232-
let project_rc = self.workspace.join(".sofosrc");
232+
let project_rc = self.workspace.join("AGENTS.md");
233233
let personal_instructions = self.workspace.join(".sofos/instructions.md");
234234

235235
let mut combined = String::new();

0 commit comments

Comments
 (0)