AICTX - building a local MCP server for repo-level continuity between coding-agent sessions
I’ve been working on a problem that I think many people using Codex / Claude / Copilot-style coding agents will recognize:
Every new session tends to rediscover the same repo structure, files, decisions, failed commands, current task state, and validation steps.
That wastes context, tokens, and time.
I have been trying to work around that problem with different approaches: small handoffs, heavy memory systems, context engines...
I finally found it:
Operational continuity for AI coding agents.
AICTX that keeps useful execution state inside the repository, so the next coding-agent session can resume from what actually happened instead of inferring everything again from README + chat history.
Why MCP?
The CLI flow works, but relying only on repo instructions and shell commands still has a weakness:
the agent has to remember to run the right command at the right time.
So I’m now adding a local MCP server.
The goal is to expose AICTX continuity directly as MCP tools/resources/prompts, so compatible agents can discover and call the continuity layer natively.
The intended flow is:
agent starts task
-> calls aictx_resume
-> gets current repo continuity
-> works
-> calls aictx_finalize
-> continuity is persisted for the next session
The MCP server is local-first:
aictx mcp-server --repo . --profile full
No cloud memory.
No hidden sync.
No generic shell/filesystem server.
No daemon the user has to manage manually.
Compatible clients can launch it locally over stdio.
What the MCP exposes
The MCP server is meant to expose AICTX as repo-local continuity tools, not as a general machine-control layer.
Examples:
aictx_resume
aictx_finalize
aictx_view
aictx_map_query
aictx_task_update
aictx_portability_status
The idea is MCP-first, CLI fallback.
If MCP tools are available, the agent should call them.
If MCP is not available, the agent can still fall back to:
aictx resume --repo . --task "<task goal>" --json
aictx finalize --repo . --status success --summary "<what changed>" --json
What continuity means here
AICTX stores operational state inside .aictx/, such as:
- active Work State;
- next actions;
- decisions and handoffs;
- failure memory;
- validation evidence;
- execution summaries;
- repo context relevant to the current task;
- execution contracts;
- continuity reports.
The point is not to dump more hidden memory into the prompt.
The point is to let the agent request the right operational context when it needs it.
Plugins
I’m also packaging Claude Code and Codex plugin artifacts around the same model:
MCP-first when available.
CLI fallback when not.
Copilot support is more best-effort for now through repo instructions and VS Code MCP config where supported.
A few parts I’m currently focusing on:
Execution Contracts
Each resume can include a compact contract for the next agent: first action, edit scope, canonical validation command, expected evidence, and finalize instruction. The goal is not only “remember context”, but guide the next execution safely.
Continuity View
One thing I’m also experimenting with a deterministic Mermaid continuity view generated from repo-local AICTX artifacts. It shows the current operational state of the repo visually: Work State, open handoffs, relevant failures, execution contracts, summaries, RepoMap hints, and portable continuity status.
Here you can see what it looks like. The link to this view can be returned after each task, so the next session has an inspectable continuity map. I’m still working on making it easier to read.
Portability
The continuity lives with the repository. The idea is that useful operational state should not be locked inside one chat, one vendor, one local machine, or one agent tool. If the repo moves, the continuity can move with it ... if you want it to!
The medium-term benefit
Agent-based development starts to feel less like a sequence of isolated chats and more like an ongoing engineering process:
- less rediscovery;
- fewer repeated failed commands;
- clearer handoffs;
- better validation discipline;
- less instruction boilerplate once agents can call AICTX through MCP;
- a cleaner path for Claude, Codex and Copilot integrations;
- easier switching between Codex, Claude, Copilot or other agents;
- and a repo that can explain its current state to the next session.
GitHub: https://github.com/oldskultxo/aictx
Docs: https://aictx.org
I would love technical feedback from people building or using MCP servers, especially around:
- tool boundaries;
- local stdio server design;
- how much schema/detail to expose;
- avoiding tool/context bloat;
- whether this kind of repo-level continuity belongs in MCP;
- how to make the lifecycle reliable without over-automating it.
Collaborators and critical feedback welcome.