Retrieved article excerpt
Open article · Retrieved 2026-10-27T16:28:54.221546+00:00
# [aigent-OS](https://github.com/wrg32786/aigent-os/blob/master/assets/aigent-os-logo.png)
**Claude Code that refreshes its own context instead of compacting.**
Open-source (MIT) harness for one long-running Claude Code session. With Managed Auto-Refresh, when context reaches a threshold it saves a verified capsule, runs /clear, and resumes the work in a fresh session. No summary of a summary, no re-briefing. Around that loop sits an operator layer: skill routing, guarded memory and specialist sub-agents that help with the work itself.
[Install](https://github.com/wrg32786/aigent-os#install) · [Demo](https://github.com/wrg32786/aigent-os#see-it-resume-itself) · [Evidence and limits](https://github.com/wrg32786/aigent-os#evidence-and-limits) · [Operator](https://github.com/wrg32786/aigent-os#operator) · [What it changes](https://github.com/wrg32786/aigent-os#what-this-changes-on-your-machine) · [Uninstall](https://github.com/wrg32786/aigent-os#uninstall) · [FAQ](https://github.com/wrg32786/aigent-os#faq) · [Alternatives](https://github.com/wrg32786/aigent-os#alternatives) · [Docs](https://github.com/wrg32786/aigent-os/blob/master/docs/getting-started.md)
[GitHub stars](https://github.com/wrg32786/aigent-os/stargazers)
[License: MIT](https://github.com/wrg32786/aigent-os/blob/master/LICENSE)
[Claude Code](https://claude.ai/code)
[Obsidian](https://obsidian.md)
[CI](https://github.com/wrg32786/aigent-os/actions/workflows/ci.yml)
[Security Policy](https://github.com/wrg32786/aigent-os/blob/master/SECURITY.md)
[PRs Welcome](https://github.com/wrg32786/aigent-os#-contributing)
**Stop re-briefing your AI every morning.**
From the team behind [The AIgent](https://theaigent.xyz), a free media project for people building with AI.
---
## What it does, in plain English
Claude Code has a fixed context window. When it fills, the usual options are to let it auto-compact (the model summarizes the conversation and keeps going on the summary) or to `/clear` and re-explain everything yourself. aigent-OS takes a third path. Before the window fills (default 80%, configurable with `AIGENT_PRESSURE_THRESHOLD_PCT`), it asks Claude to write a resume-ready checkpoint file (a "capsule"). It waits for Claude to confirm the capsule is complete, sends exactly one `/clear`, checks that a fresh session started, and tells that new session to load the capsule and carry on. No confirmation, no clear. Your notes, decisions and open threads live in plain markdown files you keep in git (aigent-OS commits and pushes them at each capsule cycle when the install folder has a git remote), so you can read, diff and roll back exactly what your agent remembers. It runs on your machine; aigent-OS has no server of its own.
## Install
Requires [Claude Code](https://claude.ai/code), Node.js 18+ with npm, and bash (on Windows, Git Bash from [Git for Windows](https://git-scm.com)).
```
git clone https://github.com/wrg32786/aigent-os.git && cd aigent-os && bash install.sh --dry-run
```
The dry run prints the planned changes and writes nothing. When the plan looks right, run `bash install.sh` in the same folder, open a new terminal, and run `aigent`. The first launch runs guided setup.
To install into an existing project instead of the cloned folder, run `bash install.sh --target <dir>` from the clone (preview it with `--dry-run` first). Before you start working, read [What this changes on your machine](https://github.com/wrg32786/aigent-os#what-this-changes-on-your-machine), including the note on vault sync and git remotes. More options: [Quick Start](https://github.com/wrg32786/aigent-os#-quick-start).
## Evidence and limits
- **What has been shown publicly:** 11 of 11 observed Auto-Refresh cycles on one Windows reference seat, in one live run during release testing for v1.1.0-rc.1. Each cycle had one capsule request, one acknowledgement, one `/clear`, and one fresh session, with zero stranded acknowledgements and zero duplicate clears. Write-up: the companion paper, [*governed-agent-organizations*, hypothesis H2](https://github.com/wrg32786/governed-agent-organizations/blob/main/PAPER.md), and its [continuity and Auto-Refresh case study](https://github.com/wrg32786/governed-agent-organizations/blob/main/case-studies/continuity-and-auto-refresh.md). More detail: [Release evidence](https://github.com/wrg32786/aigent-os#release-evidence).
- **What it is not:** this is single-seat evidence, not a fleet or reliability claim, and not a claim that this approach beats compaction. It is a different trade-off: an explicit, inspectable checkpoint and a clean window instead of a model-written summary.
- **Known limitation (v1.1.0-rc.1):** on the rc.1 release, a long session on a managed install can stop at the clear step and need a manual `/clear`. The fixes for that are merged on `master` ([#62](https://github.com/wrg32786/aigent-os/pull/62), [#78](https://github.com/wrg32786/aigent-os/issues/78), [#79](https://github.com/wrg32786/aigent-os/issues/79)) and ship in v1.1.0. Two narrower ack edge cases, [#90](https://github.com/wrg32786/aigent-os/issues/90) (a relaunch can miss an ack already on disk) and [#91](https://github.com/wrg32786/aigent-os/issues/91) (an unspent ack can authorize a later clear after pressure drops), are now closed and fixed on `master` via [#97](https://github.com/wrg32786/aigent-os/pull/97). All of these ship in v1.1.0. If you ever clear by hand, check that the latest capsule and any work in flight are saved first. See the [v1.1.0-rc.1 release notes](https://github.com/wrg32786/aigent-os/releases/tag/v1.1.0-rc.1).
- **Release status:** Managed Auto-Refresh first shipped in the v1.1.0-rc.1 pre-release. The release GitHub marks as Latest (v1.0.0) predates it.
## Operator
Auto-Refresh is what keeps a long-lived agent going. The rest of aigent-OS is about what that agent does with the time. It keeps working across days: each refresh resumes from a checked capsule, and it will not resume into one that recorded no next step. It remembers what matters: memory is markdown in git, a fact whose validity window has ended ranks below the current one, and guards keep always-loaded memory small and hold planted instructions for review. Live failures turn into guardrails: when the seats we run hit a problem, the fix comes back to this repo with a test. And on every prompt, it is pointed at the skill in your catalog that fits what you asked.
| Capability | What it does | Status |
| --- | --- | --- |
| Live failure to fix loop | Problems found on the maintainers' live seats come back to this repo as fixes and regression tests, gathered in a weekly fleet-to-product port sweep (for example [PR #69](https://github.com/wrg32786/aigent-os/pull/69)). A `Stop` hook also flags turns whose confident claims ("fixed", "verified") went unrecorded. | On by default (the fixes and the hook ship in the core; the sweep is how we maintain the repo) |
| Failure-to-fix procedure | A [written procedure](https://github.com/wrg32786/aigent-os/blob/master/docs/self-learning-doctrine.md) asks the agent to turn a failure seen twice into a skill, a check or a routing rule. No code forces it, and the ledgers ship empty. | Experimental (a skill the agent follows) |
| Memory guardrails | A size budget on always-loaded memory files, staged memory that tries to give instructions is held for review, anything read back from memory is treated as data and never as an instruction, and folders you mark confidential stay out of search | On by default |
| Skill caddy | A hook matches each prompt against your skill catalog and suggests the skill that fits. It never blocks the turn, and when nothing fits it points at `/skill-recall` so the gap gets logged. | On by default |
| Nine named specialist agents | A builder, a read-only scout, a researcher, a design spec writer, a memory architect, a critic, a vault custodian, an architecture reviewer and a prompt writer, each with a fixed model tier and tool set ([roster](https://github.com/wrg32786/aigent-os/blob/master/vault/agents/Pantheon.md)). A hook checks every dispatch against the agent's declared tier ([details](https://github.com/wrg32786/aigent-os/blob/master/docs/model-routing-enforcement.md)). | On by default (warns); block is opt-in with `AIGENT_MODEL_GUARD=enforce` |
| C2 temporal supersession | A note can carry a validity window. Once it ends, search ranks the note below current ones instead of deleting it ([details](https://github.com/wrg32786/aigent-os/blob/master/docs/temporal-fact-ledger.md)). | On by default for notes with a validity line; in v1.1.0-rc.1 |
| Hindsight and Jev memory bridge | Explicit retain, recall, reflect and ranking against providers you configure, with every result checked against a local source ([details](https://github.com/wrg32786/aigent-os/blob/master/docs/memory-bridge.md)) | Opt-in; on master, not in a release, not verified against the live services |
| Gateguard | The first edit of each file in a session waits until the agent names what depends on it, what the change affects and the instruction it is following | Opt-in with `AIGENT_GATEGUARD=enforce` |
| Codex adapter | Routes one bounded, mechanical task type to `codex exec` and writes a diff for review; never commits or pushes ([details](https://github.com/wrg32786/aigent-os/blob/master/docs/codex-adapter.md)) | Opt-in when you invoke it; one task type |
| fleet-band and fleet-delivery mods | A status line above the prompt, and delivery of messages and scheduled job results into an idle session, once each ([mods](https://github.com/wrg32786/aigent-os/blob/master/plugins/README.md)) | Opt-in pilot (fleet-delivery runs on one seat); on master, not in a release. Delivery needs a message room and a job-results source that are not in this public repo yet |
| Agent teams ("crews") | [Guidance](https://github.com/wrg32786/aigent-os/blob/master/vault/concepts/Orchestration%20Lanes.md) on when to run a standing team, a one-shot fan-out or a solo agent | Guidance only; no code |
| Self-testing of its own operating rules | Testing a seat's behavior against its own rules | Roadmap |
## In production
Four aigent-OS seats, Titus, Pheme, Davinci and Metis, run [The AIgent](https://theaigent.xyz), a newsletter for people building with AI with close to 9,000 subscribers. When those seats fail in live use, the failure comes back to this repo as a fix and a test. One example: [`daemons/tests/capsule-sentinel-selection.test.mjs`](https://github.com/wrg32786/aigent-os/blob/master/daemons/tests/capsule-sentinel-selection.test.mjs) records a check of the four live seat vaults on Aug 1, 2026, which found that three of the four would have resumed into a checkpoint with no actionable content. The capsule selector now refuses that kind of checkpoint, and the test defends it. This is operating experience, not a measured outcome. We do not claim that aigent-OS grew the newsletter, reduced operator effort or improved business results; the companion paper lists those as not established in its [limitations and non-claims](https://github.com/wrg32786/governed-agent-organizations/blob/main/LIMITATIONS-AND-NON-CLAIMS.md).
---
## See it resume itself
[Illustration, not a screen recording: at 80% context Managed Auto-Refresh asks Claude for a capsule, Claude writes it and prints the exact acknowledgement, the runner submits /clear, and the fresh session resumes the work at 10% context](https://github.com/wrg32786/aigent-os/blob/master/assets/demo-auto-refresh.gif)
The animation is a scripted illustration of the lifecycle, not a screen recording. In the shipped default, Managed Auto-Refresh is designed to run the whole boundary without operator input: at the configured context threshold (default 80%) it requests a capsule, waits for the exact completion acknowledgement, submits one `/clear`, binds the fresh session, and submits one resume wake. The shipped settings also set `"idleCompaction": false`, so Claude Code's own idle compacti