thearc ⚡
Your coding agent's CLAUDE.md, AGENTS.md, and skills, improved from evidence of how it actually worked.
thearc reads the sessions your agent ran in a project, has a reviewer agent rate each line of its instructions and skills against what happened, and has a curator rewrite what hurt and keep what helped. Every rating and change lands in a git-tracked journal, so each new version says why it changed, and you review it like a pull request before installing it. It works across Claude Code, Codex, Pi, OpenCode, and Antigravity.
Quickstart
python -m pip install thearc
cd your-project # a git repository
thearc skills install self-evolve --harness claude # or codex, pi, opencode
Commit what it installs (the skill, and the workspace as the submodule .thearc/workspace).
Work in the project as usual. After three sessions or more, type /evolve in the agent: it reflects on the last
week's sessions, curates, and proposes a new version of the project's instructions and skills. /evolve diff shows
it, the agent amends it when you ask, and /evolve apply installs it. A round is a short Python recipe (evolve.py
in the evolve skill, with its prompts beside it) that you can edit: see the guide.
No project at hand? examples/quickstart/run.sh sets up a toy project whose CLAUDE.md has
a wrong instruction, runs three Claude Code sessions in it, and runs a round that finds and fixes it. The
example evolution report shows four releases, parallel
candidates, merges, and section histories from a Graphify evolution workspace.
Supported agents
| Agent | Read its sessions | Install configurations (project / global) | /evolve in it |
Reflect, curate, merge |
|---|---|---|---|---|
| Claude Code | yes | yes / yes | yes | yes |
| Codex | yes | yes / yes | yes | yes |
| Pi | yes | yes / yes | yes | yes |
| OpenCode | yes | yes / yes | yes | yes |
| Antigravity | yes | yes / no | no | no |
Configurations cover context files (CLAUDE.md, AGENTS.md, …), skills, hooks, and MCP servers, as far as each
agent supports them (Pi has no hooks or MCP servers). Details per harness: runtime support.
The framework
thearc is a framework for context engineering: it turns your agents' sessions into evidence, and that evidence into
versioned changes to their context files, skills, hooks, prompts, and MCP servers. It doesn't prescribe an agent
design; it gives you the pieces — a session index and query language, reflectors, curators, mergers, and a
git-tracked journal — to build your own improvement pipelines.
Build agentic context-engineering pipelines on top of thearc: inspect sessions, extract reusable lessons and failures, curate versioned updates, evaluate their effect, and install the resulting capabilities into agent environments. The framework is designed to let these pipelines evolve as new artifacts and evaluation methods emerge, drawing direction from work on agentic context engineering, meta-skill evolution, self-evolving agent skills, self-evolving agents, and meta context engineering.
The learning cycle
sessions ─▶ reflection ─▶ ratings in the journal ─▶ curation ─▶ candidate ─▶ merge ─▶ new version
Index sessions from any supported harness:
thearc sessions --index sessions.sqlite sync logs/codex-training
thearc sessions --index sessions.sqlite query 'select:session'
Reflect, record, and curate:
from typing import Annotated
from pydantic import BaseModel
from thearc.curation import Curator
from thearc.reflection import Reflector
from thearc.resources import CategoricalScale, AgentConfig, Ref, ReflectionSchema
from thearc.sessions import Sessions
usefulness = CategoricalScale("usefulness", ["harmful", "neutral", "helpful"], ordered=True)
class Rated(BaseModel):
ref: Ref
usefulness: Annotated[str, usefulness]
class Lesson(BaseModel):
key_insight: str
ratings: list[Rated]
agent = AgentConfig.from_installation("codex", "path/to/project", name="my-agent", version="1.0")
agent = agent.init_workspace("artifacts/my-agent") # git-tracked, with a journal
with Sessions("sessions.sqlite") as sessions:
session = sessions.get() # the most recent session
reflection = Reflector("codex").handoff("Review the configuration against this session.",
session, agent, ReflectionSchema(Lesson))
agent.add_reflection(reflection) # ratings → journal
curation = Curator("codex").curate("Address the reflections.", [reflection], agent, scales=[usefulness])
print(agent.diff(curation.candidate()))
Run pipelines in parallel worktrees (agent.to_worktree(path)) and combine their candidates with
Merger("codex").merge(prompt, [candidate_1, candidate_2]). Install the result into any
harness with agent.install("claude", "path/to/project").
Further reading
- Concepts — every concept, kept in step with the code.
- Documentation — guides and reference; preview it with
python -m pip install -e '.[docs]' && python -m mkdocs serve. - Quickstart example — a toy project and one round, end to end.
- Cookbook —
live_reflect.py,live_ace.py,live_ace_with_merge.py. - Benchmarking — notes on measuring whether an evolved agent does better.
Contributing and license
Contributions are welcome: see CONTRIBUTING.md, and report vulnerabilities as SECURITY.md describes. thearc is licensed under the Apache License 2.0.
Metadata
Release files for thearc 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thearc-0.3.0.tar.gz | 367.6 kB | With provenance | Details for thearc-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thearc-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for thearc-0.3.0-py3-none-any.whl |
Total release size: 787.4 kB
Release files / thearc-0.3.0.tar.gz
| Download URL | thearc-0.3.0.tar.gz |
|---|---|
| Size | 367.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ddd5d2604708a6db3578b8a86fc1a8f01ce524de4328fab64dd68a19375bbfc
|
|
BLAKE2b-256 checksum How to use checksums |
7d5c1fe63c254a24d5c75ddacaa84bb8bf865aabbe89853e0508c8c22382edc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / thearc-0.3.0-py3-none-any.whl
| Download URL | thearc-0.3.0-py3-none-any.whl |
|---|---|
| Size | 419.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6883f783a695baf354c81b205409af87e620f9a80a67b941ca7756cf4fc7f13b
|
|
BLAKE2b-256 checksum How to use checksums |
90e83b6ccfb478b01db2d7bf4bc602178d68af4a2e06d887a7b0db3fca2b22cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for thearc 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for thearc-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.