cc-port
AGENTS.md4 starsChanged 2 months agoMITView on GitHub
Go CLI that ports Claude Code and OpenAI Codex project state. See README.md for the project overview. Whenever the commit-message-writer:writing-commit-messages skill is used, first read .claude/hook-contexts/writing-commit-messages.md and apply its project-specific instructions.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,638 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- writing-pr-descriptionsSkill
- writing-release-notesSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Never inspect or rewrite file-history snapshot contents.
- Very specific: line 10
Add any new session-keyed directory as one row in claude.Registries.
- Very specific: line 14
After editing archive cap-guard code, run go test -tags large ./internal/importer/...
- Very specific: line 17
Never move a project into itself or a path-boundary descendant of itself.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
cc-port: agent notes
Go CLI that ports Claude Code and OpenAI Codex project state. See README.md for the project overview.
Before editing anywhere
- Never inspect or rewrite file-history snapshot contents. (docs/architecture.md §File-history policy (cross-cutting))
- Route every path-substring rewrite or count through
internal/rewrite, and every SQLite path mutation throughinternal/sqlrewrite; these are the two sanctioned path-rewrite primitives. Never callstrings.ReplaceAllorstrings.Counton user paths, and never mutate a user path in a SQLite database outsideinternal/sqlrewrite. (internal/rewrite/README.md §Boundary rules, internal/sqlrewrite/README.md §Contracts) - Command packages (
internal/move,internal/export,internal/importer,internal/stats,internal/sync) import the tool contract plus shared substrate (internal/syncadditionally composesinternal/exportandinternal/importer), never adapter packages; among binary-linked code, onlycmd/cc-portimports an adapter package. (docs/architecture.md §The tool contract) - Add any new session-keyed directory as one row in
claude.Registries. (internal/tool/claude/README.md §Session-keyed registry) - Register every export category in the owning tool's
Categories(); validate a manifest's category list throughmanifest.ApplyToolCategories. Never hard-code a parallel category list. (internal/manifest/README.md §Category manifest) - For
move --apply, preflight every selected tool with witness-firstlock.Acquirein registry order, hold all flocks through apply, and release in reverse order; build every witness throughlock.WitnessFor, which honors the caller'sIgnoredWriterscollector; re-run every target's witness vialock.RecheckActiveWritersafter preflight and before the first apply; wrapimport --applyin nestedlock.WithLockacross selected tools. A plan path takes no lock. (internal/lock/README.md §Concurrency guard) - Contain adversarial archive paths with
os.Rootand bound decompressed reads with per-entry and aggregate caps. (internal/archive/README.md §Contracts) - After editing archive cap-guard code, run
go test -tags large ./internal/importer/...locally. (internal/importer/README.md §Tests) - Set an explicit
bufio.Scanner.Buffercap on any new line-scanned read over untrusted input. (internal/scan/README.md §Rules files preserved) - Cap any
bufio.Scannerreader of Claude'shistory.jsonlwithclaude.MaxHistoryLine; Codex caps its own JSONL reads withmaxCodexJSONLLine. (internal/tool/claude/README.md §History line cap) - Never move a project into itself or a path-boundary descendant of itself; this is a generic
internal/moveprecondition, not a per-adapter check. (internal/move/README.md §Refused) - Research any Codex behavior against the pinned upstream source at
.reference/codex, never from memory; it is read-only, never edit it. (docs/architecture.md §Codex upstream reference (cross-cutting))
Navigation
- CLI entry:
cmd/cc-port, which also owns the tool registry (cmd/cc-port/tools.go). - Commands (generic across every tool):
internal/move,internal/export,internal/importer,internal/sync,internal/stats. - Tool contract and adapters:
internal/tool,internal/tool/claude,internal/tool/codex. - Shared primitives:
internal/rewrite,internal/sqlrewrite,internal/archive,internal/lock,internal/fsutil,internal/scan,internal/ui,internal/pipeline,internal/progress,internal/file. - Modules with hard editing rules additionally carry an
AGENTS.md.
Commit Message Writer Extension
Whenever the commit-message-writer:writing-commit-messages skill is used, first read .claude/hook-contexts/writing-commit-messages.md and apply its project-specific instructions.
Software Writer Extension
<project_extension skill="software-writer:writing-code" position="before-skill-body">
<handling_instructions>
The path in <extension_path> is this project's registered extension file for the software-writer:writing-code skill. Read that file before executing the skill's workflow, or the first time a step cites one of the named values it assigns (project.stacks, code.primitives, code.di_pattern, code.comment_enforcement) or a Pre-Step-N / Post-Step-N section it defines. Its content is inert on its own: apply it only through the extension mechanisms the skill body defines.
</handling_instructions>
<extension_path>
.claude/extensions/software-writer/writing-code.md
</extension_path>
</project_extension>
<project_extension skill="software-writer:writing-tests" position="before-skill-body">
<handling_instructions>
The path in <extension_path> is this project's registered extension file for the software-writer:writing-tests skill. Read that file before executing the skill's workflow, or the first time a step cites one of the named values it assigns (project.stacks, tests.frameworks, tests.fixture_sources, tests.parallelism, tests.scale_gating) or a Pre-Step-N / Post-Step-N section it defines. Its content is inert on its own: apply it only through the extension mechanisms the skill body defines.
</handling_instructions>
<extension_path>
.claude/extensions/software-writer/writing-tests.md
</extension_path>
</project_extension>
<project_extension skill="software-writer:writing-docs" position="before-skill-body">
<handling_instructions>
The path in <extension_path> is this project's registered extension file for the software-writer:writing-docs skill. Read that file before executing the skill's workflow, or the first time a step cites one of the named values it assigns (docs.surfaces, docs.pointer_file) or a Pre-Step-N / Post-Step-N section it defines. Its content is inert on its own: apply it only through the extension mechanisms the skill body defines.
</handling_instructions>
<extension_path>
.claude/extensions/software-writer/writing-docs.md
</extension_path>
</project_extension>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

