Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Check the [roadmap](https://github.com/hakula139/oxide-code/blob/main/docs/roadmap.md) first. It lists what is planned and what is out of scope for now.
Search the [open issues](https://github.com/hakula139/oxide-code/issues?q=is%3Aissue%20is%3Aopen) for planned work and duplicates, and read the [scope](https://github.com/hakula139/oxide-code#scope) for what oxide-code leaves out for now.

- type: textarea
id: problem
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
id: goal
attributes:
label: Goal
description: The outcome and why it matters. Link the parent epic or roadmap section when there is one.
description: The outcome and why it matters. Link the parent epic when there is one.
validations:
required: true

Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ contact_links:
- name: User guide
url: https://github.com/hakula139/oxide-code/tree/main/docs/guide
about: Installation, configuration, sessions, slash commands, and theming.
- name: Roadmap
url: https://github.com/hakula139/oxide-code/blob/main/docs/roadmap.md
about: What works today, the current focus, and what is out of scope.
- name: Planned work
url: https://github.com/hakula139/oxide-code/issues?q=is%3Aissue%20is%3Aopen
about: Open issues track what is planned, with epics grouping multi-issue themes. The README lists what works today and what is out of scope.
- name: Security vulnerability
url: https://github.com/hakula139/oxide-code/security/advisories/new
about: Report vulnerabilities privately through a security advisory.
19 changes: 10 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

oxide-code is a terminal-based AI coding assistant written in Rust, inspired by [Claude Code](https://code.claude.com/docs). It communicates with LLM APIs to help developers with software engineering tasks directly from the terminal.

`README.md` highlights features for users. The rest of the documentation is under `docs/`:
`README.md` highlights features and scope for users. The rest of the documentation is under `docs/`:

- [`docs/README.md`](docs/README.md): top-level index of design specs, research notes, user guides, and the roadmap.
- [`docs/README.md`](docs/README.md): top-level index of design specs, research notes, and user guides.
- [`docs/guide/`](docs/guide/): user-facing docs (installation, quickstart, configuration, slash commands, instructions, sessions, theming).
- [`docs/design/`](docs/design/) and [`docs/research/`](docs/research/): internal architecture decisions and external research, indexed by `docs/design/README.md` and `docs/research/README.md`.
- [`docs/roadmap.md`](docs/roadmap.md): working features, current focus, and explicit non-goals.

Planned work lives in open GitHub issues, and epics group the themes that span several issues.

### CLI

Expand All @@ -25,7 +26,7 @@ ox # Start an interactive session
├── .cspell/ # Project spelling dictionary
├── .github/ # CI and release workflows, plus the shared Nix setup action
├── crates/oxide-code/ # Main binary crate
├── docs/ # User guides, design specs, research notes, and roadmap
├── docs/ # User guides, design specs, and research notes
├── Formula/ # Homebrew formula, served from this repo as a tap
└── scripts/ # Release helper that refreshes the Homebrew formula
```
Expand Down Expand Up @@ -273,8 +274,9 @@ Follows the user's global instructions for comments, plus:
Follows the user's global instructions for commits, branches, and PRs, plus:

- **Scope**: Use the most specific area changed, such as a module (e.g., `client`, `config`, `oauth`), a documentation target (e.g., `AGENTS`, `research`), or a crate name only for cross-module changes.
- **PRs**: Assign to `hakula139`. Label with one type label (`enhancement` for `feat`, `bug` for `fix`, `performance` for `perf`, or the label named after the type) plus the matching `area:` labels. Follow `.github/pull_request_template.md` for descriptions, close resolved issues with `Closes #N`, and do not reference gitignored working docs. Do not request a review from the PR author, since GitHub rejects it.
- **Issues**: Open one issue per actionable outcome, using the forms in `.github/ISSUE_TEMPLATE/`, and give it acceptance criteria. Label it like a PR. A theme that spans several issues gets an `epic` parent with native sub-issues, and `docs/roadmap.md` links the epic. Mark an issue `blocked` while it waits on another, and name the blocker in a comment. Open design questions get the `design` label and close once the decision lands in `docs/design/`. Close out-of-scope requests as not planned, pointing to the roadmap.
- **PRs**: Assign to `hakula139`. Label with one type label (`enhancement` for `feat`, `bug` for `fix`, `performance` for `perf`, or the label named after the type) plus the matching `area:` labels. Follow `.github/pull_request_template.md` for descriptions, and close resolved issues with `Closes #N`. Do not request a review from the PR author, since GitHub rejects it.
- **Issues**: Open one issue per actionable outcome, using the forms in `.github/ISSUE_TEMPLATE/`, and give it acceptance criteria. Label it like a PR. A theme that spans several issues gets an `epic` parent with native sub-issues. Open issues are the record of planned work, with epics grouping the multi-issue themes. Mark an issue `blocked` while it waits on another, and name the blocker in a comment. Open design questions get the `design` label and close once the decision lands in `docs/design/`. Close out-of-scope requests as not planned, pointing to the Scope section of `README.md`.
- **Self-contained text**: Issues, PRs, and their comments link only public material. Never reference gitignored or local material, such as working docs, local paths, or private repositories.

### Testing

Expand All @@ -292,12 +294,11 @@ Follows the user's global instructions for commits, branches, and PRs, plus:

Follows the user's global instructions for documentation and Markdown prose, plus:

- Keep `README.md` user-facing, covering value, supported features, and usage.
- Keep `README.md` user-facing, covering value, supported features, scope, and usage. Update its Features list when a shipped capability area changes.
- `docs/` describes current behavior and its rationale. Planned work, deferred follow-ups, and open design questions live in GitHub issues, and docs link to the issue in place of describing future work.
- Keep `docs/roadmap.md` as the themed index of shipped capabilities and planned epics. Update it when shipped capability areas or planned priorities change.
- New research and design notes cite Claude Code, [Codex](https://github.com/openai/codex), [pi](https://github.com/badlogic/pi-mono), and [oh-my-pi](https://github.com/can1357/oh-my-pi) as reference implementations. Existing notes may keep their opencode citations.
- Crate structure diagrams must match the actual filesystem. When adding, removing, or renaming modules, update the tree in this file. Entries are sorted alphabetically. Directories sort alongside their parent `.rs` file.
- After substantive changes, sweep docs for stale claims: `README.md` status bullets, `docs/roadmap.md` Working Today / Current Focus sections, this file's crate tree and conventions, `docs/guide/*` user instructions, and `docs/research/**/*` deferred / follow-up notes that the change now resolves.
- After substantive changes, sweep docs for stale claims: `README.md` Features and Scope, open issues the change resolves or invalidates, this file's crate tree and conventions, `docs/guide/*` user instructions, and `docs/research/**/*` deferred / follow-up notes that the change now resolves.

## Nix Development

Expand Down
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,39 @@ A terminal-based AI coding assistant written in Rust, inspired by [Claude Code].

oxide-code is a Rust reimplementation of Claude Code, an interactive CLI agent that helps developers with software engineering tasks. It communicates with LLM APIs to understand codebases, write code, run commands, and manage development workflows directly from the terminal.

## Status
## Features

Early development. What works today:

- Terminal UI: streaming output, markdown rendering, syntax-highlighted code blocks, [configurable status line](docs/guide/configuration.md#tui-terminal-ui), and 5 built-in themes with custom-TOML overrides
- Bare REPL (`--no-tui`) and headless one-shot mode (`-p`) for scripts and pipelines
- Agent loop with extended thinking and tool-use round-trip
- File and search tools: `read`, `write`, `edit`, `glob`, `grep`, `bash`
- Tool permissions: `auto` (default), `plan`, and `yolo` modes, allow / deny rules, and a TUI approval prompt for gated calls
- Tool permissions: `auto` (default), `plan`, and `yolo` modes, allow / deny rules, protected config paths whose edits need approval in `auto` mode even when an allow rule matches, and a TUI approval prompt for gated calls
- Turn interruption (Esc / Ctrl+C) plus mid-turn queued follow-up prompts that splice into the same turn between tool calls, with double-press Ctrl+C exit confirmation
- Slash commands with `/`-triggered autocomplete (name and curated-arg modes): `/clear`, `/compact`, `/config`, `/delete`, `/diff`, `/effort`, `/help`, `/init`, `/model`, `/rename`, `/resume`, `/status`, `/theme`
- Context compression with manual `/compact` and default-on auto-compaction
- `CLAUDE.md` / `AGENTS.md` instruction-file discovery
- Session persistence with JSONL conversation logs, listing, and resume
- Session persistence with JSONL conversation logs, AI-generated titles, listing, and resume
- Per-session file-change tracking with a Read-before-Edit gate and on-disk drift detection
- Authentication (Anthropic API key, Claude Code OAuth) and layered TOML config

See [`docs/roadmap.md`](docs/roadmap.md) for current focus and plans.
## Scope

oxide-code follows a few principles:

- Keep the terminal as the primary interface: streaming chat, tool output, and session controls stay keyboard-first.
- Keep context and state visible: model, instructions, compaction, queued prompts, and session identity should be inspectable from the UI.
- Add workflow depth only when it fits the current agent-harness model.

Planned work lives in the [open enhancement issues](https://github.com/hakula139/oxide-code/issues?q=is%3Aissue%20is%3Aopen%20label%3Aenhancement), and themes that span several issues are grouped under [epics](https://github.com/hakula139/oxide-code/issues?q=is%3Aissue%20is%3Aopen%20label%3Aepic).

Out of scope for now:

- Editor-specific extensions and a GUI. Editors will be able to connect as ACP clients once [#150](https://github.com/hakula139/oxide-code/issues/150) ships.
- In-process plugin runtimes, such as WASM modules, dynamic libraries, or embedded scripting.
- Compatibility with Claude Code settings files, hook formats, or permission rule syntax. oxide-code reads `CLAUDE.md` instructions and Claude Code OAuth credentials, and its own configuration may diverge where its design calls for it.
- Feature parity with Claude Code. Focus on the core workflow first.

## Installation

Expand Down
8 changes: 4 additions & 4 deletions crates/oxide-code/src/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ impl FromStr for PermissionClass {

// ── Dangerous Defaults ──

/// Deny rules for the catastrophic command shapes a future classifier verdict must never wave
/// through, plus edits to the project's `.git`, which could escalate through hook injection. They
/// apply in `auto` and `plan` after the user's own deny rules, and `yolo` skips them.
/// Deny rules for the catastrophic command shapes that no later allow step may wave through, plus
/// edits to the project's `.git`, which could escalate through hook injection. They apply in
/// `auto` and `plan` after the user's own deny rules, and `yolo` skips them.
const DANGEROUS_DEFAULTS: &[&str] = &[
"bash(rm -rf:*)",
"bash(rm -fr:*)",
Expand Down Expand Up @@ -579,7 +579,7 @@ impl Policy {
}

/// Resolves a call to a [`Decision`]. Pure and synchronous: no I/O, no async, no classifier.
/// The classifier (Phase 2) slots in where this returns [`Decision::Ask`] from the last step.
/// A classifier slots in where this returns [`Decision::Ask`] from the last step.
///
/// Order, stopping at the first match:
/// 1. A user or project deny rule denies, in every mode.
Expand Down
11 changes: 5 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

## Contents

| Directory / File | Description |
| -------------------------- | --------------------------------------------------------- |
| [`design/`](design/) | oxide-code design specs and architecture decisions |
| [`guide/`](guide/) | User-facing documentation: quickstart, config, how-tos |
| [`research/`](research/) | External research: reference coding agents, Anthropic API |
| [`roadmap.md`](roadmap.md) | Project status: working features, current focus, plans |
| Directory / File | Description |
| ------------------------ | --------------------------------------------------------- |
| [`design/`](design/) | oxide-code design specs and architecture decisions |
| [`guide/`](guide/) | User-facing documentation: quickstart, config, how-tos |
| [`research/`](research/) | External research: reference coding agents, Anthropic API |
11 changes: 3 additions & 8 deletions docs/design/agent/auto-compaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,12 @@ During TUI auto-compaction, the status bar uses the existing `Compacting` state.

4. **Same summarizer as `/compact`.** Auto-compaction has no model setting of its own. The summarization request goes through `Client::stream_one_shot`, which shares the agent loop's request path and so already handles auth, model, effort, betas, prompt caching, and first-party gateway constraints.

5. **Same persistence boundary as `/compact`.** Auto-compaction should not create a second session format. `Entry::Compact` can later gain a trigger field if the UI needs to distinguish manual from automatic in history.
5. **Same persistence boundary as `/compact`.** Auto-compaction should not create a second session format.

6. **Failure circuit breaker.** A too-large or malformed compact request can be unrecoverable. After 3 consecutive automatic failures, the loop stops trying until the session changes through manual compaction, `/clear`, or `/resume`.

7. **No automatic continue prompt.** If the user queued input, it drains after compaction. Otherwise the assistant waits. Synthetic "continue" prompts make the agent act without fresh user intent.

## Deferred
## Related Issues

- Mid-turn compaction while a model response still needs tool follow-up.
- Microcompact / prune for old tool-result bodies.
- Anchored re-compaction that updates a previous summary in place.
- Separate compaction model.
- Persisted cost restore after resume.
- Hook integration.
Mid-turn compaction is tracked in [#184](https://github.com/hakula139/oxide-code/issues/184), and a `pre_compact` hook in [#168](https://github.com/hakula139/oxide-code/issues/168).
2 changes: 1 addition & 1 deletion docs/design/session/file-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The `FileTracker` is a per-session `Arc<Mutex<HashMap>>` shared across tool call

7. **xxh64 for change detection.** Cryptographic integrity isn't required, since the tracker only needs to spot drift, and xxh64 is already used elsewhere in the crate.

8. **No tracker-managed file lock.** Single-agent today, so the tracker handles the "external editor changed the file" case directly. Add the `Semaphore` when multi-agent or parallel-tool-execution lands.
8. **No tracker-managed file lock.** One agent runs tool calls one at a time, so the only concurrent writer is an external editor, which the staleness check catches. Subagents in [#136](https://github.com/hakula139/oxide-code/issues/136) would add concurrent writers within one session.

## Sources

Expand Down
6 changes: 3 additions & 3 deletions docs/design/slash/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ Client-side command surface: `/help`, `/clear`, `/model`, `/status`, and friends

3. **One synthetic block kind: `SystemMessageBlock`.** Left-bar in `accent`. Errors reuse `ErrorBlock`.

4. **Two-column popup, plain rows.** Name left, description right. Filter ranks name-prefix > alias-prefix > name-substring > alias-substring, alphabetical within each tier. Names accept `:` and `.` for future `/plugin:cmd` namespace.
4. **Two-column popup, plain rows.** Name left, description right. Filter ranks name-prefix > alias-prefix > name-substring > alias-substring, alphabetical within each tier. Names accept `:` and `.`, so namespaced names such as `/plugin:cmd` parse.

5. **Mid-session model + effort swap via `&mut Client`.** Both `/model <id>` and `/effort <level>` return `Forward(UserAction::SwapConfig { model, effort })`, the same payload both modals emit, so the typed-arg path and the modals share one resolver. Per-request paths re-read config every call so betas and `output_config` pick up the swap. Bare `/model` (combined picker) and bare `/effort` (slider) are also mutating because their submit path emits `SwapConfig`, so both forms refuse mid-turn. See [modals.md](modals.md).

6. **Slash commands never write user config files.** State is session-only, so a restart reverts to the configured values.
6. **Slash commands never write user config files.** State is session-only, so a restart reverts to the configured values. Session commands should feel reversible, and any write that outlives the session requires an explicit user action.

7. **Aliases resolve to canonical but display by surface.** `/clear` is canonical, while `/new` and `/reset` are aliases. The popup shows only the alias the user typed.

8. **No `/quit` or `/exit`.** Ctrl+C x2 / Ctrl+D already exit.

9. **Read-only kv views go through one shared modal primitive.** `/status`, `/config`, and `/help` all open a [`KvOverview`](modals.md) with title + sectioned label-value rows + footer. The modal is the response, so the typed `> /foo` line stays out of chat history (see decision 14).

10. **Built-in commands only.** `BUILT_INS` is the entire registry, with no discovery of user-defined commands.
10. **Built-in commands only.** `BUILT_INS` is the entire registry, with no discovery of user-defined commands. Skills as commands are tracked in [#163](https://github.com/hakula139/oxide-code/issues/163).

11. **Read-only commands fast-path the busy turn.** `classify` defaults to `SlashKind::ReadOnly`, and the dispatcher runs them client-side even when input is disabled. State-mutating commands override to `SlashKind::Mutating` and refuse mid-turn.

Expand Down
Loading
Loading