@ladbabynpm/picc-write
Claude Code style Write tool for pi — a faithful port of Claude Code's `Write` (create/update, read-first guard, structured diff).
Package details
Install @ladbabynpm/picc-write from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ladbabynpm/picc-write- Package
@ladbabynpm/picc-write- Version
0.1.1- Published
- Sep 29, 2026
- Downloads
- 242/mo · 21/wk
- Author
- ladbabynpm
- License
- MIT
- Types
- extension
- Size
- 41.2 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
picc-write
Claude Code style Write tool for pi — a faithful port of Claude Code's Write tool, overriding pi's built-in write.
Part of picc, a pi agent setup mirroring Claude Code's harness.
pi's built-in
writeis a thinfs.writeFilewrapper: inputpath(relative or absolute), no "must read first" guard, no create/update distinction, and aSuccessfully wrote N bytesmessage. This extension replicates Claude Code'sWrite:file_path(absolute) input, a session-scoped read-first guard, create-vs-update results with a structured diff, and faithful success messages.
Usage
Install via pi install npm:@ladbabynpm/picc-write.
Tool
- Name:
write(default; overrides pi's built-inwrite) orWrite— configurable (see below). - Parameters:
file_path(absolute, required),content(required). - Behavior:
- New file — parent dirs are created automatically; returns
File created successfully at: <path>. - Existing file — must have been read this session (any read tool), and must not
have been modified since that read; returns
The file <path> has been updated successfully.with a structured diff. - Writes with explicit LF handling (the model's sent line endings are respected as-is — no repo resampling).
- New file — parent dirs are created automatically; returns
- Read-first guard: reads are observed from pi
tool_resultevents for any read tool (read/Read), so it works whether the file was read with pi's built-inreador picc-read'sRead. The map is cleared onsession_start.
Configuration
| Setting | Where | Values | Default |
|---|---|---|---|
toolName |
config.json |
"write" | "Write" |
"write" |
PICC_WRITE_TOOL_NAME |
env | "write" | "Write" |
— |
PICC_WRITE_CONFIG_PATH |
env | absolute path to a config.json | ~/.pi/agent/extensions/picc-write/config.json |
Precedence for the tool name: PICC_WRITE_TOOL_NAME env > config.json > "write".
What is omitted from the live source
No pi equivalent, so left out: permission checks (checkWritePermissionForTool),
checkTeamMemSecrets, team-memory guards, skill discovery, fileHistory, LSP
didChange/didSave, notifyVscodeFileUpdated, gitDiff, and analytics.
Development
npm install
npm run lint # biome check
npm run typecheck # tsc --noEmit
npm run test # vitest run