Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.
JavaScript ai-codingclaudeclaude-codeclaude-code-pluginclicoding-agentsdeveloper-toolsgitllmtypescript
fix(init): keep --yes from changing Claude Code permissions
Eren295e2af6eb36
diff --git a/.gitignore b/.gitignoreindex 38ed17e..0e79e9a 100644--- a/.gitignore+++ b/.gitignore@@ -56,3 +56,5 @@ ss//qa/releasecoverage/+# codelineage+/.codelineage/diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0ff9eb7..59e5133 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- `/codelineage:lineage` skill: injects this session's compact record and the project's epochs, asks the agent for only what is new or changed, and has it save the JSON with the Write tool and run `session write --file … --consume` (JSON piped through a shell heredoc is blocked by Claude Code's command checks). It is pre-approved for exactly those two actions and answers "up to date" when nothing changed.- `codelineage session show <id> [-C dir]`: prints the compact record the skill updates (epochs, summary language, title, epoch, status and node ids/parents/kinds/titles, plus the inbox path) as JSON, and reports an uninitialized project or an unreadable record in that JSON instead of failing.- Stop hook (`hooks/hooks.json`, `codelineage hook stop`): counts completed turns per session in `.codelineage/state/<id>.json` and, every `updateEveryTurns` turns since the record last changed, asks the agent to run `/codelineage:lineage` through `additionalContext` ("Stop hook feedback", not an error). Turns a stop hook continued are not counted; before `init`, with `CODELINEAGE_DISABLE=1`, on a busy lock or on any error it does nothing, and an unreadable state file is replaced.-- `codelineage init` asks whether the agent may run the lineage skill without a prompt each time and, if so, adds `Skill(codelineage:lineage)` to `permissions.allow` in Claude Code's user settings (backed up first, skipped when already there); `--allow-skill` / `--no-allow-skill` answer it, and `--allow-skill` also works on an already initialized project. Without the rule, Claude Code asks before every automatic update.+- `codelineage init` asks whether the agent may run the lineage skill without a prompt each time and, if so, adds `Skill(codelineage:lineage)` to `permissions.allow` in Claude Code's user settings (backed up first, skipped when already there); `--allow-skill` / `--no-allow-skill` answer it, `--yes` alone never adds it, and `--allow-skill` also works on an already initialized project. Without the rule, Claude Code asks before every automatic update.- `codelineage session write --consume`: deletes the `--file` input once the record is saved and keeps it when the write fails. `gitPolicy=commit` now also ignores `.codelineage/inbox/`.### Changeddiff --git a/packages/cli/src/program.ts b/packages/cli/src/program.tsindex 51a0d51..5fedb20 100644--- a/packages/cli/src/program.ts+++ b/packages/cli/src/program.ts@@ -59,6 +59,8 @@ export function createProgram(makeIo: IoFactory = processIo, deps: ProgramDeps =.action(run(async (dir: string, opts: InitOptions & { yes?: boolean }) => {const { yes, ...rest } = opts;+ // --yes never changes Claude Code's permissions on its own+ if (yes) rest.allowSkill ??= false;await init(dir, rest, makeIo(!yes && process.stdin.isTTY === true));}),);diff --git a/packages/cli/test/program-commands.test.ts b/packages/cli/test/program-commands.test.tsindex 30e7a91..bb9cf12 100644--- a/packages/cli/test/program-commands.test.ts+++ b/packages/cli/test/program-commands.test.ts@@ -60,8 +60,8 @@ describe("commands through the CLI", () => {expect(await loadProject(root)).toMatchObject({ ok: true, data: { name: "P" } });});- it("init --no-allow-skill and --allow-skill set the skill permission", async () => {- await cli("init", root, "--yes", "--retention", "keep", "--no-allow-skill");+ it("init --yes leaves the skill permission alone; --allow-skill adds it", async () => {+ await cli("init", root, "--yes", "--retention", "keep");expect(await readSkillAllowed(io.env)).toBe(false);await cli("init", root, "--allow-skill");expect(await readSkillAllowed(io.env)).toBe(true);diff --git a/specs/codelineage-mvp.md b/specs/codelineage-mvp.mdindex f6a9713..8836023 100644--- a/specs/codelineage-mvp.md+++ b/specs/codelineage-mvp.md@@ -197,8 +197,8 @@ Each update costs agent tokens (the user's subscription or API usage).`~/.claude/settings.json` so automatic updates do not prompt every N turns? Default:yes. Asked only when the rule is missing; backs the file up first (one backup perrun, holding the original), refuses a file it cannot parse and prints what it- changed. `--allow-skill` / `--no-allow-skill` answer it; `--allow-skill` also works- on an already initialized project. A user-level rule is harmless in projects+ changed. `--allow-skill` / `--no-allow-skill` answer it; `--yes` alone never adds it;+ `--allow-skill` also works on an already initialized project. A user-level rule is harmless in projectswithout `init`, where the skill only prints the setup hint.4. **Language** for summaries: `auto` (the conversation's language) or a fixed language.5. **Past sessions:** "This project has N earlier sessions: all, pick, or none?"