ctx (ActiveMemory) CLI

ctx

A file-based context system keeps tasks, decisions and learnings between sessions so an agent never starts from zero.

  • 79 ★ on the repository
  • Last commit
CLI

Extended access

Why this level

  • The tool writes files into `.context/`, and the agent hook runs a command before every tool call.
All reasons and checks

activememory/ctx

Install

Manual install

git clone https://github.com/ActiveMemory/ctx.git && cd ctx && CGO_ENABLED=0 go build -o ctx ./cmd/ctx

Building from source, the second README option. The first option is prebuilt binaries on the releases page.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The tool writes files into `.context/`, and the agent hook runs a command before every tool call.

This is third-party code. Review the repository files before installing.

What it does

`ctx` keeps a `.context/` directory in a project where tasks, decisions with rationale and accumulated learnings pile up. At session start an agent gets a ready context packet with `ctx agent --budget 4000` instead of asking everything again. A `PreToolUse` hook for Claude Code pulls the packet in automatically. Work goes through the ordinary command line: `ctx task add`, `ctx decision add`, `ctx learning add`, `ctx status`. For research work `ctx init` also lays down an editorial knowledge-base pipeline with `/ctx-kb-ingest` and `/ctx-kb-ask` commands and handover records between sessions. The tool reads only files, so it fits any assistant that can read them.

Who it is for. Developers on a long project with an agent who are tired of retelling the architecture in every new session.

Good fit when

  • The agent forgets decisions and they get debated again and again.
  • Several assistants work on one project and need shared context.
  • Research runs for weeks and results must land in a knowledge base with source references.
  • A short handover note is needed between sessions: what is done and what comes next.

Not a fit when

  • The project lasts a day and a `CLAUDE.md` file with a few rules is enough.
  • There is no git repository and `ctx` refuses to work without `.git/`.
  • You only need style rules for the agent without a history of decisions and tasks.

Example request

Load the project context packet, remind me of the database decisions made and add a migration task to `ctx`.

Limitations

A git repository is required before `ctx init`: without `.git/` the command refuses to work. Commands read `$PWD/.context/`, so run them from the project root; there is no environment variable and no walk-up search. Installation uses prebuilt binaries from the releases page or a Go build. Integration with Claude Code, Codex, OpenCode, Pi, Cursor and Aider is described in the ctx.ist documentation, not in the README. The Apache 2.0 licence is stated in the README text.

How to disable. Remove the hook and plugin from the agent settings and delete the `ctx` binary. Keep or delete the `.context/` directory with accumulated records by hand.

FAQ

How do I install ctx?

Download a prebuilt binary from the repository releases page or build from source: `git clone https://github.com/ActiveMemory/ctx.git`, then `CGO_ENABLED=0 go build -o ctx ./cmd/ctx` in the project folder.

Where do I start in a project?

Run `ctx init` in the repository root, then `ctx status`. `ctx task add` adds the first record and `ctx agent --budget 4000` builds the agent packet.

What records does ctx keep?

Tasks, decisions with context, rationale and consequence (`ctx decision add`) and learnings (`ctx learning add`). Knowledge bases add topics and handover records.

Is ctx tied to one agent?

No. The tool works with any assistant that reads files, and integrations are described for Claude Code, Codex, OpenCode, Pi, Cursor and Aider.

How does the knowledge base differ from tasks and decisions?

It is a separate research pipeline: `ctx kb topic new` creates a topic page, `/ctx-kb-ingest` adds a source and `/ctx-kb-ask` answers from the base only.

Discussion

No questions or reviews yet.

CLI tools

A 7-rule CLAUDE.md template and session handoff commands so Claude Code keeps numbers and decisions through compaction

WorkflowMinimal access294Repository stars

hipocampus gives an agent file-based memory: a 3,000-token topic index loads each session and shows what came up before

PluginExtended access211Repository stars

UltraContext collects Claude Code, Codex and OpenClaw sessions in one place so agents can see each other's context.

CLIBroad access441Repository stars

Memory for agents: a Claude Code session resumes in Codex with the same decisions and open tasks.

MCP serverExtended access83Repository stars

Agentic Substrate

Agentic Substrate (claude-user-memory)

A short reversible rule set for an agent: research the unclear, plan proportionally, verify the outcome and keep checked knowledge

WorkflowExtended access214Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
ctx (ActiveMemory) (this card)no79
agent-memoryno4,315agent memory by another author; here decisions and tasks are plain project files, plus a knowledge base pipeline
ctxno1,181a same-named card for a different ctxrs project; this one is the ActiveMemory tool with a `.context/` directory

README in short

The README sets out the idea of context as state, shows a sample agent dialogue with memory and lists install and quick start steps. Details and recipes live on the ctx.ist site.

README badge

Report a problem