r/emacs•
AphexPin

Claude Code + Org Mode + Git + Hooks

Just wanted to share this workflow I've been using lately. I'll keep it brief.

I spawn a Claude Code instance from within a TODO.org file, the context from the org node is dynamically injected into the agents initial prompt. The agent inherits the TODO task state from the file as .env var, with different template instructions and tool permissions for TODO vs NEXT agents. The TODO agent decomposes tasks, writes these as entries into TODO.org, and spawns NEXT agents, which each get their own worktree. Toggling from NEXT->DONE triggers a git hook to commit and kill buffer, and sends a summary message being to the parent and TODO->DONE triggers merge of children and message to grandparent. Each TODO is its own branch. Everything is done with hooks, not begging AI to remember.

Code review is then just walking the org tree and checking the diffs at each leaf node. Within the org-mode file, I can filter the tree to show only which agents are currently running, so I get a hierarchical view for free. The whole thing works with Codex too, but it doesn't have hooks so it's not quite as nice (but the message passing between Claude/Codex works because it's using Emacs layer for this).

-----

Anyway, just sharing. I know everyone has their own workflow, but this was nice because I didn't really have to build any custom tooling - it's just org mirroring the git tree workflow and providing context for agents, all facilitated with a set of hooks to force the workflow deterministically.

Posted Mar 6, 2026, 3:42 PM UTC

6121
Loading comments…