agentic-loadout 0.7.0__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/CHANGELOG.md +19 -0
  2. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/PKG-INFO +3 -3
  3. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/README.md +2 -2
  4. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/docs/memory-1-docs-1-integration.md +1 -1
  5. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/pyproject.toml +1 -1
  6. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/memory-1/export_sessions.entire-code.py +6 -4
  7. agentic_loadout-0.7.2/scripts/overlays/memory-1/export_sessions.entire-run.py +2 -0
  8. agentic_loadout-0.7.2/src/agentic_loadout/__init__.py +1 -0
  9. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/UPSTREAM.md +3 -3
  10. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/SKILL.md +2 -1
  11. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/scripts/export_sessions.py +77 -11
  12. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/files.py +3 -0
  13. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/install.py +6 -0
  14. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/pins.py +1 -1
  15. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_export_sessions_entire.py +2 -1
  16. agentic_loadout-0.7.2/tests/test_export_sessions_opencode.py +80 -0
  17. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_skill_upgrade.py +9 -0
  18. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/uv.lock +1 -1
  19. agentic_loadout-0.7.0/scripts/overlays/memory-1/export_sessions.entire-run.py +0 -2
  20. agentic_loadout-0.7.0/src/agentic_loadout/__init__.py +0 -1
  21. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.codex/hooks.json +0 -0
  22. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.entire/.gitignore +0 -0
  23. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.entire/settings.json +0 -0
  24. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.gitattributes +0 -0
  25. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.github/workflows/ci.yml +0 -0
  26. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.github/workflows/release.yaml +0 -0
  27. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/.gitignore +0 -0
  28. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/LICENSE +0 -0
  29. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/PLAN.md +0 -0
  30. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/PLAN.orig.md +0 -0
  31. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/docs/agentic-loadout.jpeg +0 -0
  32. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/docs/entire-investigation.md +0 -0
  33. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/docs/original-implementation-plan.md +0 -0
  34. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/memory-1/SKILL.entire-note.md +0 -0
  35. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/memory-1/export_sessions.entire-flag.py +0 -0
  36. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/memory-1/export_sessions.entire-import.py +0 -0
  37. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/memory-1/export_sessions.entire-only.py +0 -0
  38. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/overlays/overlays.toml +0 -0
  39. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/release_notes.py +0 -0
  40. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/scripts/sync_skills.py +0 -0
  41. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/agents.py +0 -0
  42. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/architect.md +0 -0
  43. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/code-grader.head.md +0 -0
  44. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/coder.md +0 -0
  45. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/tiers/code-reviewer.md +0 -0
  46. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/tiers/coder-small.supplement.md +0 -0
  47. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/agents/utility.md +0 -0
  48. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/development-workflow.md +0 -0
  49. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/docs-1/SKILL.md +0 -0
  50. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/docs-1/scripts/docs_index.py +0 -0
  51. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/docs-1/templates/doc.md +0 -0
  52. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/scripts/memory_check.py +0 -0
  53. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/LATER.md +0 -0
  54. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/MEMORY.md +0 -0
  55. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/NOW.md +0 -0
  56. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/notes/_example.md +0 -0
  57. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/sessions/.gitignore +0 -0
  58. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/skills/memory-1/templates/sessions/INDEX.md +0 -0
  59. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/agents-rules.md +0 -0
  60. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/coders/go.md +0 -0
  61. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/coders/python.md +0 -0
  62. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/coders/swift.md +0 -0
  63. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/coders/typescript.md +0 -0
  64. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/docs-rules.md +0 -0
  65. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/entire-rules.md +0 -0
  66. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/entire-sessions.md +0 -0
  67. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/memory-legacy.md +0 -0
  68. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/memory-rules.md +0 -0
  69. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/sdd-rules.md +0 -0
  70. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/small-delegation.md +0 -0
  71. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/assets/templates/worktree-rules.md +0 -0
  72. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/brew.py +0 -0
  73. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/cli.py +0 -0
  74. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/coders.py +0 -0
  75. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/detect.py +0 -0
  76. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/entire.py +0 -0
  77. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/git_state.py +0 -0
  78. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/instructions.py +0 -0
  79. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/legacy.py +0 -0
  80. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/mcp_config.py +0 -0
  81. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/options.py +0 -0
  82. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/preflight.py +0 -0
  83. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/runners.py +0 -0
  84. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/skills.py +0 -0
  85. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/ui.py +0 -0
  86. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/src/agentic_loadout/vendors.py +0 -0
  87. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/__init__.py +0 -0
  88. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/baseline-agent-hashes.json +0 -0
  89. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/conftest.py +0 -0
  90. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_detect_and_brew.py +0 -0
  91. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_entire.py +0 -0
  92. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_entire_optin.py +0 -0
  93. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_install.py +0 -0
  94. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_instructions.py +0 -0
  95. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_mcp_config.py +0 -0
  96. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_memory_docs.py +0 -0
  97. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_small_agents.py +0 -0
  98. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_sync_skills.py +0 -0
  99. {agentic_loadout-0.7.0 → agentic_loadout-0.7.2}/tests/test_vendored_skills.py +0 -0
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.2] - 2026-11-16
4
+
5
+ ### Added
6
+ - memory-1's session export now reads [opencode](https://opencode.ai) sessions too (from its SQLite database, opened
7
+ read-only; subagent sessions are skipped), next to Claude Code and Codex (memory-1 at `9572f47`).
8
+
9
+ ## [0.7.1] - 2026-11-16
10
+
11
+ Found while upgrading a real project from 0.6.x.
12
+
13
+ ### Fixed
14
+ - Agent files that were kept because you edited them, and that still tell agents to use agemem tools, are now named in
15
+ the final review list with the two ways to fix them (`--force`, or have your agent remove the agemem instructions).
16
+ Before, they were only reported as "differs from the shipped version".
17
+ - memory-1's session export no longer writes Codex subagent and automatic-review rollouts as sessions (memory-1 at
18
+ `642ef0c`); in one project they were about half of the exported files.
19
+ - `export_sessions.py --entire --dry-run` no longer lists as new the Entire sessions that the same run would already
20
+ write from the agent's own transcripts.
21
+
3
22
  ## [0.7.0] - 2026-11-16
4
23
 
5
24
  ### Breaking
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentic-loadout
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: One command that gives a project an agent setup: memory and docs skills, the SDD skill, subagents and language coders with code-navigation MCPs. Project-scoped, for Claude Code, Cursor and Codex.
5
5
  Project-URL: Repository, https://github.com/illescasDaniel/agentic-loadout
6
6
  Project-URL: Issues, https://github.com/illescasDaniel/agentic-loadout/issues
@@ -32,7 +32,7 @@ One command that gives a project a coding-agent setup, for Claude Code, Cursor a
32
32
 
33
33
  - **Memory:** the [memory-1](https://github.com/illescasDaniel/memory-1-skill) skill keeps current state, decisions and
34
34
  durable notes as plain Markdown in `memory/`, so a new session picks up where the last one stopped. There is no
35
- server, database or hook: the agent reads and greps files.
35
+ server, database or hook: the agent reads and greps files. Its optional session archive exports Claude Code, Codex and opencode transcripts.
36
36
  - **Docs:** the [docs-1](https://github.com/illescasDaniel/docs-1-skill) skill keeps `docs/` indexed and in step with
37
37
  the code (a generated `docs/INDEX.md`, doc IDs, a check that finds the docs a changed file touches).
38
38
  - **Spec-driven development:** the `sdd-feature` skill takes a feature through design, spec, tests, implementation and
@@ -52,7 +52,7 @@ Needs Node.js 20+ for the `sdd-feature` and `worktree` skills and the TypeScript
52
52
  with gopls for the Go coder. memory-1 and docs-1 need nothing but Python 3 (their scripts use the standard library).
53
53
 
54
54
  `--python 3.12` makes `uvx` use a tested Python instead of whichever is newest on your machine. To pin the loadout
55
- version, run `uvx --python 3.12 agentic-loadout@0.7.0 .`; individual dependencies may have their own version policy.
55
+ version, run `uvx --python 3.12 agentic-loadout@0.7.2 .`; individual dependencies may have their own version policy.
56
56
 
57
57
  > [!NOTE]
58
58
  > Claude Code has its own built-in auto memory. To keep one shared memory in the repository (memory-1's `memory/`), turn
@@ -10,7 +10,7 @@ One command that gives a project a coding-agent setup, for Claude Code, Cursor a
10
10
 
11
11
  - **Memory:** the [memory-1](https://github.com/illescasDaniel/memory-1-skill) skill keeps current state, decisions and
12
12
  durable notes as plain Markdown in `memory/`, so a new session picks up where the last one stopped. There is no
13
- server, database or hook: the agent reads and greps files.
13
+ server, database or hook: the agent reads and greps files. Its optional session archive exports Claude Code, Codex and opencode transcripts.
14
14
  - **Docs:** the [docs-1](https://github.com/illescasDaniel/docs-1-skill) skill keeps `docs/` indexed and in step with
15
15
  the code (a generated `docs/INDEX.md`, doc IDs, a check that finds the docs a changed file touches).
16
16
  - **Spec-driven development:** the `sdd-feature` skill takes a feature through design, spec, tests, implementation and
@@ -30,7 +30,7 @@ Needs Node.js 20+ for the `sdd-feature` and `worktree` skills and the TypeScript
30
30
  with gopls for the Go coder. memory-1 and docs-1 need nothing but Python 3 (their scripts use the standard library).
31
31
 
32
32
  `--python 3.12` makes `uvx` use a tested Python instead of whichever is newest on your machine. To pin the loadout
33
- version, run `uvx --python 3.12 agentic-loadout@0.7.0 .`; individual dependencies may have their own version policy.
33
+ version, run `uvx --python 3.12 agentic-loadout@0.7.2 .`; individual dependencies may have their own version policy.
34
34
 
35
35
  > [!NOTE]
36
36
  > Claude Code has its own built-in auto memory. To keep one shared memory in the repository (memory-1's `memory/`), turn
@@ -1,6 +1,6 @@
1
1
  # memory-1 and docs-1 instead of agemem
2
2
 
3
- Status: decided and implemented for release 0.7.0 on the local branch `memory-1-docs-1`. The seven open questions of the
3
+ Status: decided and implemented and released in 0.7.0. The seven open questions of the
4
4
  exploration are answered in section 8.
5
5
 
6
6
  ## Decision
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentic-loadout"
3
- version = "0.7.0"
3
+ version = "0.7.2"
4
4
  description = "One command that gives a project an agent setup: memory and docs skills, the SDD skill, subagents and language coders with code-navigation MCPs. Project-scoped, for Claude Code, Cursor and Codex."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -112,7 +112,7 @@ def entire_gitignore(out):
112
112
  (out / ".gitignore").write_text("*\n!.gitignore\n!INDEX.md\n", encoding="utf-8")
113
113
 
114
114
 
115
- def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None):
115
+ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None, planned=()):
116
116
  """Write the sessions only Entire has. Returns the counts, or None when the repository has no Entire refs."""
117
117
  warn = warn or (lambda m: print(f"warning: {m}", file=sys.stderr))
118
118
  refs, slots = entire_candidates(project)
@@ -147,7 +147,9 @@ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=p
147
147
  counts["skipped"] += 1
148
148
  continue
149
149
  # The readers above may have written this session already, possibly under another date: keep that file.
150
- if (out / name).exists() or (out.is_dir() and next(iter(out.glob(f"*-{sid}.md")), None) is not None):
150
+ # `planned`: names the native pass just rendered; in a dry run they are not on disk yet.
151
+ if ((out / name).exists() or (out.is_dir() and next(iter(out.glob(f"*-{sid}.md")), None) is not None)
152
+ or any(p == name or p.endswith(f"-{sid}.md") for p in planned)):
151
153
  counts["present"] += 1
152
154
  continue
153
155
  counts["new"] += 1
@@ -161,11 +163,11 @@ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=p
161
163
  return counts
162
164
 
163
165
 
164
- def entire_main(project, out, args):
166
+ def entire_main(project, out, args, planned=()):
165
167
  if entire_git(project, "rev-parse", "--git-dir").returncode != 0:
166
168
  print(f"--entire: {project} is not a git repository, so there are no Entire checkpoints to read", file=sys.stderr)
167
169
  return 1
168
- counts = export_entire(project, out, args.since, args.max_chars, args.dry_run)
170
+ counts = export_entire(project, out, args.since, args.max_chars, args.dry_run, planned=planned)
169
171
  if counts is None:
170
172
  print(f"no Entire checkpoints found in {project} (none committed yet, or none fetched)", file=sys.stderr)
171
173
  return 1
@@ -0,0 +1,2 @@
1
+ if args.entire:
2
+ entire_main(project, out, args, planned=set(rendered))
@@ -0,0 +1 @@
1
+ __version__ = "0.7.2"
@@ -4,7 +4,7 @@ agentic-loadout ships adapted copies of two Agent Skills. Each copy is made from
4
4
 
5
5
  | Skill | Upstream repository | Commit |
6
6
  |---|---|---|
7
- | `memory-1` | https://github.com/illescasDaniel/memory-1-skill | `b722d00df835f614ae75575b30a564c1652d2283` |
7
+ | `memory-1` | https://github.com/illescasDaniel/memory-1-skill | `9572f47adf262f262600e2e36fd58f3af19be43f` |
8
8
  | `docs-1` | https://github.com/illescasDaniel/docs-1-skill | `0fdbd5fbc39a7f5e6f8efb76a688ba3b734fcde9` |
9
9
 
10
10
  ## What differs from upstream
@@ -24,8 +24,8 @@ Every difference is an insertion between an `agentic-loadout:begin NAME` and an
24
24
 
25
25
  | File | sha256 | Differs |
26
26
  |---|---|---|
27
- | `memory-1/SKILL.md` | `a98646295f9e34d072ac9ddbcd6e2082580949e539d1bcb902b82a272b3b0f09` | yes |
28
- | `memory-1/scripts/export_sessions.py` | `0b181c2b2117ba4e1a0da93b1da4035e0158ad57a01d602428a4374ec042a033` | yes |
27
+ | `memory-1/SKILL.md` | `67c33009adacee1e6de690f272b9a45a106b7a42011a08ed52f0e2eb3dd5a804` | yes |
28
+ | `memory-1/scripts/export_sessions.py` | `7b98729c9a2c7033f86d890d9849da0670149167545cd7f93f734d31d7b83073` | yes |
29
29
  | `memory-1/scripts/memory_check.py` | `4e617dbb339f4a67b9d0cb9c9db70b2e61ff51cb0c6580db9ac59f41f0f67522` | no |
30
30
  | `memory-1/templates/LATER.md` | `b215b01ed2f7434b1287a2ebfc8dd7d69b89a97d0d464b7aa1ba7d0d65c1a676` | no |
31
31
  | `memory-1/templates/MEMORY.md` | `71375e4b3012cb78b1854265f9612752e8ca91e8bb59917b5642d4bddf0d9ad4` | no |
@@ -222,7 +222,8 @@ The archive keeps the detail that notes summarise away. Export past sessions wit
222
222
  python3 <skill dir>/scripts/export_sessions.py --project . --out memory/sessions
223
223
  ```
224
224
 
225
- It reads Claude Code (`~/.claude/projects/`) and Codex (`~/.codex/sessions/`) transcripts for this project, keeps only
225
+ It reads Claude Code (`~/.claude/projects/`), Codex (`~/.codex/sessions/`) and opencode (its SQLite database,
226
+ read-only) transcripts for this project, keeps only
226
227
  user and assistant prose, redacts credential-like strings, and writes one file per session. It prints only the files
227
228
  that are new or changed (a session that grew since the last export is rewritten), so it is safe to run every time.
228
229
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- """Export a project's agent sessions (Claude Code, Codex) to condensed, redacted Markdown.
2
+ """Export a project's agent sessions (Claude Code, Codex, opencode) to condensed, redacted Markdown.
3
3
 
4
4
  Keeps only what the user and the assistant said to each other: no tool calls, tool output, reasoning or injected
5
5
  instructions. One file per session, named <first date>-<session id prefix>.md. A file is rewritten only when its
@@ -14,7 +14,10 @@ import argparse
14
14
  import json
15
15
  import os
16
16
  import re
17
+ import sqlite3
17
18
  import sys
19
+ from datetime import datetime, timezone
20
+ from functools import partial
18
21
  from pathlib import Path
19
22
 
20
23
  # agentic-loadout:begin entire-import
@@ -24,6 +27,7 @@ import subprocess
24
27
  HOME = Path.home()
25
28
  CLAUDE_ROOT = Path(os.environ.get("CLAUDE_CONFIG_DIR", HOME / ".claude")) / "projects"
26
29
  CODEX_ROOT = Path(os.environ.get("CODEX_HOME", HOME / ".codex")) / "sessions"
30
+ OPENCODE_DB = Path(os.environ.get("XDG_DATA_HOME") or HOME / ".local" / "share") / "opencode" / "opencode.db"
27
31
 
28
32
  # Injected context rather than conversation.
29
33
  SKIP_PREFIXES = (
@@ -114,6 +118,62 @@ def read_codex(path):
114
118
  yield role, event.get("timestamp", ""), text
115
119
 
116
120
 
121
+ def opencode_db(note=True):
122
+ """Open opencode's database read-only, or return None (missing, locked or unreadable) with one short note."""
123
+ if not OPENCODE_DB.is_file():
124
+ return None
125
+ try:
126
+ return sqlite3.connect(OPENCODE_DB.resolve().as_uri() + "?mode=ro", uri=True, timeout=1)
127
+ except sqlite3.Error as err:
128
+ if note:
129
+ print(f"opencode: cannot open its database ({err}); skipped", file=sys.stderr)
130
+ return None
131
+
132
+
133
+ def opencode_sessions(project):
134
+ """Return ids of opencode's own (not subagent) sessions whose working directory is inside the project."""
135
+ db = opencode_db()
136
+ if not db:
137
+ return []
138
+ try:
139
+ with db:
140
+ rows = db.execute("SELECT id, directory FROM session_v2 WHERE parent_id IS NULL ORDER BY time_created").fetchall()
141
+ except sqlite3.Error as err:
142
+ print(f"opencode: cannot read its sessions ({err}); skipped", file=sys.stderr)
143
+ return []
144
+ finally:
145
+ db.close()
146
+ return [sid for sid, directory in rows if inside(directory, project)]
147
+
148
+
149
+ def read_opencode(sid, path):
150
+ """Yield (role, timestamp, text) from an opencode session; drops reasoning, tool items and compaction summaries."""
151
+ db = opencode_db(note=False)
152
+ if not db:
153
+ return
154
+ try:
155
+ with db:
156
+ rows = db.execute("SELECT type, time_created, data FROM session_message WHERE session_id = ? "
157
+ "AND type IN ('user', 'assistant') ORDER BY seq", (sid,)).fetchall()
158
+ except sqlite3.Error:
159
+ return
160
+ finally:
161
+ db.close()
162
+ for role, millis, raw in rows:
163
+ try:
164
+ data = json.loads(raw)
165
+ if role == "user":
166
+ text = data.get("text")
167
+ else:
168
+ text = "\n".join(b.get("text", "") for b in data.get("content") or []
169
+ if isinstance(b, dict) and b.get("type") == "text")
170
+ stamp = datetime.fromtimestamp(millis / 1000, timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
171
+ except (ValueError, AttributeError, TypeError, OverflowError, OSError):
172
+ continue
173
+ if isinstance(text, str) and text.strip():
174
+ yield role, stamp, text.strip()
175
+
176
+
117
177
  def claude_cwd(path):
118
178
  with path.open(encoding="utf-8", errors="replace") as fh:
119
179
  for _, raw in zip(range(50), fh):
@@ -144,8 +204,11 @@ def find_sessions(project, claude_dirs):
144
204
  if cdir.name == enc or inside(claude_cwd(p), project)]
145
205
  if CODEX_ROOT.is_dir():
146
206
  for path in sorted(CODEX_ROOT.rglob("*.jsonl")):
147
- if inside(codex_meta(path).get("cwd"), project):
207
+ meta = codex_meta(path)
208
+ # Codex stores each subagent and automatic review as its own rollout; only the user's own sessions count.
209
+ if inside(meta.get("cwd"), project) and not (isinstance(meta.get("source"), dict) and "subagent" in meta["source"]):
148
210
  found.append(("codex", path, read_codex))
211
+ found += [("opencode", OPENCODE_DB, partial(read_opencode, sid)) for sid in opencode_sessions(project)]
149
212
  return found
150
213
 
151
214
 
@@ -158,10 +221,11 @@ def render(client, path, reader, max_chars):
158
221
  if not turns or not any(r == "user" for r, _, _ in turns):
159
222
  return None, None
160
223
  first, last = turns[0][1], turns[-1][1]
161
- # Claude Code ids are random UUIDs; Codex ids are time-ordered (UUIDv7), so take their random tail instead.
162
- sid = path.stem[-8:] if client == "codex" else path.stem[:8]
224
+ # Claude Code ids are random UUIDs; Codex and opencode ids are time-ordered, so take their random tail instead.
225
+ stem = reader.args[0] if client == "opencode" else path.stem # an opencode session is a row, not a file
226
+ sid = stem[:8] if client == "claude" else stem[-8:]
163
227
  name = f"{first[:10] or 'undated'}-{sid}.md"
164
- body = [f"# Session {path.stem} ({client})\n\n{first[:16].replace('T', ' ')} to {last[:16].replace('T', ' ')} UTC, "
228
+ body = [f"# Session {stem} ({client})\n\n{first[:16].replace('T', ' ')} to {last[:16].replace('T', ' ')} UTC, "
165
229
  f"{len(turns)} messages. Tool calls and outputs are not exported.\n"]
166
230
  body += [f"### {role} {stamp[:16].replace('T', ' ')}\n{text}\n" for role, stamp, text in turns]
167
231
  return name, "\n".join(body)
@@ -282,7 +346,7 @@ def entire_gitignore(out):
282
346
  (out / ".gitignore").write_text("*\n!.gitignore\n!INDEX.md\n", encoding="utf-8")
283
347
 
284
348
 
285
- def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None):
349
+ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None, planned=()):
286
350
  """Write the sessions only Entire has. Returns the counts, or None when the repository has no Entire refs."""
287
351
  warn = warn or (lambda m: print(f"warning: {m}", file=sys.stderr))
288
352
  refs, slots = entire_candidates(project)
@@ -317,7 +381,9 @@ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=p
317
381
  counts["skipped"] += 1
318
382
  continue
319
383
  # The readers above may have written this session already, possibly under another date: keep that file.
320
- if (out / name).exists() or (out.is_dir() and next(iter(out.glob(f"*-{sid}.md")), None) is not None):
384
+ # `planned`: names the native pass just rendered; in a dry run they are not on disk yet.
385
+ if ((out / name).exists() or (out.is_dir() and next(iter(out.glob(f"*-{sid}.md")), None) is not None)
386
+ or any(p == name or p.endswith(f"-{sid}.md") for p in planned)):
321
387
  counts["present"] += 1
322
388
  continue
323
389
  counts["new"] += 1
@@ -331,11 +397,11 @@ def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=p
331
397
  return counts
332
398
 
333
399
 
334
- def entire_main(project, out, args):
400
+ def entire_main(project, out, args, planned=()):
335
401
  if entire_git(project, "rev-parse", "--git-dir").returncode != 0:
336
402
  print(f"--entire: {project} is not a git repository, so there are no Entire checkpoints to read", file=sys.stderr)
337
403
  return 1
338
- counts = export_entire(project, out, args.since, args.max_chars, args.dry_run)
404
+ counts = export_entire(project, out, args.since, args.max_chars, args.dry_run, planned=planned)
339
405
  if counts is None:
340
406
  print(f"no Entire checkpoints found in {project} (none committed yet, or none fetched)", file=sys.stderr)
341
407
  return 1
@@ -367,7 +433,7 @@ def main(argv=None):
367
433
  return entire_main(project, out, args)
368
434
  # agentic-loadout:end entire-only
369
435
  if not sessions:
370
- print(f"no Claude Code or Codex sessions found for {project}", file=sys.stderr)
436
+ print(f"no Claude Code, Codex or opencode sessions found for {project}", file=sys.stderr)
371
437
  return 1
372
438
  rendered = {}
373
439
  for client, path, reader in sessions:
@@ -390,7 +456,7 @@ def main(argv=None):
390
456
  print(", ".join(f"{v} {k}" for k, v in counts.items()), file=sys.stderr)
391
457
  # agentic-loadout:begin entire-run
392
458
  if args.entire:
393
- entire_main(project, out, args)
459
+ entire_main(project, out, args, planned=set(rendered))
394
460
  # agentic-loadout:end entire-run
395
461
  return 0
396
462
 
@@ -17,6 +17,7 @@ class Ctx:
17
17
  lines: list[str] = field(default_factory=list)
18
18
  warnings: list[str] = field(default_factory=list)
19
19
  notes: list[str] = field(default_factory=list) # follow-up steps for the user, printed in the summary
20
+ stale: list[Path] = field(default_factory=list) # kept files that still tell agents to use agemem tools
20
21
  pending: dict[Path, bytes] = field(default_factory=dict)
21
22
  removed: set[Path] = field(default_factory=set) # files to delete on apply; they read as absent until rewritten
22
23
 
@@ -92,6 +93,8 @@ def write_bytes(ctx: Ctx, dest: Path, data: bytes, log: bool = True) -> str:
92
93
  log and ctx.log("unchanged", dest)
93
94
  return "unchanged"
94
95
  if not ctx.force:
96
+ if any(mark in ctx.read(dest) for mark in (b"mcp__agemem__", b"project_memory_recall")):
97
+ ctx.stale.append(dest)
95
98
  log and ctx.log("skipped", dest, "differs from the shipped version (use --force to overwrite)")
96
99
  return "skipped"
97
100
  status = "replaced"
@@ -122,6 +122,12 @@ def summary(ctx: Ctx, opts: Options, report: git_state.Report | None, out: Calla
122
122
  out("\n".join(f" {e}" for e in report.excluded))
123
123
  for line in git_state.explain_changes(report, opts.hide):
124
124
  ctx.warn(line)
125
+ if ctx.stale:
126
+ names = ", ".join(sorted(p.relative_to(ctx.project).as_posix() for p in ctx.stale))
127
+ ctx.warn(f"{len(ctx.stale)} agent file(s) were kept because they differ from the shipped version, and they still "
128
+ f"tell agents to use agemem tools, which are gone: {names}. Re-run with --force to replace them with the "
129
+ "shipped versions (this drops your edits to them), or ask your coding agent to remove the agemem "
130
+ "instructions from them and use the memory rules in AGENTS.md instead.")
125
131
  if ctx.warnings:
126
132
  out("\nReview:\n" + "\n".join(f" - {w}" for w in ctx.warnings))
127
133
  if ctx.notes:
@@ -8,7 +8,7 @@ WORKTREE_SKILL = "illescasDaniel/worktree-skill"
8
8
  WORKTREE_SKILL_REF = "37674c26b84eca9df37d8dafccc367da7455d079"
9
9
  WORKTREE_SKILL_NAME = "worktree"
10
10
  MEMORY_SKILL = "illescasDaniel/memory-1-skill"
11
- MEMORY_SKILL_REF = "b722d00df835f614ae75575b30a564c1652d2283"
11
+ MEMORY_SKILL_REF = "9572f47adf262f262600e2e36fd58f3af19be43f"
12
12
  MEMORY_SKILL_NAME = "memory-1"
13
13
  DOCS_SKILL = "illescasDaniel/docs-1-skill"
14
14
  DOCS_SKILL_REF = "0fdbd5fbc39a7f5e6f8efb76a688ba3b734fcde9"
@@ -26,6 +26,7 @@ def agent_homes(tmp_path_factory, monkeypatch):
26
26
  monkeypatch.setattr(exporter, "HOME", home)
27
27
  monkeypatch.setattr(exporter, "CLAUDE_ROOT", home / ".claude/projects")
28
28
  monkeypatch.setattr(exporter, "CODEX_ROOT", home / ".codex/sessions")
29
+ monkeypatch.setattr(exporter, "OPENCODE_DB", home / "opencode/opencode.db")
29
30
  return home
30
31
 
31
32
 
@@ -201,7 +202,7 @@ def test_the_pass_only_reads_git_data(repo):
201
202
  def test_without_the_flag_entire_checkpoints_are_ignored_and_the_native_behaviour_is_unchanged(repo, capsys):
202
203
  commit_ref(repo, "refs/entire/checkpoints/7X/01AAAA", session_files(CODEX_ID, "codex", TURNS))
203
204
  assert run(repo, entire=False) == 1
204
- assert "no Claude Code or Codex sessions found" in capsys.readouterr().err and not (repo / "memory").exists()
205
+ assert "no Claude Code, Codex or opencode sessions found" in capsys.readouterr().err and not (repo / "memory").exists()
205
206
 
206
207
 
207
208
  def test_native_sessions_are_exported_first_and_entire_adds_only_what_is_missing(repo, capsys):
@@ -0,0 +1,80 @@
1
+ """opencode sessions in the adapted memory-1 export_sessions.py, read from synthetic SQLite databases (never the real one)."""
2
+
3
+ import importlib.util
4
+ import json
5
+ import sqlite3
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ import pytest
10
+
11
+ SCRIPT = Path(__file__).parent.parent / "src/agentic_loadout/assets/skills/memory-1/scripts/export_sessions.py"
12
+ spec = importlib.util.spec_from_file_location("export_sessions_opencode", SCRIPT)
13
+ exporter = importlib.util.module_from_spec(spec)
14
+ sys.modules[spec.name] = exporter
15
+ spec.loader.exec_module(exporter)
16
+
17
+ MAIN_ID = "ses_aaaa1111bbbb2222"
18
+
19
+
20
+ @pytest.fixture
21
+ def db_path(tmp_path, monkeypatch):
22
+ empty = tmp_path / "home"
23
+ monkeypatch.setattr(exporter, "HOME", empty)
24
+ monkeypatch.setattr(exporter, "CLAUDE_ROOT", empty / ".claude/projects")
25
+ monkeypatch.setattr(exporter, "CODEX_ROOT", empty / ".codex/sessions")
26
+ path = tmp_path / "data" / "opencode" / "opencode.db"
27
+ monkeypatch.setattr(exporter, "OPENCODE_DB", path)
28
+ return path
29
+
30
+
31
+ def make_db(path, project):
32
+ path.parent.mkdir(parents=True)
33
+ db = sqlite3.connect(path)
34
+ db.execute("CREATE TABLE session_v2(id, project_id, parent_id, directory, title, time_created, time_updated)")
35
+ db.execute("CREATE TABLE session_message(id, session_id, type, seq, time_created, data)")
36
+ db.execute("INSERT INTO session_v2 VALUES (?, 'p', NULL, ?, 't', 1, 1)", (MAIN_ID, str(project / "sub")))
37
+ db.execute("INSERT INTO session_v2 VALUES ('ses_child', 'p', ?, ?, 't', 1, 1)", (MAIN_ID, str(project)))
38
+ messages = [
39
+ ("user", {"text": "hello"}),
40
+ ("assistant", {"content": [{"type": "reasoning", "text": "private thought"}, {"type": "tool", "name": "x"},
41
+ {"type": "text", "text": "hi there"}]}),
42
+ ("compaction", {"summary": "a summary"}),
43
+ ("user", {"text": "bye"}),
44
+ ]
45
+ for sid in (MAIN_ID, "ses_child"):
46
+ for seq, (kind, data) in enumerate(messages):
47
+ db.execute("INSERT INTO session_message VALUES (?, ?, ?, ?, ?, ?)",
48
+ (f"{sid}-{seq}", sid, kind, seq, 1790000000000 + seq * 1000, json.dumps(data)))
49
+ db.commit()
50
+ db.close()
51
+
52
+
53
+ def test_exports_visible_conversation_and_skips_subagent_sessions(tmp_path, db_path):
54
+ project = tmp_path / "proj"
55
+ project.mkdir()
56
+ make_db(db_path, project)
57
+ found = exporter.find_sessions(project, None)
58
+ assert [c for c, *_ in found] == ["opencode"] # the subagent session is not listed
59
+ client, path, reader = found[0]
60
+ name, text = exporter.render(client, path, reader, 6000)
61
+ assert name.endswith("-bbbb2222.md")
62
+ assert "hello" in text and "hi there" in text and "bye" in text
63
+ assert "private thought" not in text and "a summary" not in text and "(opencode)" in text
64
+ assert exporter.render(client, path, reader, 6000)[1] == text # same input, same output: unchanged on a re-run
65
+
66
+
67
+ def test_other_projects_and_a_missing_database_export_nothing(tmp_path, db_path, capsys):
68
+ project = tmp_path / "proj"
69
+ project.mkdir()
70
+ assert exporter.find_sessions(project, None) == [] # no database at all
71
+ make_db(db_path, project)
72
+ assert exporter.find_sessions(tmp_path / "elsewhere", None) == []
73
+ assert exporter.main(["--project", str(tmp_path / "elsewhere"), "--out", str(tmp_path / "out")]) == 1
74
+
75
+
76
+ def test_database_without_the_tables_is_skipped_with_a_note(tmp_path, db_path, capsys):
77
+ db_path.parent.mkdir(parents=True)
78
+ sqlite3.connect(db_path).close()
79
+ assert exporter.find_sessions(tmp_path, None) == []
80
+ assert "opencode" in capsys.readouterr().err
@@ -130,3 +130,12 @@ def test_a_newer_release_updates_untouched_copies_and_keeps_edited_files(repo, m
130
130
  before = snapshot(repo)
131
131
  code, out = full(repo, tools=("claude",), executor=FakeExecutor(), without=LEAN)
132
132
  assert code == 0 and snapshot(repo) == before
133
+
134
+
135
+ def test_kept_agent_files_that_still_name_agemem_tools_are_listed_for_review(repo):
136
+ code, out = full(repo, tools=("claude",), executor=FakeExecutor(), without=frozenset({"sdd", "worktree", "coders"}))
137
+ assert code == 0, out
138
+ edited = repo / ".claude/agents/architect.md"
139
+ edited.write_text(edited.read_text() + "\nUse mcp__agemem__project_memory_recall first.\n")
140
+ code, out = full(repo, tools=("claude",), executor=FakeExecutor(), without=frozenset({"sdd", "worktree", "coders"}))
141
+ assert code == 0 and "still tell agents to use agemem tools" in out and ".claude/agents/architect.md" in out
@@ -4,7 +4,7 @@ requires-python = ">=3.11"
4
4
 
5
5
  [[package]]
6
6
  name = "agentic-loadout"
7
- version = "0.7.0"
7
+ version = "0.7.2"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "pyyaml" },
@@ -1,2 +0,0 @@
1
- if args.entire:
2
- entire_main(project, out, args)
@@ -1 +0,0 @@
1
- __version__ = "0.7.0"
File without changes
File without changes