| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 3 | 10 | 4 | 18% |
| Commands | 1 | 5 | 0 | 17% |
| Section tags | 2 | 3 | 0 | 40% |
What each file covers
Sections
3 shared · 10 only in A · 4 only in B- − Book Dragon — Claude Code Instructions
- − Claude-specific tool conventions
- − Shell tools
- − Permission prompt handling
- − LOG.md writes
- − Background scheduler (step 6f) - conditional on surface
- − Session maintenance (step 6e)
- − First-run setup (step 6)
- − Project memory — Claude-specific
- − Line-count threshold
- + Book Dragon — Gemini CLI Instructions
- + Gemini-specific tool conventions
- + Shell commands
- + Configuration
- CRITICAL — Rule compliance
- AI self-identification
- File operations
Commands
1 shared · 5 only in A · 0 only in B- − python --version
- − python workflows/session-search/scripts/scheduler.py --status
- − python workflows/session-search/scripts/scheduler.py &
- − python workflows/settings-check/scripts/run.py
- − python <absolute-path-to-project>/workflows/session-search/scripts/index.py
- python script.py
Section tags
2 shared · 3 only in A · 0 only in B- − setup
- − performance
- − do-not
- code-style
- agent-behaviour
Line diff
ChrisMuster/AI-OS · CLAUDE.md
@@ −1 @@
1# Book Dragon — Claude Code Instructions
2
3@AGENTS.md
4
5**Last updated:** 2026-06-28
6
7## CRITICAL — Rule compliance
8
@@ −10 @@
10- Use only the tools and path formats prescribed in this file and in `AGENTS.md`.
11- Do not use alternative tools, commands, or approaches because they seem equivalent.
12- If a rule specifies a particular method, that is the only acceptable choice — not a suggestion.
13- Use relative paths in all Bash commands. Never prepend the absolute project path.
14- Use dedicated file tools (Read, Edit, Glob, Grep) instead of Bash equivalents (cat, sed, find, grep).
15
16The universal rules for this project are defined in `AGENTS.md`. Claude reads both files. This file contains only Claude-specific additions: tool conventions, session maintenance tasks, and configuration guidance. It applies to all Claude products (Claude Code, Claude Cowork, and any future Claude interfaces that read this file).
17
18## AI self-identification
19
20For step 6a of session startup (`AGENTS.md`), identify which Claude product you are running as:
21
22- If running as Claude Code, output: `AI_IDENTITY: Claude Code`
23- If running as Claude Cowork, output: `AI_IDENTITY: Claude Cowork`
24
25This is used by session-search indexing to tag sessions by AI and by setup verification to check the correct environment.
26
27## Claude-specific tool conventions
28
29### Shell tools
30
31Book Dragon uses two shell tools in Claude Code: Bash and PowerShell. The rule for which to use is absolute — no discretion, no exceptions.
32
33**Bash — use for all of the following, on every operating system including Windows:**
34- Python execution: `python --version`, `py --version`, `python script.py`
35- Timestamps: `date +"%Y-%m-%dT%H:%M:%S%:z"`
36- Any cross-platform or POSIX-compatible operation
37
38**PowerShell — use only when the operation has no Bash equivalent on Windows:**
39- Windows registry access (`HKLM:\...`, `HKCU:\...`)
40- Windows-specific system management with no POSIX equivalent
41
42If PowerShell is genuinely required for a task, add the specific `PowerShell(command)` pattern to the allowlist in `.claude/settings.json`. Never add PowerShell entries as a workaround for Python execution or timestamps — those belong in Bash without exception.
43
44**Path format in Bash:** Always use forward slashes in Bash commands, script paths, allowlist entries, and configuration files. Never use backslashes in these contexts. Backslashes belong in PowerShell and Windows file explorer only.
45
46**Allowlist enforcement:** The allowlist in `.claude/settings.json` uses `Bash(...)` patterns. A PowerShell call to the same command is a different namespace — it will not match and will trigger a permission prompt. This is intentional: the allowlist is the enforcement mechanism, and using the wrong tool defeats it.
47
48### File operations
49
50These are the Claude Code tools that map to the abstract tool references in AGENTS.md:
51
52- **Check file/directory existence:** Glob tool
53- **Search file contents:** Grep tool
54- **Read files:** Read tool
55- **Modify existing files:** Edit tool (preferred — sends only the diff)
56- **Create new files:** Write tool
57- **List directory contents:** Glob tool
58- **Run shell commands:** Bash tool (default) or PowerShell tool (see shell rules above)
59
60### Permission prompt handling
61
62A permission prompt is a rule enforcement signal, not friction to push through. If a command triggers a permission prompt, stop immediately. Do not ask the user to approve it. Instead, treat it as evidence that you are about to break a rule, and investigate before continuing.
63
64Check in this order:
651. Did you use Bash for an operation that has a dedicated tool (Read, Edit, Glob, Grep)? The Read tool handles PDFs natively — never use pypdf or other libraries via Bash to read files.
662. Did you use an absolute path (should be relative)?
673. Does the command match an existing allowlist pattern in `.claude/settings.json`?
68
69If a rule-compliant alternative exists, switch to it silently. Only escalate to the user if you have checked all three points and genuinely cannot find a compliant alternative. The default assumption is that the permission prompt is correct and your approach is wrong — not the other way around.
70
71### LOG.md writes
72
73When writing log entries (per the LOG.md rules in AGENTS.md), always use the Edit tool to append. Never use Bash (`cat >>` or similar) — the Edit tool is always permitted without a permission prompt and is the correct tool for file modification in Claude Code.
74
75## Background scheduler (step 6f) - conditional on surface
76
77Whether Claude runs the background scheduler depends on the surface, detected by tool availability (the `mcp__scheduled-tasks__*` tools):
78
79- **On Claude Desktop**, where the scheduled-task tools are exposed, Claude relies on the MCP scheduled task (`session-search-archive`) for hourly session-search maintenance and **skips** step 6f - no background process is needed.
80- **On the Claude Code CLI or IDE extension**, where those tools are not exposed, Claude **runs** step 6f: check `python workflows/session-search/scripts/scheduler.py --status`, and if it is not already running, start it detached (`python workflows/session-search/scripts/scheduler.py &`). This is what keeps the hourly index running on a surface that has no scheduled task.
81
82`scheduler.py` is safe to start every session: it is single-instance (PID-file guarded, so it cannot stack up across sessions), it auto-terminates after 4 hours of inactivity, and it cleans up its own PID file on exit. Steps 6e and 6f are complementary - exactly one of the two mechanisms (scheduled task or background scheduler) runs on any given surface, never both.
83
84## Session maintenance (step 6e)
85
86For step 6e of session startup (AI-specific maintenance), perform the following silently if `workflows/session-search/scripts/index.py` exists:
87
88a. **Hourly session-search maintenance** - Book Dragon keeps the session-search index current on an hourly cadence using whichever mechanism the current surface supports. The scheduled-task tooling is only available on Claude Desktop, so detect by tool availability: are the `mcp__scheduled-tasks__*` tools (e.g. `list_scheduled_tasks` / `create_scheduled_task`) exposed in this session?
89 - **If they are exposed (Claude Desktop):** call `list_scheduled_tasks` and check whether `session-search-archive` exists on this machine. If it does not, create it with the same parameters as first-run step 6 (using forward slashes in the path). Tell the user in a single sentence that it has been set up. If it exists but still runs `archive.py`, update or recreate it so it runs `index.py` instead.
90 - **If they are not exposed (Claude Code CLI or IDE extension):** this is expected, not a failure - do not attempt the scheduled-task tools. Instead run step 6f (the background scheduler) so the hourly index is covered on this surface. Tell the user in a single INFO sentence that the scheduled task is unavailable off Claude Desktop and the background scheduler is handling hourly session-search maintenance instead.
91
92b. **Settings coverage check** — run `python workflows/settings-check/scripts/run.py` silently. Do not report results unless there are FAIL findings. If failures are found, tell the user in a single sentence after greeting them: "Settings coverage check found uncovered commands — [list]. These will prompt for permission when they fire."
93
94## First-run setup (step 6)
95
96For step 6 of first-run initialisation (AI-specific first-run setup), set up hourly session-search maintenance if `workflows/session-search/` exists. Use whichever mechanism the current surface supports, detected by whether the `mcp__scheduled-tasks__*` tools are exposed:
97
98**If the scheduled-task tools are exposed (Claude Desktop):**
99
100a. Call `list_scheduled_tasks` to check whether a task with id `session-search-archive` already exists on this machine.
101
102b. If it does not exist, call `create_scheduled_task` with taskId `session-search-archive`, description `Hourly session-search index update — captures and indexes any new or updated Book Dragon sessions`, cronExpression `0 * * * *`, notifyOnCompletion `false`, and a prompt that runs `python <absolute-path-to-project>/workflows/session-search/scripts/index.py` (substituting the real absolute path to the project root on this machine, using **forward slashes** — e.g. `C:/Users/Name/Desktop/AI-Work/AI-OS` — so that the path matches the `settings.json` allowlist pattern `Bash(python *workflows/session-search/scripts/index.py*)`). Quote the path only if it contains spaces. This script is idempotent and safe to re-run; it should not notify on normal completion.
103
104c. Note briefly to the user that the session search scheduled task has been created. If the task already exists, skip this step silently.
105
106**If the scheduled-task tools are not exposed (Claude Code CLI or IDE extension):**
107
108d. Do not attempt the scheduled-task tools. Hourly maintenance on this surface is handled by the background scheduler (step 6f) instead, so there is nothing to create here. Note briefly to the user that, off Claude Desktop, the background scheduler covers hourly session-search maintenance.
109
110## Project memory — Claude-specific
111
112The canonical memory location is `memory/` at the project root (as defined in AGENTS.md). This overrides the default per-user Claude cache (`~/.claude/projects/.../memory/`). Memory written to the project-scoped location syncs with the project and is available on any machine. Memory written to the per-user cache is local only and should be treated as stale if it conflicts with what is in `memory/`.
113
114## Line-count threshold
115
116The audit script checks `AGENTS.md` against a line-count threshold of 600 lines (see AGENTS.md general guidelines). This is where the bulk of the rules live; CLAUDE.md is a thin wrapper and is not checked separately.
117
ChrisMuster/AI-OS · GEMINI.md
@@ +1 @@
1# Book Dragon — Gemini CLI Instructions
2
3@AGENTS.md
4
5**Last updated:** 2026-06-11
6
7## CRITICAL — Rule compliance
8
@@ +10 @@
10- Use only the tools and path formats prescribed in this file and in `AGENTS.md`.
11- Do not use alternative tools, commands, or approaches because they seem equivalent.
12- If a rule specifies a particular method, that is the only acceptable choice — not a suggestion.
13
14The universal rules for this project are defined in `AGENTS.md`. Gemini CLI reads both files via the `@AGENTS.md` import above. This file contains only Gemini-specific additions.
15
16## AI self-identification
17
18For step 6a of session startup (`AGENTS.md`), output: `AI_IDENTITY: Gemini CLI`
19
20## Gemini-specific tool conventions
21
22### Shell commands
23
24Use the terminal for all shell operations. Prefer Bash syntax for cross-platform compatibility:
25- Python execution: `python script.py`
26- Timestamps: `date +"%Y-%m-%dT%H:%M:%S%:z"`
27
28### File operations
29
30These map the abstract tool references in AGENTS.md to Gemini CLI's capabilities:
31
32- **Check file/directory existence:** Use shell commands (`test -f`, `ls`).
33- **Search file contents:** Use shell commands (`grep`, `rg`).
34- **Read files:** Read files directly via your file reading capability.
35- **Modify existing files:** Edit files directly.
36- **Create new files:** Write files directly.
37- **Run shell commands:** Use the integrated terminal.
38
39## Configuration
40
41Gemini CLI configuration for this project lives in `.gemini/settings.json`. This includes context file settings and MCP server registration. See `AGENT-SETUP.md` for full setup instructions.
42
@@ −1 +1 @@
1−# Book Dragon — Claude Code Instructions
1+# Book Dragon — Gemini CLI Instructions
22
33 @AGENTS.md
44
5−**Last updated:** 2026-06-28
5+**Last updated:** 2026-06-11
66
77 ## CRITICAL — Rule compliance
88
@@ −10 +10 @@
1010 - Use only the tools and path formats prescribed in this file and in `AGENTS.md`.
1111 - Do not use alternative tools, commands, or approaches because they seem equivalent.
1212 - If a rule specifies a particular method, that is the only acceptable choice — not a suggestion.
13−- Use relative paths in all Bash commands. Never prepend the absolute project path.
14−- Use dedicated file tools (Read, Edit, Glob, Grep) instead of Bash equivalents (cat, sed, find, grep).
1513
16−The universal rules for this project are defined in `AGENTS.md`. Claude reads both files. This file contains only Claude-specific additions: tool conventions, session maintenance tasks, and configuration guidance. It applies to all Claude products (Claude Code, Claude Cowork, and any future Claude interfaces that read this file).
14+The universal rules for this project are defined in `AGENTS.md`. Gemini CLI reads both files via the `@AGENTS.md` import above. This file contains only Gemini-specific additions.
1715
1816 ## AI self-identification
1917
20−For step 6a of session startup (`AGENTS.md`), identify which Claude product you are running as:
18+For step 6a of session startup (`AGENTS.md`), output: `AI_IDENTITY: Gemini CLI`
2119
22−- If running as Claude Code, output: `AI_IDENTITY: Claude Code`
23−- If running as Claude Cowork, output: `AI_IDENTITY: Claude Cowork`
20+## Gemini-specific tool conventions
2421
25−This is used by session-search indexing to tag sessions by AI and by setup verification to check the correct environment.
22+### Shell commands
2623
27−## Claude-specific tool conventions
28−
29−### Shell tools
30−
31−Book Dragon uses two shell tools in Claude Code: Bash and PowerShell. The rule for which to use is absolute — no discretion, no exceptions.
32−
33−**Bash — use for all of the following, on every operating system including Windows:**
34−- Python execution: `python --version`, `py --version`, `python script.py`
24+Use the terminal for all shell operations. Prefer Bash syntax for cross-platform compatibility:
25+- Python execution: `python script.py`
3526 - Timestamps: `date +"%Y-%m-%dT%H:%M:%S%:z"`
36−- Any cross-platform or POSIX-compatible operation
3727
38−**PowerShell — use only when the operation has no Bash equivalent on Windows:**
39−- Windows registry access (`HKLM:\...`, `HKCU:\...`)
40−- Windows-specific system management with no POSIX equivalent
41−
42−If PowerShell is genuinely required for a task, add the specific `PowerShell(command)` pattern to the allowlist in `.claude/settings.json`. Never add PowerShell entries as a workaround for Python execution or timestamps — those belong in Bash without exception.
43−
44−**Path format in Bash:** Always use forward slashes in Bash commands, script paths, allowlist entries, and configuration files. Never use backslashes in these contexts. Backslashes belong in PowerShell and Windows file explorer only.
45−
46−**Allowlist enforcement:** The allowlist in `.claude/settings.json` uses `Bash(...)` patterns. A PowerShell call to the same command is a different namespace — it will not match and will trigger a permission prompt. This is intentional: the allowlist is the enforcement mechanism, and using the wrong tool defeats it.
47−
4828 ### File operations
4929
50−These are the Claude Code tools that map to the abstract tool references in AGENTS.md:
30+These map the abstract tool references in AGENTS.md to Gemini CLI's capabilities:
5131
52−- **Check file/directory existence:** Glob tool
53−- **Search file contents:** Grep tool
54−- **Read files:** Read tool
55−- **Modify existing files:** Edit tool (preferred — sends only the diff)
56−- **Create new files:** Write tool
57−- **List directory contents:** Glob tool
58−- **Run shell commands:** Bash tool (default) or PowerShell tool (see shell rules above)
32+- **Check file/directory existence:** Use shell commands (`test -f`, `ls`).
33+- **Search file contents:** Use shell commands (`grep`, `rg`).
34+- **Read files:** Read files directly via your file reading capability.
35+- **Modify existing files:** Edit files directly.
36+- **Create new files:** Write files directly.
37+- **Run shell commands:** Use the integrated terminal.
5938
60−### Permission prompt handling
39+## Configuration
6140
62−A permission prompt is a rule enforcement signal, not friction to push through. If a command triggers a permission prompt, stop immediately. Do not ask the user to approve it. Instead, treat it as evidence that you are about to break a rule, and investigate before continuing.
63−
64−Check in this order:
65−1. Did you use Bash for an operation that has a dedicated tool (Read, Edit, Glob, Grep)? The Read tool handles PDFs natively — never use pypdf or other libraries via Bash to read files.
66−2. Did you use an absolute path (should be relative)?
67−3. Does the command match an existing allowlist pattern in `.claude/settings.json`?
68−
69−If a rule-compliant alternative exists, switch to it silently. Only escalate to the user if you have checked all three points and genuinely cannot find a compliant alternative. The default assumption is that the permission prompt is correct and your approach is wrong — not the other way around.
70−
71−### LOG.md writes
72−
73−When writing log entries (per the LOG.md rules in AGENTS.md), always use the Edit tool to append. Never use Bash (`cat >>` or similar) — the Edit tool is always permitted without a permission prompt and is the correct tool for file modification in Claude Code.
74−
75−## Background scheduler (step 6f) - conditional on surface
76−
77−Whether Claude runs the background scheduler depends on the surface, detected by tool availability (the `mcp__scheduled-tasks__*` tools):
78−
79−- **On Claude Desktop**, where the scheduled-task tools are exposed, Claude relies on the MCP scheduled task (`session-search-archive`) for hourly session-search maintenance and **skips** step 6f - no background process is needed.
80−- **On the Claude Code CLI or IDE extension**, where those tools are not exposed, Claude **runs** step 6f: check `python workflows/session-search/scripts/scheduler.py --status`, and if it is not already running, start it detached (`python workflows/session-search/scripts/scheduler.py &`). This is what keeps the hourly index running on a surface that has no scheduled task.
81−
82−`scheduler.py` is safe to start every session: it is single-instance (PID-file guarded, so it cannot stack up across sessions), it auto-terminates after 4 hours of inactivity, and it cleans up its own PID file on exit. Steps 6e and 6f are complementary - exactly one of the two mechanisms (scheduled task or background scheduler) runs on any given surface, never both.
83−
84−## Session maintenance (step 6e)
85−
86−For step 6e of session startup (AI-specific maintenance), perform the following silently if `workflows/session-search/scripts/index.py` exists:
87−
88−a. **Hourly session-search maintenance** - Book Dragon keeps the session-search index current on an hourly cadence using whichever mechanism the current surface supports. The scheduled-task tooling is only available on Claude Desktop, so detect by tool availability: are the `mcp__scheduled-tasks__*` tools (e.g. `list_scheduled_tasks` / `create_scheduled_task`) exposed in this session?
89− - **If they are exposed (Claude Desktop):** call `list_scheduled_tasks` and check whether `session-search-archive` exists on this machine. If it does not, create it with the same parameters as first-run step 6 (using forward slashes in the path). Tell the user in a single sentence that it has been set up. If it exists but still runs `archive.py`, update or recreate it so it runs `index.py` instead.
90− - **If they are not exposed (Claude Code CLI or IDE extension):** this is expected, not a failure - do not attempt the scheduled-task tools. Instead run step 6f (the background scheduler) so the hourly index is covered on this surface. Tell the user in a single INFO sentence that the scheduled task is unavailable off Claude Desktop and the background scheduler is handling hourly session-search maintenance instead.
91−
92−b. **Settings coverage check** — run `python workflows/settings-check/scripts/run.py` silently. Do not report results unless there are FAIL findings. If failures are found, tell the user in a single sentence after greeting them: "Settings coverage check found uncovered commands — [list]. These will prompt for permission when they fire."
93−
94−## First-run setup (step 6)
95−
96−For step 6 of first-run initialisation (AI-specific first-run setup), set up hourly session-search maintenance if `workflows/session-search/` exists. Use whichever mechanism the current surface supports, detected by whether the `mcp__scheduled-tasks__*` tools are exposed:
97−
98−**If the scheduled-task tools are exposed (Claude Desktop):**
99−
100−a. Call `list_scheduled_tasks` to check whether a task with id `session-search-archive` already exists on this machine.
101−
102−b. If it does not exist, call `create_scheduled_task` with taskId `session-search-archive`, description `Hourly session-search index update — captures and indexes any new or updated Book Dragon sessions`, cronExpression `0 * * * *`, notifyOnCompletion `false`, and a prompt that runs `python <absolute-path-to-project>/workflows/session-search/scripts/index.py` (substituting the real absolute path to the project root on this machine, using **forward slashes** — e.g. `C:/Users/Name/Desktop/AI-Work/AI-OS` — so that the path matches the `settings.json` allowlist pattern `Bash(python *workflows/session-search/scripts/index.py*)`). Quote the path only if it contains spaces. This script is idempotent and safe to re-run; it should not notify on normal completion.
103−
104−c. Note briefly to the user that the session search scheduled task has been created. If the task already exists, skip this step silently.
105−
106−**If the scheduled-task tools are not exposed (Claude Code CLI or IDE extension):**
107−
108−d. Do not attempt the scheduled-task tools. Hourly maintenance on this surface is handled by the background scheduler (step 6f) instead, so there is nothing to create here. Note briefly to the user that, off Claude Desktop, the background scheduler covers hourly session-search maintenance.
109−
110−## Project memory — Claude-specific
111−
112−The canonical memory location is `memory/` at the project root (as defined in AGENTS.md). This overrides the default per-user Claude cache (`~/.claude/projects/.../memory/`). Memory written to the project-scoped location syncs with the project and is available on any machine. Memory written to the per-user cache is local only and should be treated as stale if it conflicts with what is in `memory/`.
113−
114−## Line-count threshold
115−
116−The audit script checks `AGENTS.md` against a line-count threshold of 600 lines (see AGENTS.md general guidelines). This is where the bulk of the rules live; CLAUDE.md is a thin wrapper and is not checked separately.
41+Gemini CLI configuration for this project lives in `.gemini/settings.json`. This includes context file settings and MCP server registration. See `AGENT-SETUP.md` for full setup instructions.
11742
