Skip to content

feat(launch): CodeGraph usage block in the entry file; --next prints the whole task - #20

Merged
protonspy merged 3 commits into
mainfrom
feat/codegraph-block-and-whole-next-task
Aug 5, 2026
Merged

feat(launch): CodeGraph usage block in the entry file; --next prints the whole task#20
protonspy merged 3 commits into
mainfrom
feat/codegraph-block-and-whole-next-task

Conversation

@protonspy

Copy link
Copy Markdown
Owner

Three changes, one branch.

--next was dropping the line below the checkbox

Reported against a real task:

- [x] 7.7 (Unit) Record the transform in the written file's provenance, so `trim` and `offset`
      stop being implicit steps inside `align` and `pack`

The parser was fine — Task.End and Detail already covered line 2. The loss was in display: taskLine prints Summary(width), the checkbox line only. That is right for a list and wrong for --next, which returns one task, so a description stopping mid-sentence sent the reader to the file — the exact cost the reading surface exists to remove.

--next now ignores --width and prints the checkbox line whole plus the continuation as it sits in the file. Listings still clip. Task.Continuation() is the raw lines with flags removed; Task.Detail stays the one-line collapse for table rows.

scc launch writes a CodeGraph usage block into CLAUDE.md/AGENTS.md

An index nobody knows how to query is an index nobody queries. Launch already indexes; it now also splices the block, the way it does RTK's. Three constraints, each tested:

  • only once the binary is present — a block promising scc graph explore where that command fails costs the whole entry file its credibility, and CodeGraph is usually absent when init runs;
  • before the index, so a failed index still leaves the agent knowing how to rebuild one;
  • never on --json/--dry-run — a flag nobody expects to change anything must not edit a file the user owns.

The markers are scc's own (<!-- scc:codegraph-instructions v1 -->), deliberately the opposite of the RTK decision: sharing RTK's markers is what makes rtk init and scc rtk converge on one copy of a block they both write, while CodeGraph writes nothing into the entry file at all.

internal/mdblock

The marker-delimited splice, extracted so RTK and CodeGraph share it. Choosing the markers is the integration's decision; find/compare/replace/append and CRLF preservation are one implementation rather than two sets of edge cases. Its test pins the property that is actually new: two blocks coexist in one document and each updates without touching the other.

assets.Version is deliberately not bumped — codegraph.md is a fragment like rtk.md, not in Workspace(h) and not manifest-tracked, so a bump would change nothing for scc update.

CLAUDE.md gains a runnable "how to actually use it" section for scc graph, which was documented only as decisions and never as commands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U9ofAKiYuCCyUnqjfgyNkw

protonspy and others added 3 commits August 5, 2026 13:08
Every task in a real plan runs past one line, and the line below the
checkbox is usually where the decision sits. `--next` returns one task, so
clipping it to the checkbox line sent the reader to the file — the exact
cost the reading surface exists to remove.

--next now ignores --width and prints the checkbox line whole plus the
continuation as it sits in the file. The listings still clip to one line,
because a list of sixty-one-line tasks is not a list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9ofAKiYuCCyUnqjfgyNkw
An index nobody knows how to query is an index nobody queries. `scc launch`
already indexes the workspace before the session starts; it now also writes
a CodeGraph usage block into CLAUDE.md/AGENTS.md, the way it writes RTK's.

Three constraints, each tested. The block goes in only once the binary is
present, because guidance naming a command the machine cannot run costs the
whole entry file its credibility. It is written before the index, so a
failed index still leaves the agent knowing how to rebuild one. And a
plan-only run writes nothing: --dry-run that edited a file the user owns
would be the one flag nobody expects to change anything doing exactly that.

The markers are scc's own, which is deliberately the opposite of the RTK
decision: sharing RTK's markers is what makes `rtk init` and `scc rtk`
converge on one copy of a block they both write, while CodeGraph writes
nothing into the entry file at all.

internal/mdblock is the splice both now share — choosing the markers is the
integration's decision, everything after that choice is one implementation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9ofAKiYuCCyUnqjfgyNkw
The `scc graph` section described the decisions behind the integration and
never the commands. It now leads with what to run and when to reach for it
over Read, plus the launch-time usage block, the --next reading rule, and
internal/mdblock in the package table.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9ofAKiYuCCyUnqjfgyNkw
@protonspy
protonspy merged commit 930526d into main Aug 5, 2026
4 checks passed
@protonspy
protonspy deleted the feat/codegraph-block-and-whole-next-task branch August 5, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant