Attic and git
First, in the same shell command as anything below, locate the script:
ATTIC_JS=$(ls -d "${CODEX_HOME:-$HOME/.codex}"/plugins/cache/attic/attic/*/skills/attic/scripts/attic.js "${CODEX_HOME:-$HOME/.codex}"/skills/attic/scripts/attic.js "$HOME"/.agents/skills/attic/scripts/attic.js .agents/skills/attic/scripts/attic.js 2>/dev/null | sort -V | tail -1)
.attic/INDEX.md and DECISIONS.md are append-only, so two branches that
each stash something will conflict on every merge. The fix is a union merge
driver.
- Add to the repository's
.gitattributes(create it if absent):
.attic/INDEX.md merge=attic
.attic/DECISIONS.md merge=attic
- Each developer runs this once per clone. Git does not allow a repository to configure a driver command for security reasons, so this cannot be automated for them:
git config merge.attic.name "attic union merge"
git config merge.attic.driver "node <path-to-plugin>/scripts/attic-merge.js %O %A %B %P"
Resolve <path-to-plugin> from $(dirname "$ATTIC_JS")/../../.. and show the
real path in the command you print.
- Verify by describing the check, or running it in a scratch clone: two branches each appending an item should merge with no conflict markers.
Then tell the user what to commit, from docs/TEAM.md:
- Commit
.attic/INDEX.md,.attic/items/,.attic/DECISIONS.mdfor shared memory. - Consider gitignoring
.attic/items/session-*.md, which are personal working state and rarely useful to others. - A committed attic is in git history. If a credential ever reaches it, rotating the credential is the fix. Removing the file is not enough.
If someone declines the merge driver, warn them that conflicts on INDEX.md will be frequent and that resolving them by picking one side silently loses the other side's items.