Skip to content

armgit / cogit

Public Imported from GitHub
0

Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.

feat(init): mark the records question as the serious one

Eren2401c1ef129f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 50b3f4b..70ce61c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.28.1] - 2026-11-01
### Changed
-- `cogit init` asks only for the project name, the git policy and (below 90 days) the transcript retention. It lets the agent run the cogit skill, writes the project's `.claude/settings.json` and sets the summary language to the conversation's without asking; `--no-allow-skill`, `--no-project-settings` and `--language` still override them, and `--yes` leaves Claude Code's settings untouched.
+- `cogit init` asks where the session records should live — with a note on what committing `.cogit/` shares — and, below 90 days, whether to keep transcripts longer. The project takes its directory's name. It lets the agent run the cogit skill, writes the project's `.claude/settings.json` and sets the summary language to the conversation's without asking; `--git`, `--name`, `--retention`, `--no-allow-skill`, `--no-project-settings` and `--language` still override them, and `--yes` leaves Claude Code's settings untouched.
- The user-facing "lineage" labels say cogit now: the settings label is **Record at session start**, `cogit log` describes what it prints as recorded sessions, and the record skill replies `cogit updated`.
## [0.28.0] - 2026-11-01
diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md
index 73c0ddb..592d41f 100644
--- a/docs/guide/getting-started.md
+++ b/docs/guide/getting-started.md
@@ -49,10 +49,13 @@ so `cogit init --yes` runs without asking.
| Question | Default | Flag |
|---|---|---|
-| Commit the session records to git? | yes | `--git commit\|ignore` |
+| Where should the session records live? | in the repository | `--git commit\|ignore` |
| Keep Claude Code transcripts longer? Claude Code deletes them after 30 days by default. | keep as is | `--retention <days\|keep>` |
-The project is named after its directory; `--name` overrides it.
+The record holds your messages' titles, branch summaries, decisions and open items, so
+committing `.cogit/` shares all of that with anyone who clones the repository; keep it local
+for a public repository or private sessions. The project is named after its directory;
+`--name` overrides it.
Without asking, `init` lets the agent run the cogit skill without a permission prompt (so it
updates the record as it works), turns the plugin on for the project (writes
diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts
index 2fcb50e..2993e6d 100644
--- a/packages/cli/src/commands/init.ts
+++ b/packages/cli/src/commands/init.ts
@@ -1,5 +1,6 @@
import { mkdir } from "node:fs/promises";
import { basename, resolve } from "node:path";
+import { styleText } from "node:util";
import { defaultAgent } from "../agents/index.js";
import { sessionIdentity } from "../author.js";
import {
@@ -50,6 +51,29 @@ async function bestEffort(io: Io, what: string, fn: () => Promise<unknown>): Pro
}
}
+/**
+ * Where the record lives. This one changes what a clone contains — the record
+ * holds titles, summaries, decisions and open items — so it is asked with a
+ * note, in a colour that stands apart from the routine questions.
+ */
+async function askGitPolicy(io: Io, fallback: GitPolicy): Promise<GitPolicy> {
+ const paint = (text: string): string =>
+ process.stdout.isTTY === true ? styleText("yellow", text) : text;
+ io.out(
+ paint("⚠ Session records carry your messages' titles, summaries, decisions and open items."),
+ );
+ io.out(paint(" Committing .cogit/ shares all of that with anyone who clones this repository."));
+ io.out(paint(" Keep it local if the repository is public or the sessions are private."));
+ return io.prompt.select<GitPolicy>(
+ "Where should the session records live?",
+ [
+ { value: "commit", name: "In the repository — shared with whoever clones it" },
+ { value: "ignore", name: "Only on this machine — private" },
+ ],
+ fallback,
+ );
+}
+
async function askRetention(io: Io, opts: InitOptions): Promise<void> {
const current = await agent.readRetention(io.env);
if (current === undefined) {
@@ -215,16 +239,7 @@ export async function init(dir: string, opts: InitOptions, io: Io): Promise<void
const config = await loadConfig(io.env);
// Story 9.3: the record travels with the repository by default.
- const policy: GitPolicy =
- opts.git ??
- (await io.prompt.select<GitPolicy>(
- "Commit the session records?",
- [
- { value: "commit", name: "Yes, commit session records (local state stays ignored)" },
- { value: "ignore", name: "No, keep .cogit/ out of git (private)" },
- ],
- config.gitPolicy,
- ));
+ const policy: GitPolicy = opts.git ?? (await askGitPolicy(io, config.gitPolicy));
await askRetention(io, opts);
await askSkillPermission(io, opts);