Claw Code is a Fortran-first CLI for exploring a mirrored workspace catalog. It ships a native binary that can inspect archived command, tool, and subsystem inventories, route prompts to likely matches, emit setup/bootstrap reports, and persist lightweight session transcripts.
This repository is not the original TypeScript implementation. The archived command and tool surfaces are mirrored as metadata catalogs inside the Fortran codebase. Commands such as exec-command and exec-tool report what would handle a prompt or payload; they do not run the archived TypeScript sources.
- Inspect the current Fortran port surface with
summaryandmanifest - Search mirrored commands and tools with
commandsandtools - Route a free-form prompt to likely command/tool matches with
route - Simulate a bootstrap/runtime pass with
bootstraporturn-loop - Persist and reload simple session transcripts with
flush-transcriptandload-session - Inspect setup, bootstrap, and inventory diagnostics with
setup-report,parity-audit,command-graph,tool-pool, andbootstrap-graph
The checked-in Makefile assumes a macOS-style toolchain:
gfortraninPATHmake- Xcode Command Line Tools or another environment that provides
xcrun
On macOS, installing Homebrew GCC is typically enough to provide gfortran.
Build the CLI:
makeRun a few representative commands:
./build/claw-code summary
./build/claw-code commands --query review --limit 10
./build/claw-code tools --query MCP --limit 10
./build/claw-code route "review MCP tool" --limit 5
./build/claw-code bootstrap "review MCP tool" --limit 5Run the test suite:
make testIf you just want the command list, run the binary with no arguments:
./build/claw-code.
├── Makefile # Root build/test entrypoint
├── app/
│ └── claw_code.f90 # Program entrypoint
├── src/
│ ├── claw_app.f90 # CLI dispatch, reports, routing, bootstrap flow
│ ├── claw_command_data.f90 # Mirrored command inventory
│ ├── claw_tool_data.f90 # Mirrored tool inventory
│ ├── claw_subsystem_data.f90
│ ├── claw_session.f90 # Session persistence under .port_sessions/
│ ├── claw_shell.f90 # Shell capture helpers for tests/runtime output
│ ├── claw_strings.f90 # String matching and escaping helpers
│ ├── claw_types.f90 # Shared derived types
│ ├── claw_workspace.f90 # Repo scanning, counts, root detection
│ └── reference_data/ # Tracked snapshot inputs behind the mirrored catalogs
├── tests/
│ └── claw_code_test.f90 # Fortran-native test executable
├── assets/ # Project assets
└── .port_sessions/ # Generated session files
Build the main binary:
makeBinary output:
build/claw-code
Run the Fortran-native test executable:
make testRemove build outputs, module files, and stored sessions:
make cleanUse these commands to understand the current Fortran surface:
./build/claw-code summary
./build/claw-code manifest
./build/claw-code subsystems --limit 10summaryprints a concise view of the Fortran modules plus command/tool surface countsmanifestprints the full top-level Fortran module listsubsystemsprints archived subsystem metadata; use--limit Nto control output size
Use these commands to search the archived inventories:
./build/claw-code commands --query review --limit 10
./build/claw-code commands --query auth --no-plugin-commands
./build/claw-code tools --query MCP --limit 10
./build/claw-code tools --simple-mode --no-mcpSupported filters:
commands--query TEXT--limit N--no-plugin-commands--no-skill-commands
tools--query TEXT--limit N--simple-mode--no-mcp
Use the routing and lookup commands when you already have a prompt or a specific item name:
./build/claw-code route "review MCP tool" --limit 5
./build/claw-code show-command review
./build/claw-code show-tool MCPTool
./build/claw-code exec-command review "inspect security review"
./build/claw-code exec-tool MCPTool "fetch resource list"routescores and prints the best mirrored command/tool matches for a promptshow-commandandshow-toolprint the name, archived source hint, and responsibility textexec-commandandexec-toolsimulate which mirrored item would handle the input
These commands produce richer output that combines routing, setup details, and synthetic execution traces:
./build/claw-code setup-report
./build/claw-code bootstrap-graph
./build/claw-code bootstrap "review MCP tool" --limit 5
./build/claw-code turn-loop "review MCP tool" --max-turns 2 --structured-outputsetup-reportprints compiler, platform, trusted-mode, and deferred-init informationbootstrap-graphprints the high-level startup pipelinebootstraprenders a full runtime session, including context, routed matches, stream events, and persisted session pathturn-loopemits repeated turn results; use--max-turns Nand--structured-outputas needed
Session files are stored under .port_sessions/.
Create a transcript:
./build/claw-code flush-transcript "review MCP tool"Typical output:
.port_sessions/20260331-190509-1176816493.session
flushed=True
Reload that session by id:
./build/claw-code load-session 20260331-190509-1176816493Typical output:
20260331-190509-1176816493
1 messages
in=3 out=10
Additional commands:
./build/claw-code parity-audit
./build/claw-code command-graph
./build/claw-code tool-pool --simple-mode --no-mcp
./build/claw-code remote-mode workspace
./build/claw-code ssh-mode workspace
./build/claw-code teleport-mode workspace
./build/claw-code direct-connect-mode workspace
./build/claw-code deep-link-mode workspaceparity-auditcompares against the local archive whenarchive/claude_code_ts_snapshot/srcexistscommand-graphsummarizes builtin/plugin-like/skill-like command countstool-poolprints a filtered tool inventory view- mode commands print placeholder connection/mode state for the requested target
The repository uses a native Fortran test executable at tests/claw_code_test.f90. The suite covers:
- string helper behavior
- workspace root and source/test counting
- subsystem lookup behavior
- session roundtripping
- CLI smoke coverage for the supported command surface
Run everything with:
make test- The primary entrypoint is
app/claw_code.f90 - Most CLI behavior lives in
src/claw_app.f90 - Mirrored inventory data is checked in through the Fortran data modules in
src/ - Snapshot/reference inputs live under
src/reference_data/ - Session files are local artifacts and can be cleared with
make clean