Workspace Structure
When you run logic64 pull <bundle-id>, the CLI does more than unzip a file. It reads manifest.json inside the bundle, then routes each artifact to its exact destination — your workspace or your project root — using safe-merge semantics that never silently destroy existing data.
This page is a complete map of every file that lands on your machine, what each file contains, and exactly how conflicts are resolved.
What gets pulled
A bundle is written into your workspace (the directory where you ran the pull command), including a safe-merged .claude/mcp.json for MCP servers. Here is the full artifact list:
- Thin agent adapters —
CLAUDE.md,AGENTS.md,GEMINI.md— that route your assistant intodocs/okf/, written to project root docs/okf/— the OKF knowledge tree (architecture, rules, decisions, context): the single source of truth, written to your workspace.env— environment variable template; skipped if a.envalready exists- A minimal scaffold — config, boilerplate, and directories aligned to your locked stack
manifest.json— the bundle routing manifest; kept in project root for reference and repackageresolution_log.json— written by the CLI after pull; records every file written and every conflict resolved.claude/mcp.json— MCP server config written to your workspace and safe-merged; global merge is opt-in, never silent
my-saas-app/ ← your project root (cwd at pull time)├── docs/│ └── okf/ ← OKF knowledge tree — single source of truth│ ├── protocol.md ← reading protocol every assistant follows│ ├── index.md ← knowledge tree index│ ├── manifest.json ← knowledge inventory (versions, hashes)│ ├── architecture/ ← system.md + one file per locked layer│ ├── rules/ ← coding.md · architecture.md (· security.md)│ ├── decisions/ ← adr-001.md … (one ADR per locked decision)│ └── context/project.md├── .claude/│ ├── mcp.json ← MCP servers (workspace-local, safe-merge)│ └── agents/ ← subagent adapters├── CLAUDE.md ← Claude Code adapter → routes into docs/okf/├── AGENTS.md ← AGENTS.md adapter (Codex / OpenCode)├── GEMINI.md ← Gemini CLI adapter├── tasks.md ← Build Execution Contract├── .env ← environment template (skip_if_exists)├── manifest.json ← bundle routing manifest (kept for reference)└── resolution_log.json ← full record of every change made
Files written to your project root
The project root is the current working directory at the time you run logic64 pull. All source code, governance files, and reference artifacts land here.
CLAUDE.md
The behavioral rules file for your AI coding assistant. Written verbatim from the bundle. Merge strategy: overwrite — Logic64 always delivers the latest version of this file for the generated workspace.
memory.md
Project context, locked architectural decisions, and their rationale. Written verbatim. Merge strategy: overwrite.
.env template
An environment variable template populated with placeholder values from the bundle's env_vars map. Merge strategy: skip_if_exists — Logic64 never overwrites an existing .env without a diff. See the .env handling section below.
Source code and directories
All generated source files — directories, boilerplate, framework configs, and any custom files produced during generation. The directory tree mirrors the architecture plan you approved in Studio.
manifest.json
The routing manifest the CLI consumed during pull. Kept in the project root for transparency and to support future repackage operations. Do not edit this file manually.
resolution_log.json
Written by the CLI after every successful pull. Contains a complete record of every file written, every config merge, every port conflict resolved, and every backup created. See the resolution_log.json section for the full schema.
Files merged into global config
MCP server entries and assistant-level settings are merged into your global assistant config file rather than written as standalone files. The currently supported target is Claude Code CLI.
| Component | Destination |
|---|---|
| OKF knowledge tree | docs/okf/ in your workspace |
| Agent adapters | CLAUDE.md · AGENTS.md · GEMINI.md in project root |
| MCP server config | .claude/mcp.json — workspace, safe-merge |
| .env files | Project root — skip_if_exists |
The global config file path is resolved per platform:
- macOS / Linux:
~/.config/claude-code/config.json - Windows:
%APPDATA%\claude-code\config.json
If the target directory does not exist, the CLI creates it before writing. If no config file is found at the canonical path, the CLI creates a new one and logs a warning in resolution_log.json.
manifest.json
manifest.json is generated by Logic64 and included inside bundle.zip. The CLI rejects any bundle with a missing or malformed manifest. It is the authoritative routing instruction set for a pull.
Key fields:
version— manifest schema version; currently"3.0"(manifest_versionis kept as a legacy alias)bundle_id— UUID uniquely identifying this bundletarget_assistant— the assistant this bundle targets; currently always"claude"files[]— ordered list of routing instructions. Each entry has apath, adestination_type(workspace_root,project_root,env_file,global_config) and amerge_strategy(overwrite,safe_merge_json,skip_if_exists,append).claude/mcp.json— MCP servers are delivered as an ordinaryfiles[]entry routed toworkspace_rootand safe-merged; the legacymcp_servers[]array is still accepted for older bundlesenv_vars— key-value map of placeholder environment variable values written into the.envtemplate
{"version": "3.0","bundle_id": "a3f2bc89-4d1e-47a0-b8c6-2e5f91340abc","project_name": "my-saas-app","generated_at": "2025-05-14T10:32:00Z","target_assistant": "claude","files": [{"path": "docs/okf/architecture/system.md","destination_type": "workspace_root","merge_strategy": "overwrite"},{"path": "CLAUDE.md","destination_type": "project_root","merge_strategy": "overwrite"},{"path": "tasks.md","destination_type": "project_root","merge_strategy": "overwrite"},{"path": ".claude/mcp.json","destination_type": "workspace_root","merge_strategy": "safe_merge_json"},{"path": ".env.template","destination_type": "env_file","merge_strategy": "skip_if_exists"}],"env_vars": {"PORT": "3000","DB_URL": "placeholder"}}
The destination_type values in manifest.json are abstract identifiers — the CLI resolves them to platform-specific absolute paths at runtime using os.homedir() and process.env.APPDATA.
resolution_log.json
After every logic64 pull, the CLI writes resolution_log.json to your project root. This is your audit trail — every file written, every config entry merged, every conflict auto-resolved, and every backup created is recorded here. There are no silent modifications.
You can review this file any time to understand exactly what Logic64 changed on your machine, and use it as input for logic64 rollback <bundle-id> to undo the pull.
{"pulled_at": "2025-05-14T10:33:12Z","bundle_id": "a3f2bc89-4d1e-47a0-b8c6-2e5f91340abc","resolutions": [{"type": "mcp_name_update","server_name": "logic64-db","config_file": ".claude/mcp.json","action": "updated existing entry"},{"type": "config_backup","original_file": ".claude/mcp.json","backup_file": ".claude/mcp.json.logic64.backup"}],"files_written": [{ "destination": "docs/okf/architecture/system.md", "strategy": "overwrite" },{ "destination": "CLAUDE.md", "strategy": "overwrite" },{ "destination": "tasks.md", "strategy": "overwrite" },{ "destination": ".claude/mcp.json", "strategy": "safe_merge_json" }],"warnings": []}
resolutions[]— one entry per auto-resolved conflict or backup operation (port conflicts, name updates, config backups)files_written[]— full list of every file the CLI wrote or merged, with its merge strategywarnings[]— non-fatal issues (e.g., config not found at canonical path, fallback path used)
Adapters and the OKF knowledge tree
The governance layer has two parts: thin agent adapters at your project root, and the docs/okf/ knowledge tree in your workspace — both written with an overwrite merge strategy — Logic64 always delivers the authoritative version for the generated workspace.
- CLAUDE.md · AGENTS.md · GEMINI.md — thin adapters for your AI coding assistant: a short constitution that routes it into
docs/okf/and thetasks.mdcontract. They carry no knowledge of their own — the source of truth lives in the tree. - docs/okf/ — the knowledge tree: architecture, rules, decisions (ADRs), and
context/project.md. Your assistant reads this to understand what was decided and why — preventing it from reinventing choices already locked during the plan phase.
These files are standard Markdown. You may edit them after pulling — they are committed to your project's version control like any other source file. Logic64 will overwrite them again only on the next pull.
MCP server configs
Model Context Protocol servers are written to a single .claude/mcp.json in your workspace and safe-merged there — never a global file. The merge is always atomic and non-destructive.
The safe-merge sequence for .claude/mcp.json:
- Parse the existing config file
- Locate the
mcpServersobject (keyed by server name) - If a server with the same
namealready exists — update its path and port only (this is intentional: same name means the user is updating an existing server) - If no server with that name exists — append the new server object
- Write back to disk atomically (write to a temporary file, then rename)
The write is always atomic: the CLI writes to a .tmp file first, then renames it over the target. If anything fails mid-write, the original config is left intact and the error is reported — your existing servers are never left in a partial state.
The CLI backs up .claude/mcp.json before any merge operation. If the merge fails or you want to undo it, run logic64 rollback <bundle-id> to restore the pre-pull state. See Backups and rollback.
.env handling
Logic64 never overwrites an existing .env file. The merge strategy for the environment template is always skip_if_exists.
- If no
.envexists in the project root — the CLI writes the template with placeholder values from the bundle'senv_varsmap - If a
.envalready exists — the CLI skips the write entirely and logs a warning inresolution_log.json. Your existing secrets are never touched.
The template contains only placeholder values (e.g., DB_URL=placeholder). It is designed to be committed to version control as a reference for required environment variables. Fill in real values locally and never commit the populated file.
Backups and rollback
Before the CLI modifies any global config file (files outside your project root), it creates an automatic backup. This gives you a safe rollback path for every pull.
Backup filename pattern: {filename}.logic64.backup
Example: ~/.config/claude-code/config.json is backed up to ~/.config/claude-code/config.json.logic64.backup in the same directory.
- The backup is created before any merge operation begins — if the merge fails, the original is intact
- Only the most recent pre-pull state is preserved. If a
.logic64.backupalready exists from a previous pull, it is overwritten - The backup path is recorded in
resolution_log.jsonunder aglobal_config_backupentry
To restore your machine to the state before a pull:
$ logic64 rollback a3f2bc89-4d1e-47a0-b8c6-2e5f91340abc# ✓ Restored ~/.config/claude-code/config.json from backup# ✓ Removed 6 files written to project root# ✓ rollback_log.json written
- Rollback reads
resolution_log.jsonfor the given bundle ID - For each
global_config_backupentry: the backup file is restored over the current config - For each file written to
project_root: the file is deleted (project files are recoverable via version control) - Rollback writes a
rollback_log.jsonrecording all restored and removed files - Rollback does not perform any git operations
Port and name conflicts
The CLI auto-resolves two classes of conflicts that arise when merging MCP server entries into an existing global config. Both types are logged in resolution_log.json.
Port conflicts
If the port declared in manifest.json for an MCP server is already in use on the local machine, the CLI auto-increments the port by 1 and retries. It repeats this up to 10 times. If all 10 candidate ports are occupied, the pull fails with a clear error message identifying the conflicting port range.
The resolved port is written into the config entry and recorded in resolution_log.json as a port_conflict entry with both original_port and resolved_port fields.
Name conflicts
If an MCP server with the same name already exists in your global config, the CLI updates the existing entry's path and port rather than creating a duplicate. This is intentional: same name means you are updating a server, not adding one.
The update is recorded in resolution_log.json as an mcp_name_update entry.
Next steps
Now that you understand the full file layout and merge semantics, explore the API that drives bundle delivery, the Studio validation layer, or the complete CLI command reference.