Skip to content

Route Claude Code plan files to gitignored .claude/plans; document .agents/tasks convention#30

Open
alexander-yevsyukov wants to merge 3 commits into
masterfrom
redirect-plans-to-agents-tasks
Open

Route Claude Code plan files to gitignored .claude/plans; document .agents/tasks convention#30
alexander-yevsyukov wants to merge 3 commits into
masterfrom
redirect-plans-to-agents-tasks

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

Configure how this repo handles Claude Code plan-mode files and durable task files, and document the convention.

Why

Claude Code's plan mode writes a file with a harness-assigned random slug (e.g. twinkling-booping-flask.md) that is not controllable — no naming setting exists and the model has no say. By default it lands under ~/.claude/plans/, outside the repo, where durable status/hand-off notes appended to it are invisible to the team. (This surfaced from a real hand-off report that landed at ~/.claude/plans/twinkling-booping-flask.md.)

Design: dual-file split

  • Durable record = agent-authored task file. When a task warrants durable tracking, the agent writes .agents/tasks/<meaningful-slug>.md with the Write tool. It picks the slug, so the name is meaningful from creation and never needs renaming.
  • Plan-mode file = ephemeral approval artifact. It keeps its random name and is routed to a gitignored scratch dir, so it stays in the working tree but out of version control and out of the .agents/tasks/ namespace.

Changes

  • .claude/settings.json (new) — plansDirectory: .claude/plans (gitignored scratch), plus permissions.ask: ["Bash(git commit:*)"] as the defense-in-depth guard documented in guidelines/safety-rules.md (added during review).
  • .gitignore — ignore .claude/plans/.
  • .agents/tasks/README.md — document the dual-file split and naming.
  • AGENTS.md — one orientation bullet so agents follow the convention without re-reading the README.

Reviewer notes

  • Plan-mode filename control is a harness limitation (open feature requests upstream), hence the dual-file approach rather than trying to rename the plan file out from under the harness.
  • This repo doesn't consume config, so its .claude/settings.json is self-owned. A separate config-repo change will distribute the same plansDirectory: .claude/plans + gitignore to consumer repos.
  • No build impact — settings + docs only.

🤖 Generated with Claude Code

Claude Code writes plan-mode files — and the resumable status notes agents
append to them — under `~/.claude/plans/` by default. That is outside the
repository, so plans and hand-off reports are invisible to the team and to
other agents, which breaks the cross-session resume workflow this repo's
`.agents/tasks/` convention is built around.

Set `plansDirectory` to `.agents/tasks` so plan files land in the durable,
git-tracked task directory instead:

- Add `.claude/settings.json` pinning `plansDirectory` for anyone working
  in this repo (team-wide, not just per-developer).
- Document the redirect in `.agents/tasks/README.md`, including how to
  normalize plan mode's random-slug filenames into meaningful task slugs.

This repo does not consume `config`, so its `.claude/settings.json` is
self-owned and not overwritten by `config/migrate`; a separate change to the
`config` repo will carry the same setting to consumer repos.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes where Claude Code “plan mode” files are written by redirecting them into the repo’s durable, git-tracked task area (.agents/tasks/), aligning Claude plan artifacts with the existing task hand-off workflow.

Changes:

  • Add repo-level .claude/settings.json setting plansDirectory to .agents/tasks.
  • Document the redirect in .agents/tasks/README.md, including guidance for renaming Claude’s random plan slugs into meaningful task slugs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.claude/settings.json Sets plansDirectory to write Claude plan-mode files into .agents/tasks instead of ~/.claude/plans/.
.agents/tasks/README.md Documents the redirect and recommended rename/frontmatter workflow for plan files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68420b30f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/settings.json Outdated
`guidelines/safety-rules.md` (lines 76-79) documents that the project's
`.claude/settings.json` keeps `Bash(git commit:*)` in `permissions.ask` as
defense-in-depth against agents writing git history under permissive global
settings. This repo previously had no `.claude/settings.json`, so the
introduced file must carry that guard rather than silently omit it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 7, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jul 7, 2026
@alexander-yevsyukov alexander-yevsyukov moved this from 🏗 In progress to In Review in v2.0 Jul 7, 2026
…le convention

Claude Code's plan-mode filename is a harness-assigned random slug that cannot
be controlled — there is no naming setting and the model has no say. Routing
those files into `.agents/tasks/` therefore mixed random-named artifacts into
the meaningfully-named, committed task namespace.

Split the two instead:

- Point `plansDirectory` at `.claude/plans` and gitignore it, so plan-mode
  files stay in the working tree but out of version control and out of
  `.agents/tasks/`.
- Durable task and hand-off notes are authored by the agent as
  `.agents/tasks/<meaningful-slug>.md` (Write tool) — meaningful from creation,
  never renamed.
- Document the split in `.agents/tasks/README.md` and add an AGENTS.md
  orientation bullet so agents follow it without re-reading the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 19:55
@alexander-yevsyukov alexander-yevsyukov changed the title Redirect Claude Code plan files to .agents/tasks Route Claude Code plan files to gitignored .claude/plans; document .agents/tasks convention Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .claude/settings.json
Comment thread .claude/settings.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants