selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Ogcode logo

Self-host Ogcode

v0.53.1

AI coding agent that recalls context instead of replaying it

BetaOpen SourceAGPL-3.0
Updated8 hours ago
LanguageGo
Setup difficultyModerate
Stars
145
Port
9595 (Web UI)
Docker
ghcr.io/prasenjeet-symon/ogcode
Install with Docker
Developer at terminal with memory visualization showing recall systemOgcode social preview image

What is Ogcode?

Ogcode is a self-hosted AI coding agent that runs as a single Go binary with an embedded web UI. It understands codebases by mapping them before reading, recalls past decisions instead of replaying entire conversation histories, and keeps context windows small to reduce token costs. The agent supports multiple model providers (Anthropic, OpenAI, OpenRouter, Ollama) and can run fully offline with local models. It features three permission modes (Ask, Auto, Yolo), Plan Mode for breaking features into parallel tasks with pull requests, built-in web search, skills for repeatable workflows, MCP server integration, and rich result rendering (Mermaid, LaTeX, Plotly, HTML). Installation options include Docker, Homebrew, winget, Go install, and a curl script. The web UI runs on port 9595 by default. Licensed under AGPL-3.0 with a commercial license option.

Should you self-host Ogcode?

Ogcode scores 45/100 on selfhost.directory (how scoring works) and ranks #66 of 120 in AI Assistant. It has 145 GitHub stars.

It shipped 11 stable releases in the past year. The latest, v0.53.1, came out on 28 October 2026. New versions land roughly every 1 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is AGPL-3.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is DesktopCommanderMCP (73/100, 10 147 stars). It scores higher overall, so compare the two before you pick. See Ogcode vs DesktopCommanderMCP side by side.

Features

  • Built-in web search
  • Codebase mapping and surgical reads
  • Fully offline operation with Ollama
  • Local file preview serving
  • MCP Server Integration
  • Multiple model provider support
  • OGX hosted inference planPaid subscription for hosted models; self-hosted version remains free
  • Plan Mode with parallel task execution
  • Project instructions via AGENTS.md and MEMORY.md
  • Remote deployment via SSH tunnel, reverse proxy, or Docker
  • Rich result rendering
  • Skills System
  • Three permission modes (Ask, Auto, Yolo)
  • Turn-by-turn recall memory

Ogcode README

How to install Ogcode

Install Ogcode with Docker

docker run -p 9595:9595
-v ~/.ogcode:/root/.ogcode
-v "$(pwd):/workspace" -w /workspace
ghcr.io/prasenjeet-symon/ogcode:latest

Also available on Docker Hub as prasenjeetsimon/ogcode:latest

How to configure Ogcode

  • ANTHROPIC_API_KEYAPI key for Anthropic/Claude models

    API key for Anthropic/Claude models

  • OGCODE_LOG_COMPRESSonCompress rotated log files

    Compress rotated log files

    values: on,off

  • OGCODE_LOG_CONSOLEerrorWhat also prints to the terminal

    What also prints to the terminal

  • OGCODE_LOG_DIR~/.ogcode/logsWhere logs are written

    Where logs are written

  • OGCODE_LOG_FORMATtextLog format

    Log format

    values: text,json

  • OGCODE_LOG_LEVELinfoLog level

    Log level

    values: debug,info,warn,error

  • OGCODE_LOG_MAX_AGE_DAYS14Log age limit in days

    Log age limit in days

  • OGCODE_LOG_MAX_FILES5Number of log files to keep

    Number of log files to keep

  • OGCODE_LOG_MAX_SIZE_MB10Log rotation size in MB

    Log rotation size in MB

  • OGCODE_POSTHOG_LOGSoffOpt in to shipping logs to PostHog

    Opt in to shipping logs to PostHog

    values: on,off

  • OGCODE_POSTHOG_LOGS_LEVELwarnSeverity floor for shipped logs

    Severity floor for shipped logs

  • OGCODE_PREVIEW_DOMAINWildcard domain for live service previews

    Wildcard domain for live service previews

  • OGCODE_SEARCH_ENABLEDtrueEnable/disable built-in web search

    Enable/disable built-in web search

    values: true,false

  • OGCODE_SEARXNG_URLURL for self-hosted SearxNG search instance

    URL for self-hosted SearxNG search instance

  • OLLAMA_BASE_URLBase URL for Ollama or OpenAI-compatible local endpoint

    Base URL for Ollama or OpenAI-compatible local endpoint

  • OPENAI_API_KEYAPI key for OpenAI/GPT models

    API key for OpenAI/GPT models

  • OPENROUTER_API_KEYAPI key for OpenRouter

    API key for OpenRouter

  • TAVILY_API_KEYAPI key for Tavily search and page reading

    API key for Tavily search and page reading

Ogcode releases & version history

FAQ

How is this different from just a bigger context window?

A bigger window still re-sends everything every turn — you pay for it either way, and models get less accurate as the prompt grows. Ogcode brings back only what's relevant so requests stay well under 200K and the bill stays flat.

What does it cost?

Ogcode is free and open source under AGPL-3.0. You pay your model provider for tokens, but Ogcode sends ~70% fewer tokens. With Ollama, it costs nothing.

Can I run it on a server and use it from my laptop?

Yes. It's a normal web server — put it behind nginx or Caddy with a password. Don't expose it to the open internet unprotected since it can run commands on your machine.

Does it work on Windows?

Yes — run the PowerShell install script or use the Docker image. Opening PRs automatically needs the GitHub CLI authenticated.

Can a small, cheap model really keep up?

Far better than in an agent that lets the context balloon. Ogcode keeps each request lean: median request carried 54K tokens and 99% stayed under 180K. Small models answer most accurately when the prompt is short and focused.

If it doesn't re-read everything, does it forget things?

It doesn't drop them — it moves them. What matters is remembered and brought back when relevant. In practice it forgets less than other agents which eventually run out of context window.

Is the 70% token savings number real?

Measured against agents that re-send the whole conversation every turn, across real sessions — about 68% at 50 messages, ~76% at 1,000. The mechanism and numbers are in the README and the code is open source.

Can I really run it fully offline?

Yes. It auto-detects a running Ollama on macOS and Linux. Offline you lose the web search tool and hosted models, but everything else works.

Does my source code leave my machine?

Only in the prompts you send to whichever model provider you chose. There is no Ogcode server, no telemetry endpoint, and no account. Everything lives in a local database. With a local Ollama model, nothing leaves the machine at all.

More in AI Assistant

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…