Repository navigation
app: --home is a home the person keeps: other tools' skills, program copies, fence - #2819
Merged
Merged
Conversation
…ills folder Login is now the one accessor for the person's real login home, where other programs keep their dot-folders. It answers the home that KeepLogin recorded in CODEAF_LOGIN_HOME when the state root was moved for the desktop app, CODEAF_HOME alone as before (a disposable run keeps its quarantine), and otherwise the login home the state root is resolved from. A recorded value a test binary was merely handed is not obeyed, and the value KeepLogin records goes through the same test-binary gate as the rest. skills.Options gains OwnHomeDir, so codeaf's own <dir>/.codeaf/skills can be read from the app's folder while every other root, the plugins and Codex's bundled skills are read from HomeDir. InputPaths follows it. With OwnHomeDir empty nothing changes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
`codeaf app --home <dir>` moved the state root and, with it, the login home the engine read other programs' skills from, so the app stopped seeing the skills kept for Claude Code, Codex and the rest. The flag is now applied by useAppHome, which sets CODEAF_HOME as before and also records the real login home (home.KeepLogin) in the environment, so the engine's child processes answer the same way. The record is restored when runApp returns. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The import pass and its change stamps, the hosted engine's folder list, the Claude Code plugin, the terminal picker and the app's skill list all call skills.Discover with the login home. Each now also passes home.OwnLogin of that home as OwnHomeDir, so under the desktop app's --home other programs' skills are read from the real home and codeaf's own from the app's folder, and the command line's ~/.codeaf/skills is not read. Everywhere else OwnLogin answers the home it was given and nothing changes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…skills Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…a folder of their own Program copies are git worktrees of the person's repositories. Under `codeaf app --home` home.Moved() is true, so they were made under the app's state folder, which the person keeps and backs up. A home the person keeps (home.Kept: the app's --home) now makes them in the account's cache folder, under a folder named for the state home, so no install makes or finishes another's. A home that only CODEAF_HOME moved keeps today's behaviour, copies inside it, and so does a test. The exclude lines codeaf adds for a copy's links live in the repository's one shared exclude file, so programCopiesOnDisk counts a worktree under any install's folder: with a folder per home an install would otherwise take the lines out from under another's live copy. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
main ran the legacy-folder adoption, the first witness of the state root and the crash-telemetry configuration before runApp parsed --home, so a WorkAF start read its telemetry consent from the command line's profile and could adopt the command line's legacy folder. useAppHomeEarly reads --home for `app` at the top of main, from the same flag set runApp uses (newAppFlags), and applies it with useAppHome. runApp still applies it, which is idempotent. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…hidden too The unattended fence hid only the secret files of home.Dir(). Under `codeaf app --home` that is the app's folder, so the command line's keys and sign-ins in the person's own ~/.codeaf were readable by the app's unattended runs. FenceOptions gains OtherCodeafHomes, and the fence names the person's default codeaf folder there when it is not the state home. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…scovery tests Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
AbirAbbas
added a commit
that referenced
this pull request
Nov 23, 2026
… (#2883) app/v3 was landed on dev on 2026-11-11. Five pull requests merged into app/v3 afterwards are now on dev, one commit each in this change: - connect: GitHub is a connector, and it is the Factory's GitHub (app/v3 #2645) - fix(app): connect independent custom providers and revalidate saves (app/v3 #2649) - app: --home is a home the person keeps: other tools' skills, program copies, fence (app/v3 #2819) - update: an engine inside a macOS app bundle is left to its app (app/v3 #2820) - update: a desktop app's engine is told to update the app, not to rebuild (app/v3 #2840) Co-authored-by: Santosh <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
The desktop app runs
codeaf app --home <dir>so its chats and settings stay apart from the command line's. That setsCODEAF_HOMEfor the whole process, andhome.Login()followsCODEAF_HOMEon purpose, so a disposable run or a test never imports a real person's skills. The side effect: under--homethe engine looked for<dir>/.claude/skills,<dir>/.codex/skills, the Claude plugins and the rest, and the person's real ones were no longer imported.Design
home.Login()is now THE accessor for the person's real login home. It answers, in order: the real home thathome.KeepLogin()recorded inCODEAF_LOGIN_HOME; elseCODEAF_HOMEalone (unchanged quarantine); else the login home the state root resolves from.runAppapplies--homethrough a smalluseAppHome: it setsCODEAF_HOMEas before and callshome.KeepLogin(). The record is put back whenrunAppreturns, so an in-process test of the app door cannot leave one behind.skills.OptionsgetsOwnHomeDir. Codeaf's own<dir>/.codeaf/skillsis read from it; every other root (.agents,.claude,.codex,.cursor,.gemini,.opencode,.goose,~/.config/{opencode,goose}, Claude plugins, Codex's bundled skills) is read fromHomeDir. Empty meansHomeDir, so nothing changes for any caller that does not set it.home.OwnLogin(dir)answers the app's folder whendiris the recorded real login home, anddiritself otherwise. Each of the six discovery callers passes it asOwnHomeDir.CODEAF_LOGIN_HOME. The app'sCODEAF_HOMEalready travels through the environment to the engine host and other children. Without the second variable a child would resolveLogin()to the app folder and miss the real skills again. It is registered as operator plumbing in the settings allowlist, since onlyrunAppwrites it.--homeis a persistent home of its own, not a disposable oneThe same root cause (every reader treating the state home as "the person's home") shows up in three more places, one commit each:
<state>/worktrees, inside the app's data folder. They now go to the OS cache folder, in a folder of their own per state home (<cache>/codeaf/worktrees/<name>-<12 hex of a hash of the state root>), so two installs never share a folder. A disposable home (a test or aCODEAF_HOME-only run) keeps its copies inside it, and an install without--homekeeps its current place. Nothing deletes another install's live copies: the program copy cleanup only removes what its own state recorded. The repo's exclude file is shared by all installs, soprogramCopiesOnDisknow counts copies in the shared cache parent too, and one install finishing does not drop the exclude lines another install's copies still need.--homebefore the state root is read (R10).mainnow applies--homefirst, beforeAdopt,Witnessand telemetry read the state root, so those no longer act on the command line's~/.codeaffor an app run. The pre-parse uses the same flag declarations asrunApp(onenewAppFlags), so the two cannot drift, and it only reacts toapp. Other commands leave the environment alone.home.DefaultUnder(<login home>)) holds secrets too, and they were reachable. The fence now takesOtherCodeafHomesand hides them as well (skipped when it equals the state home).Also pinned by tests: the canvas shelf the desk installs lives at exactly
<state>/.codeaf/skills/workaf-canvas/SKILL.mdand is found there, and<state>/skills/...is not read. Claude Code plugin discovery follows the login home.Validation contract
app --home X, skills of the other harnesses (and plugins, Codex system skills) are read from the real login home.app --home X, codeaf's own skills folder isX/.codeaf/skills; the command line's~/.codeaf/skillsis neither read nor written. State, sessions, logs, sockets and profile stay where--homeputs them.--home, behaviour is unchanged.CODEAF_HOMEkeeps the quarantine. In a test binary, the recorded real home goes through the same gate asDir()/Login(): with no pinnedHOMEit records the quarantine, and aCODEAF_LOGIN_HOMEthe test process was merely handed is not obeyed.--homeis in effect beforeAdopt,Witnessand telemetry read the state root.Tests
Each maps to a contract item above:
internal/home(H11, H12),internal/skills(own_home_test.go: own-folder moved, unchanged without it, project scope, folded into the login home,InputPaths),internal/resident(import under app home, only-CODEAF_HOMEquarantine, nothing moved),internal/remote(hosted folder list),internal/claudeagent(Claude Code plugin),cmd/codeaf(useAppHome, the early pre-parse, the fence's other home),internal/session(program copy folder per home, shared exclude),internal/executor(fence hides another home's secrets). They use temp dirs and setHOME/CODEAF_HOME/CODEAF_LOGIN_HOMEexplicitly.Notes for reviewers
Discoverstill folds the home into the project as before (the project scope there reads<home>/.codeaf/skills, which is the project's own root by the existing rule) and reads the app's own folder once as a user root.home.Login()rather thanos.UserHomeDir().CODEAF_LOGIN_HOME).🤖 Generated with Claude Code