JEFF
CLAUDE.md1 starsChanged 3 months agoMITView on GitHub
Agent workspace manager — Go CLI + SDK built on gig. Each package has its own CLAUDE.md with contextual detail — auto-loaded when working in that area. ⚠️ NEVER touch, repoint, or replace the live jeff command, and never build a local dev build into it. Do NOT go install, go build -o jeff into PATH, symlink, alias, mv, or otherwise overwrite/shadow the installed jeff binary or change what jeff on PATH resolves to. The running orchestrator and every active…
- Installs packages
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- crew/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- memory/AGENTS.mdAGENTS.md
- persona/AGENTS.mdAGENTS.md
- skill/AGENTS.mdAGENTS.md
- tui/AGENTS.mdAGENTS.md
- workspace/AGENTS.mdAGENTS.md
- crew/CLAUDE.mdCLAUDE.md
- embed/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- memory/CLAUDE.mdCLAUDE.md
- persona/CLAUDE.mdCLAUDE.md
- skill/CLAUDE.mdCLAUDE.md
- tui/CLAUDE.mdCLAUDE.md
- workspace/CLAUDE.mdCLAUDE.md
- provider-integrationSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
16 rules. About 0 are common, 5 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
SDK-first: All logic in root package + sub-packages.
- Very specific: line 47
gig is the brain: All task state in gig via SDK (import "github.com/NeerajG03/gig").
- Very specific: line 50
All public SDK functions return (*Type, error) or error.
- Very specific: line 58
All of it lives in home.go.
- Distinctive: line 192
When the ownership test is uncertain, do nothing.
- Distinctive: line 193
Test the collision, not just the happy path: Every one of the four shipped with tests that passed, because the fixtures never contained a …
- Very specific: line 239
Don't store task state in JEFF — use gig SDK.
- Very specific: line 240
Don't shell out to gig CLI — use import "github.com/NeerajG03/gig".
- Very specific: line 241
Don't hardcode JEFF_HOME paths — use ResolveHome() (or cfg.Home in cmd/jeff).
- Very specific: line 242
Don't write the home pointer outside jeff init / jeff home use — see JEFF_HOME above.
- Very specific: line 243
Don't persist absolute paths inside the home — use internal/homepath.
- Very specific: line 244
Don't pass $HOME where a JEFF home is wanted — they are different things.
- Distinctive: line 245
Don't delete a task workspace on close — retire it (see above).
- Very specific: line 246
Don't use workspace.List to show active work — use ListActive.
- Very specific: line 247
Don't match a path with strings.Contains — see "Matching paths" above.
- Distinctive: line 248
Don't re-tag released versions — Go module proxy caches checksums.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JEFF
Agent workspace manager — Go CLI + SDK built on gig.
Layout
JEFF/
├── jeff.go # Core types: AgentTool, IDE enums
├── config.go # LoadConfig, SaveConfig, ResolveHome, RepoConfig
├── repo.go # AddRepo, RemoveRepo, ListRepos, SetPostSetup
├── attrs.go # EnsureAttrs — define JEFF custom attributes in gig
├── crew/ # Multi-agent orchestration (SQLite + tmux)
├── embed/ # Embedded assets (CLAUDE.md template, claude-settings.json)
├── hooks/ # Hook system: registry, builtin hooks, claude/opencode delivery
├── memory/ # Persona memory + repo learnings management
├── persona/ # Embedded persona templates (dickson, eric, hardy, jenko, marlowe, schmidt)
├── skill/ # Skill registry, matching, and injection (symlinks into task dirs)
├── tui/ # Bubbletea dashboard (jeff dashboard)
├── workspace/ # Task workspace + worktree management + branch naming
├── cmd/jeff/ # CLI (cobra) — thin wrapper over SDK
├── docs/ # Guides (testing, adding commands, config reference)
└── *_test.go # Unit tests alongside sourceEach package has its own CLAUDE.md with contextual detail — auto-loaded when working in that area.
Build & Test
go build -o /tmp/jeff-dev ./cmd/jeff/ # local test build — throwaway path, invoke explicitly: /tmp/jeff-dev ...
go test ./...
go vet ./...⚠️ NEVER touch, repoint, or replace the live
jeffcommand, and never build a local dev build into it. Do NOTgo install,go build -o jeffinto PATH, symlink, alias,mv, or otherwise overwrite/shadow the installedjeffbinary or change whatjeffon PATH resolves to. The running orchestrator and every active crew worker depend on the installedjeff— swapping it out mid-session kills them (this has repeatedly caused workers to die). For local testing always build to a throwaway path (e.g./tmp/jeff-dev) and invoke that path explicitly; leave the systemjeffuntouched. Shipping a real change goes through the normal PR + release flow, not by repointing the local command.
Conventions
- SDK-first: All logic in root package + sub-packages. CLI is a thin cobra wrapper.
- gig is the brain: All task state in gig via SDK (
import "github.com/NeerajG03/gig"). Never shell out to gig CLI. - SQLite for crew only:
crew/uses SQLite (modernc.org/sqlite, no CGO) for session state. Everything else uses filesystem + gig. - Module path:
github.com/NeerajG03/JEFF— must match GitHub repo URL. - All public SDK functions return
(*Type, error)orerror. - Tests use
t.TempDir()for isolation. - No CGO dependencies.
- Task dirs are ephemeral — gig is the source of truth, not the filesystem.
JEFF_HOME
Resolved via: JEFF_HOME env var → ~/.config/jeff/home pointer → ~/.jeff/ default.
All of it lives in home.go. Read that file's header before touching anything
home-related — the rules below are load-bearing, and four shipped bugs came from
breaking them.
Two operations, never conflated
| Question | Who asks | May write the pointer? | |
| Selection | "where should a home live?" | jeff init, jeff home use — once | yes |
| Resolution | "where is my home?" | every other command, every run | never |
ResolveHome()/ResolveHomeWithSource()— resolution. Read-only by contract.SelectHomeForInit(SelectHomeOpts{...})— selection.--home→--here→ env → pointer → default.WriteHomePointer()— selection path only.
ResolveHomeWithSource also returns a HomeSource (flag/env/pointer/default).
Surface it in anything user-facing — jeff home and jeff doctor both print it. Every
bug here was hard to see because the provenance was invisible.
The three layers are three scopes, not three ways to do one thing
| Layer | Lifetime | Why it must exist |
$JEFF_HOME | one process / one tmux session | crew.Start does tmux set-environment JEFF_HOME so every pane inherits one home and workers can't drift onto a different jeff.db |
~/.config/jeff/home | per user, persistent | the install record — the only thing that knows a non-default home exists |
~/.jeff | bootstrap | the very first run, before any pointer |
Rules
- Never write the pointer from a read path. It used to "self-heal" on every
command, so one throwaway
JEFF_HOME=/tmp/x jeff statuspermanently repointed the pointer for every future shell — the most transient layer promoting itself to the most durable. Pinned byTestResolveHomeNeverWrites. - Never derive a home yourself. No
os.UserHomeDir()+".jeff", no secondResolveHome()inside a process that already hascfg.Home. A duplicate resolver drifts from the real one (jeff initdid, → #82;--globaldid, → #85). Insidecmd/jeff, prefercfg.Home;resolvedJeffHome()encodes that preference. - Store paths inside the home as home-relative via
internal/homepath—Relon write,Abson read. Absolute paths are what made the home non-relocatable (#84). Paths genuinely outside the home stay absolute; they aren't the home's to move. $JEFF_HOMEis not$HOME.identity.ProjectDirName(.jeff) is a per-directory marker like.git; the home is a different thing that merely defaults to~/.jeff.identity.GlobalFilePathIntakes the JEFF home.- Relocating a home is
mv+jeff home use <path>. Registries travel on their own;home userepairs leftovers and regenerates the per-agent settings, whose hook commands must be absolute to be executable.jeff doctorflags stored paths that escape the resolved home (home_paths_relative).
JEFF_HOME/
├── CLAUDE.md # agent instructions (editable, resettable)
├── jeff.json # config: agent, IDE, repos, hooks
├── .claude/ # Claude Code settings + hooks
├── .opencode/ # opencode settings
├── hooks/ # hook scripts (managed by jeff)
├── scripts/ # user scripts (branch naming, post-setup, etc.)
├── repos/ # registered codebases (git clones)
├── tasks/ # active task workspaces (ephemeral)
├── worktrees/ # centralized git worktrees (symlinked into tasks)
├── projects/ # project workspaces (jeff project init|open|list)
├── .skills/ # user-added skills (jeff skill add)
├── .personas/ # user-added persona templates
└── exports/ # generated artifactsTask workspaces vs worktrees — the cost asymmetry
worktrees/<repo>/<branch>/ ~200 MB–1 GB a full checkout
tasks/<slug>/ ~20 KB hook scripts, .claude/settings.json, symlinksA task dir is not just where a task's files live — it is the running session's
life support: its cwd, the hook SCRIPTS themselves, and the settings.json that
names those scripts by absolute path. jeff done used to RemoveAll it, which
killed every subsequent hook and Bash spawn in the invoking session (#94) — and
silently dropped the SessionEnd memory/transcript capture with it.
So the two are treated by cost, not symmetry:
jeff done | jeff cleanup | |
| worktree | removes it — this is the reclamation | removes orphans (clean; dirty needs --force) |
| task dir | retires it: drops dangling symlinks, writes .closed | collects it (no live worker, past --older-than) |
--purge on done restores the old delete-everything behavior.
Rules:
- Never delete a task dir on close. The fix works by construction — no cwd detection needed, and it holds however the task was closed, including from another terminal, which cwd inspection can never see.
- Anything presenting workspaces as current work must use
workspace.ListActive, notList— a directory existing no longer means the task is live. Same for the.closedcheck intaskWorkspaces(hook sync). - Creating a workspace un-retires it (
workspace.Create→Unretire). A closed task can be reopened and picked up into the very dir it was retired in; a stale marker would hide it fromstatus, skip its hook sync, and let the GC delete it under a live session. - The GC never guesses. It skips a workspace with a live anchored worker, a
non-terminal task, or one inside the grace period, and never discards a dirty
worktree without
--force. An unreachable gig store means "not terminal", so a store failure can never cause a deletion.
Matching paths — the house failure mode
Four separate defects here have had one shape: match a path coarsely, then mutate on the match. Three were caught only in review, none by tests. Assume the fifth is in whatever you are writing now.
| Matched | Then | Consequence | |
| #95 | script basename | rewrote the entry | silently rewrote a user's own hook |
| #96 | gig id anywhere in a path | deleted the worktree | could delete a live worktree for an open task |
| #106 | script basename, cross-event | deleted the block | deleted a user's hand-registered hook outright |
| gig-0459 | hotfix as a substring | renamed the branch | would misfire on 5 real branches in our own repos |
The rules, in order of how often they would have saved us:
- Match whole path segments, never substrings.
feature/CB-8888_workflow_status_hotfixis not a hotfix branch.worktrees/gig-app/jeff/gig-b222-xdoes not belong togig-app. Split on the separator and compare segments; if you find yourself reaching forstrings.Containson a path, stop. - Scope the match to the part you mean. A worktree path is
<worktrees>/<repo>/<branch...>; a task id lives in the branch portion, so match there and nowhere else (taskIDForWorktree). Rejecting a path that escapes the root matters too —filepath.Relwill happily hand you a../..walk that still matches. - Before mutating something you did not write, prove you own it.
isRepairableHookRefandisJeffOwnedCrossEventRefare the pattern: absolute path, under our layout, and carrying our marker (or demonstrably dangling). A live file someone else owns is never yours to rewrite or delete. - Prefer the failure direction that leaks over the one that loses. Under- deleting leaves garbage a later sweep collects; over-deleting destroys work. When the ownership test is uncertain, do nothing.
- Test the collision, not just the happy path. Every one of the four shipped with tests that passed, because the fixtures never contained a same-key different-owner case. Construct one deliberately: a foreign file sharing a basename, a repo named like a task id, a branch containing the keyword.
Config (jeff.json)
{
"$schema": "https://raw.githubusercontent.com/NeerajG03/JEFF/main/schemas/jeff-config.json",
"agent": "claude",
"ide": "cursor",
"gig_home": "",
"repos": {
"backend": {
"url": "https://github.com/org/backend.git",
"base_branch": "origin/develop",
"branch_name": "scripts/branch.sh",
"post_setup": "scripts/setup.sh"
}
},
"hooks": {
"gig-ready-tasks": false
}
}See docs/config.md for full reference.
Package Guides
Each package has a CLAUDE.md with types, file roles, and extension patterns:
| Package | Guide | What it covers |
crew/ | crew/CLAUDE.md | SQLite store, session lifecycle, tmux ops, message types |
hooks/ | hooks/CLAUDE.md | 16 built-in hooks, static vs dynamic scripts, delivery |
memory/ | memory/CLAUDE.md | Persona memory, repo learnings, /learn command |
persona/ | persona/CLAUDE.md | Embedded templates, model defaults, adding personas |
skill/ | skill/CLAUDE.md | Registry, matching logic, injection, embedded skills |
tui/ | tui/CLAUDE.md | Bubbletea dashboard, tabs, refresh, styles |
workspace/ | workspace/CLAUDE.md | Task dirs, worktrees, branch naming, .jeff-base |
cmd/jeff/ | cmd/jeff/CLAUDE.md | CLI conventions, key helpers, thin wrapper pattern |
What NOT to Do
- Don't store task state in JEFF — use gig SDK.
- Don't shell out to
gigCLI — useimport "github.com/NeerajG03/gig". - Don't hardcode JEFF_HOME paths — use
ResolveHome()(orcfg.Homeincmd/jeff). - Don't write the home pointer outside
jeff init/jeff home use— see JEFF_HOME above. - Don't persist absolute paths inside the home — use
internal/homepath. - Don't pass
$HOMEwhere a JEFF home is wanted — they are different things. - Don't delete a task workspace on close — retire it (see above); a live session lives there.
- Don't use
workspace.Listto show active work — useListActive. - Don't match a path with
strings.Contains— see "Matching paths" above. - Don't re-tag released versions — Go module proxy caches checksums.
Personas
Embedded in binary via persona/templates/. Used via --persona flag on pickup.
| Persona | Role |
| dickson | Orchestrator — plans, delegates, reviews. Does NOT write code. |
| eric | Researcher — explores, documents, recommends. Does NOT change code. |
| hardy | Reviewer — reviews diffs, checks quality, flags issues. |
| jenko | Implementer — writes code, runs tests, ships. Default persona. |
| marlowe | Memory curator — curates proposals into canonical memory. Used by jeff memory curate. |
| schmidt | Debugger — investigates, traces root causes, finds the fix. |
Further Reading
docs/config.md— full configuration reference (repos, hooks, branch naming, IDE)docs/testing.md— test infrastructure, existing test filesdocs/adding-commands.md— step-by-step guide for new CLI commands crew, memory may import the root package; the root package must never import them
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

