New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

ashlrcode

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ashlrcode

Multi-provider AI coding agent CLI — 42 tools, 34 commands, autonomous mode

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

AshlrCode (ac)

Multi-provider AI coding agent for the terminal.

Version Tests TypeScript Runtime License

42 tools | 34 commands | 6 providers | 335 tests | 130 source files

What is AshlrCode?

AshlrCode is an open-source AI coding agent CLI built as an alternative to Claude Code. It runs multi-provider LLM conversations with tool use in your terminal — powered by xAI Grok by default, with failover to Anthropic, OpenAI, DeepSeek, Groq, and Ollama. It ships with 42 built-in tools, an autonomous KAIROS mode, sub-agent orchestration, and a persistent buddy companion.

Quick Start

git clone https://github.com/ashlrai/ashlrcode.git
cd ashlrcode
bun install
bun link                    # makes 'ac' available globally

export XAI_API_KEY="your-key"

ac                          # interactive REPL
ac "fix the login bug"      # single-shot mode
ac --continue               # resume last session
ac --resume <id>            # resume specific session

Features

Core

  • Agent loop — AsyncGenerator-based streaming with parallel tool execution
  • Multi-provider failover — automatic retry and provider switching on rate limits
  • 3-tier context compression — autoCompact, snipCompact, contextCollapse
  • Speculation — speculative tool execution for faster responses
  • Model patches — per-model prompt adjustments for optimal behavior

Tools (42)

CategoryToolsDescription
File I/ORead, Write, Edit, NotebookEdit, LSRead, write, and edit files with undo snapshots
SearchGlob, Grep, ToolSearchPattern matching, regex search, tool discovery
ExecutionBash, PowerShellShell execution with live streaming and timeouts
WebWebFetch, WebSearch, WebBrowserHTTP requests, search engines, browser automation
InteractionAskUser, SendMessageStructured user prompts, inter-agent messaging
AgentsAgent, ListPeersParallel sub-agents, peer discovery
TasksTaskCreate, TaskUpdate, TaskList, TaskGet, TodoWriteTask boards with dependencies and ownership
PlanningEnterPlan, PlanWrite, ExitPlan (via mode)Read-only exploration then structured execution
MemoryMemorySave, MemoryList, MemoryDeletePersistent per-project context across sessions
ConfigConfigView and modify settings at runtime
GitEnterWorktree, ExitWorktree, DiffIsolated worktree branches, diff inspection
TeamsTeamCreate, TeamDelete, TeamList, TeamDispatchNamed teammate roles with task dispatch
InfrastructureLSP, Workflow, Snip, SleepLanguage server, reusable workflows, context trimming, polling
MCPListMcpResources, mcp____External tool servers via Model Context Protocol

Commands (34)

CommandDescription
/helpList all commands
/costToken usage and cost breakdown
/statusProvider, context usage, session info
/model [name]Show or switch model (aliases: grok-fast, sonnet, opus, local)
/effort [level]Cycle or set effort level (low / normal / high)
/compactRun all 3 context compression tiers
/clearClear conversation history
/historyFile change history with timestamps
/undoRevert last file change
/restoreShow available file snapshots
/diffGit diff --stat
/gitRecent git log
/planCycle mode (normal / plan / auto)
/toolsList all registered tools
/skillsList available slash-command skills
/sessionsList saved sessions
/memoryShow project memories
/buddyBuddy stats, species, rarity, level
/btw <question>Side question in sub-agent (no main context pollution)
/autopilotAutonomous scan / queue / approve / run / auto
/kairos <goal>Start KAIROS autonomous mode
/triggerScheduled triggers (add / list / toggle / delete)
/voiceVoice input via Whisper (record / transcribe)
/syncExport / import settings across machines
/bridgeBridge server status (HTTP API for external tools)
/keybindingsShow and customize keyboard shortcuts
/featuresFeature flag status
/patchesActive model patches for current model
/undercoverToggle undercover mode (stealth prompts)
/remoteRemote settings status
/telemetryRecent telemetry events
/quitExit (also /exit, /q)

Plus custom skills loaded from ~/.ashlrcode/skills/*.md — invoked as /skill-name.

Agent System

  • Sub-agents — spawn parallel agents for research, exploration, and independent tasks
  • Worktree isolation — agents work in git worktrees to avoid conflicts
  • KAIROS autonomous mode — heartbeat-driven loop with focus-aware autonomy levels
  • Team dispatch — named teammates with roles, dispatched to tasks
  • IPC — inter-process communication between agent instances
  • Peer discovery — agents find and message sibling instances

UX

  • Ink-based UI — React terminal rendering with input box, context bar, and autocomplete
  • Buddy system — persistent ASCII pet companion with species, moods, hats, rarity, and stats
  • Keybindings — customizable shortcuts, chord bindings, Shift+Tab mode switching
  • Effort levels — low / normal / high controls response depth
  • Smart paste — large clipboard pastes auto-collapsed in context
  • Image support — drag-and-drop images with base64 collapse
  • Voice mode — record and transcribe via Whisper
  • Notifications — system notifications on task completion

Persistence

  • Sessions — JSONL at ~/.ashlrcode/sessions/, resume with --continue or --resume
  • Dreams — background memory consolidation when idle, loaded on next session
  • File undo — every Write/Edit snapshots the original, revert with /undo
  • Settings sync — export/import settings across machines with /sync
  • Memory — persistent per-project context loaded automatically

Security

  • Permission system — read-only tools auto-allowed; write tools prompt [y]es / [a]lways / [n]o / [d]eny-always
  • Permission rules — regex-based allow/deny rules in settings
  • Hook system — pre/post tool hooks can block, modify, or extend tool calls
  • Undercover mode — stealth prompt adjustments
  • Input validation — tool input schemas validated before execution

Infrastructure

  • Feature flags — runtime toggles for experimental features
  • Telemetry — event logging for debugging and analytics
  • Cost tracking — per-provider token and cost accounting
  • Retry with backoff — rate limits (3x, 1s base), network errors (2x, 2s base)
  • Speculation — predictive tool execution
  • LSP integration — Language Server Protocol for diagnostics and completions
  • MCP OAuth — OAuth flow for MCP server authentication
  • Cron triggers — scheduled recurring agent tasks
  • IPC — inter-process messaging between instances
  • Bridge server — HTTP API for external tool integration
  • Remote settings — fetch config overrides from a URL
  • Model patches — per-model prompt tuning

Configuration

PathPurpose
~/.ashlrcode/settings.jsonProviders, hooks, MCP servers, feature flags
~/.ashlrcode/keybindings.jsonCustom keyboard shortcuts
~/.ashlrcode/permissions.jsonPersisted tool permission rules
~/.ashlrcode/sessions/Saved conversation sessions (JSONL)
~/.ashlrcode/dreams/Background memory consolidation files
~/.ashlrcode/memory/Per-project persistent memories
~/.ashlrcode/tasks/Persisted task boards
~/.ashlrcode/skills/Custom skill definitions (.md files)
./ASHLR.md or ./CLAUDE.mdProject-level instructions

Environment Variables

VariablePurpose
XAI_API_KEYxAI Grok API key (primary)
ANTHROPIC_API_KEYAnthropic Claude API key
OPENAI_API_KEYOpenAI API key (also used for Whisper voice)
DEEPSEEK_API_KEYDeepSeek API key
GROQ_API_KEYGroq API key
AC_BRIDGE_PORTEnable bridge server on this port
AC_REMOTE_SETTINGS_URLURL for remote settings fetch
AC_FEATURE_VOICE_MODEEnable voice input (true)

Hook System

Pre/post tool execution hooks for automation and safety:

{
  "hooks": {
    "preToolUse": [
      { "toolName": "Bash", "inputPattern": "rm -rf", "action": "deny", "message": "Blocked" },
      { "toolName": "Bash", "inputPattern": "git push", "action": "ask" }
    ],
    "postToolUse": [
      { "toolName": "Edit", "command": "bun run lint --fix $TOOL_INPUT" }
    ]
  }
}

Providers

ProviderModelCost (in/out per 1M tokens)Context
xAI (default)grok-4-1-fast-reasoning$0.20 / $0.502M
Anthropicclaude-sonnet-4-6$3.00 / $15.00200K
OpenAIgpt-4o$2.50 / $10.00128K
DeepSeekdeepseek-chat$0.14 / $0.28128K
Groqllama-3.3-70b$0.59 / $0.79128K
Ollama (local)any local modelFreeModel-dependent

Auto-failover on rate limits. Model aliases: grok-fast, grok-4, grok-3, sonnet, opus, llama, local.

KAIROS Mode

KAIROS is an autonomous agent mode with a heartbeat-driven loop. It detects terminal focus to adjust autonomy:

  • Focused — collaborative: asks before significant changes
  • Unfocused — full-auto: acts independently while you're away
  • Unknown — balanced default
ac
> /kairos "refactor the auth module and add tests"
> /kairos stop

Buddy System

Every user gets a deterministic ASCII pet companion based on a hash of their home directory. Eight species with rarity tiers, mood-based animations, equippable hats, and stats that grow with usage.

  ┌──────────────────────────────┐     c\  /c
  │ What if we tried a different │    ( .  . )
  │ approach to the auth flow?   │    ( _nn_ )
  └──────────────────────┐       │    (______)
                         └───────┘     ||  ||

Species: penguin, cat, ghost, owl, robot, dragon, axolotl (epic), capybara (legendary). Stats: debugging, patience, chaos, wisdom, snark.

Development

git clone https://github.com/ashlrai/ashlrcode.git
cd ashlrcode
bun install

bun run dev                 # watch mode
bun run start               # run CLI
bun test                    # 335 tests, 666 assertions, ~10s
bunx tsc --noEmit           # type check
bun run build               # bundle to dist/

Architecture

src/                        # 130 source files
├── cli.ts                  # Entry point + fallback REPL
├── repl.tsx                # Ink-based terminal UI
├── setup.ts                # Initialization and wiring
├── agent/                  # Core agent loop, sub-agents, KAIROS, teams, dreams, IPC
├── providers/              # xAI, Anthropic, router, retry, cost tracking
├── tools/                  # 42 tools (32 files)
├── skills/                 # Skill loader + registry
├── mcp/                    # MCP client, manager, OAuth
├── planning/               # Plan mode + plan tools
├── persistence/            # Sessions + memory
├── config/                 # Settings, hooks, permissions, features, sync, undercover
├── state/                  # File history (undo)
├── ui/                     # Ink components, buddy, speech bubbles, theme, effort
├── autopilot/              # Scanner + work queue
├── bridge/                 # HTTP bridge server + client
├── telemetry/              # Event logging
└── voice/                  # Voice input via Whisper

License

MIT

Keywords

ai

FAQs

Package last updated on 03 Apr 2026

Related posts