Codee skill with Claude: HYCOM walkthrough
The Codee skill is experimental. Its instructions, and the way AI agents follow them, may change between releases. Review every change it proposes as you would review a patch from a colleague.
Learn how to use the Codee Analyzer skill with Claude Code to find, explain, fix and verify a quality issue in HYCOM, an ocean modeling system consisting of dozens of Fortran files.
Codee Analyzer finds issues in Fortran code deterministically and with few
false positives. An AI agent adds what a static analyzer cannot: it explains
the findings in plain language with your own code, and adapts the fix to your
constraints. The Codee skill (codee-analyzer-quality-workflow) tells the
agent how to combine both: Codee finds the issues, prioritizes them and offers
AutoFixes, and the agent does the rest under your control.
If you are new to one side of this tutorial, these are the terms it uses:
- Agent: an AI assistant that can run commands and read and edit files on your machine, in a loop, until a task is done. This tutorial uses Claude Code, Anthropic's agent for software work.
- Prompt: the message you type to the agent.
- Skill: a folder with a
SKILL.mdfile of instructions, plus optional scripts and reference files, that the agent loads when a task needs it. It works like a procedure written for a new colleague. - Codee check: a rule from the Open Catalog, with an ID such as PWR007. Each place in the code that breaks it is a finding. Codee ranks checks by priority, from L1 (most important) to L3.
- AutoFix: Codee's automatic rewrite of the code for a finding.
compile_commands.json: a compilation database, a JSON file with the compiler command of each source file. Codee uses it to analyze the code with the same flags and macros as your compiler.
Getting ready
Requirements
- Codee installed with a valid license (see Install
Codee). The Free flavour is not enough.
Run
codee --versiononce yourself before you start, because the first run asks you to accept the EULA. - A Fortran compiler and
maketo build HYCOM. This walkthrough uses gfortran 13 and GNU Make on Linux. - The
codee-demosrepository cloned (see below). - The Codee skill installed in Claude Code (see below).
- Python 3 (optional): the skill verifies each fix with a small Python script. Without Python, the agent compares Codee's reports by itself.
- Claude Code, either the command-line tool or the Code tab of the Claude Desktop app.
Codee, its license and HYCOM must be reachable by the agent: they must be on the same machine, or in the same environment, where the agent runs commands.
Download and install the skill
Download the skill: codee-analyzer-quality-workflow.zip.
Claude Code loads skills from two places:
- Personal skills, in
~/.claude/skills/, are available in all your projects on that machine. - Project skills, in
.claude/skills/inside a project, are available only in that project. Commit them to share the skill with your team.
To install the skill for yourself, unzip it into your personal skills folder:
mkdir -p ~/.claude/skills
unzip codee-analyzer-quality-workflow.zip -d ~/.claude/skills/
The result is a folder named after the skill:
~/.claude/skills/codee-analyzer-quality-workflow/
├── SKILL.md # instructions for the agent
├── references/
│ └── fixing-checks.md # understand the potential impact of the fixes
└── scripts/
└── compare_checks.py # compares Codee reports before and after a fix
To check that Claude Code sees it, start Claude Code and type /: the list of
commands includes /codee-analyzer-quality-workflow. For more details, see
Extend Claude with skills in the
Claude Code documentation.
The Code tab of the Claude Desktop app works the same way: local sessions load
your personal skills from ~/.claude/skills/, and typing / in the prompt box
lists them. In an SSH session, the skills come from ~/.claude/skills/ on the
remote host, so install the skill there.
Skills follow Agent Skills, an open standard that most AI coding tools now support. The same skill folder works with them too; only the folder where each tool looks for skills changes, so check your tool's documentation.
Prepare HYCOM
For this demonstration, we will use HYCOM, the same project as in HYCOM correctness & modernization. Start by cloning the repository:
git clone https://github.com/codee-com/codee-demos.git
The skill needs HYCOM compiled, with a compile_commands.json. Navigate to
the source code directory:
cd codee-demos/Fortran/HYCOM/src
Build HYCOM and generate the compile_commands.json file with bear, which
comes with Codee:
bear -- make
If you have built HYCOM before, run make clean first: bear only records
the files that make compiles. To learn more about the compile_commands.json
file, see Compilation Database Generation.
Walkthrough
The skill covers quality checks in Fortran code (correctness, modernization, security, portability); it does not cover optimization checks. It walks the agent through the same stages in every round, which the steps below follow:
- Set up: find Codee, check the license and the compilation database.
- Prioritize: run Codee's screening report and suggest the most relevant checks.
- Get the findings of one check in one file.
- Explain them with your code: why they matter and how risky the fix is. For most checks, the agent also proposes a plan and waits until you agree on it.
- Fix: preview Codee's AutoFix (or a manual edit) as a diff, and apply it only after your go-ahead.
- Verify: check with Codee that the finding is gone and nothing new appeared, then build the project.
- Report what changed and suggest the next step.
The responses below come from a real session with Claude Code and Claude Opus 5.5, shortened and condensed, and the prompts show the choices made in that session. Agent responses vary between runs, so yours will not match word for word, but the steps and the Codee commands follow the same workflow.
1. Invoke the skill
Start Claude Code in the HYCOM source directory,
codee-demos/Fortran/HYCOM/src, where you built it:
claude
To invoke the skill explicitly, start your prompt with its name preceded by a slash, followed by your request:
/codee-analyzer-quality-workflow Help me find and fix the most important quality
issues in HYCOM.
Invoking the skill by name is done only to make this demo predictable. In normal use, you don't need it: the agent reads the description of each installed skill and uses this one on its own when your request is about Codee, a Codee check ID, or modernizing or cleaning up Fortran code.
2. Set up and prioritize
The agent first checks the setup: where codee is, that its license flavour
is not Free, and where compile_commands.json is. It also asks for two
locations outside the project: a Codee analysis database, so that repeated
runs are fast, and a directory for reports and AutoFix previews. This
walkthrough uses ~/codee-work/hycom.db and ~/codee-work/tmp. Then it runs
Codee's screening report with only the quality checks:
codee screening --only-quality --show-progress=none --db ~/codee-work/hycom.db -p compile_commands.json > ~/codee-work/tmp/screening.txt
Date: 2026-11-10 Codee version: 2026.1.2 License type: Team
Searching Incremental Static Analysis database... Enabled
SCREENING REPORT
------Number of files------
Total | C C++ Fortran Other
----- | - --- ------- -----
50 | 1 0 49 0
RANKING OF QUALITY CHECKERS
Checker Category Priority AutoFixes # Title
------- ---------------------------------- -------- --------- ---- ----------------------------------------------------------------------------
PWR068 correctness, modern, security P18 (L1) 192 Call procedures through explicit interfaces, preferably as module procedures
PWR007 correctness, modern, security P18 (L1) 19 22 Disable the implicit declaration of variables and procedures
PWR004 correctness, security P12 (L1) 226 Declare OpenMP scoping for all variables
PWR080 correctness, portability, security P12 (L1) 39 Conditionally initialized variables can lead to undefined behavior
PWR063 correctness, modern, security P12 (L1) 19 Avoid using legacy Fortran constructs
PWR073 correctness, modern, security P12 (L1) 7 Transform common block into a module for better data encapsulation
PWR008 correctness, modern, security P9 (L2) 30 196 Declare the intent for each procedure argument
PWR069 correctness, modern, security P9 (L2) 146 146 Use the keyword only to explicitly state what to import from a module
PWR081 correctness, portability, security P9 (L2) 2 Avoid undefined behavior due to uninitialized output argument
PWR005 correctness, security P8 (L2) 288 Disable default OpenMP scoping
PWR075 modern, portability, security P8 (L2) 20 Avoid using compiler-specific Fortran extensions
PWR071 modern, portability, security P6 (L2) 831 Prefer real(kind=kind_value) for declaring consistent floating types
PWR082 correctness, security P4 (L3) 228 Remove unused variables
PWR001 correctness, modern, security P4 (L3) 189 Pass global variables as function arguments
PWR070 correctness, modern, security P4 (L3) 74 Declare array dummy arguments as assumed-shape arrays
PWR003 modern, security P3 (L3) 7 Explicitly declare pure functions
------- ---------------------------------- -------- --------- ---- ----------------------------------------------------------------------------
Total 195 2486
<...>
0 file analyses reused from cache, 50 files analyzed from scratch
50 target files, 251 functions, 2058 loops, 44679 SLOCs successfully analyzed (2486 checkers) and 0 non-analyzed files in 1 m 3 s
Codee already ranks the checks. The agent does not rank them again; it adds
what Codee does not know, such as the effort and the risk of each fix, and
suggests a few checks to start with. To suggest a file for each, it runs the
screening report again per check, with --verbose --check-id <ID>:
The quality screening analyzed all 50 files (`0 non-analyzed files`, 1 min 3 s
for the first run) and found 2486 findings of 16 checks. Codee's ranking puts
PWR068, PWR007, PWR004, PWR080, PWR063 and PWR073 at L1, but only PWR007 has
AutoFixes among them; PWR008 and PWR069 are the L2 checks with AutoFixes.
For a first fix that is easy to review, I suggest one of these:
1. **PWR007 in `s8gefs.F90`** (L1, P18, the top-ranked check with AutoFixes;
22 findings, all 19 AutoFixes in this file). Adds `implicit none` so that a
typo can no longer create a new variable. Risk: medium; the skill's notes
say what to review in its AutoFix output (declared types must match the
implicit ones <...>). The
file has 19 old LINPACK-style routines without `implicit none`, so the
whole file is a large diff; I would start with one small routine <...>.
2. **PWR069 in `inimy.F90`** (L2, P9; 146 findings and 146 AutoFixes in the
project; 1 finding with AutoFix in this 64-line file). <...> Risk: low. <...>
3. **PWR008 in `isnan.F90`** (L2, P9; 196 findings, 30 AutoFixes; 1 finding
with AutoFix in this 36-line file). <...> Risk: medium in general (a wrong
intent is worse than none), low here: the argument is only read. <...>
Do you want changed code commented? AutoFix adds a dated `! Codee: ...` comment
above each change; I would add a similar `! AI agent with Codee (...)` comment
above any manual adjustment. If not, I'll pass `--disable-comments` and add
none.
Note the last question: the skill asks once whether you want the changed code commented, before preparing any diff, so the diffs you review already reflect your answer.
3. Get the findings for one check in one file
Pick a check and a file. This walkthrough picks PWR007, the top-ranked check with AutoFixes:
Let's go with PWR007 in s8gefs.F90. Yes, comment the changes.
PWR007 asks for implicit none. Without it, Fortran gives every undeclared
name a type from its first letter: names starting with I to N are
integers, all others are reals.
The agent gets the findings of that check in that file as a JSON report. The
--json=<file> form keeps the text summary on the screen, so the agent can
check again that the file was analyzed:
codee checks --check-id PWR007 --db ~/codee-work/hycom.db -p compile_commands.json s8gefs.F90 --json=$HOME/codee-work/tmp/checks_report.json
Each finding in the JSON report names its location, Codee's suggestion and
the exact codee rewrite command of its AutoFix. This is the finding for the
routine X8ERROR, the one this walkthrough fixes:
{
"Check": "PWR007",
"Level": "L1",
"Location": "s8gefs.F90:600:7",
"Title": "Disable the implicit declaration of variables and procedures",
"RelatedCodeList": null,
"Suggestion": "Add 'implicit none' in the specification part of 'X8ERROR' to disable implicit variables. Consider using 'implicit none (type, external)' to also flag calls to implicit procedures, which use unsafe implicit interfaces",
"Auto-fix": [
"codee rewrite --check-id pwr007 --in-place s8gefs.F90:X8ERROR --db /home/user/codee-work/hycom.db -p compile_commands.json"
],
"Documentation": "https://open-catalog.codee.com/Checks/PWR007"
}
4. Understand the finding
The agent reads the check's Open Catalog entry, which ships with Codee, and explains the finding with your code:
**What Codee found.** None of the 19 routines in `s8gefs.F90` has `implicit
none`, so every name that is not declared gets a type from its first letter:
`I` to `N` give `integer`, any other letter gives `real`.
**Why it matters.** With implicit typing, a typo creates a new variable instead
of a compile error. <...> With `implicit none`, that is an error at compile
time, and every type is visible in the declarations.
I suggest **`X8ERROR`** (line 600): its AutoFix adds `implicit none` and
declares the three arguments that are implicit integers today.
**Risk.** Low for this routine. The file has no `IMPLICIT` statements and no
preprocessor branches, all the implicit names are integers <...>. `X8ERROR` is
never called in HYCOM (it comes with the SLATEC error-handling package that
`s8gefs.F90` bundles), so this change cannot affect results; the rebuild
checks that it compiles.
Next, I'll save a baseline of all quality findings in `s8gefs.F90` and preview
the AutoFix into `<tmp>` (not in place), so you can review the diff.
`s8gefs.F90` does not change until you approve it.
PWR007 is one of the checks the skill fixes directly: the right fix follows from the code, so there is nothing for you to decide beforehand, and the agent goes straight to the preview. For the other checks, it first proposes a plan (the decisions you have to make, the scope of the change and how it will be verified) and waits until you agree on it. In both cases, every diff still needs your go-ahead.
5. Preview the fix
Before changing anything, the agent saves a baseline: all the quality findings
in the file, in ~/codee-work/tmp/before.json, to tell later whether the fix
introduced new ones.
Then it runs the AutoFix command from the report, with --in-place replaced
by -o, so that Codee writes the fixed file into ~/codee-work/tmp and leaves
s8gefs.F90 untouched. It shows you the result as a diff:
codee rewrite --check-id pwr007 -o ~/codee-work/tmp/s8gefs_X8ERROR.F90 s8gefs.F90:X8ERROR --db ~/codee-work/hycom.db -p compile_commands.json
diff -u s8gefs.F90 ~/codee-work/tmp/s8gefs_X8ERROR.F90
@@ -643,6 +643,11 @@
! 1982.
!***ROUTINES CALLED XERRWV
!***END PROLOGUE XERROR
+ ! Codee: Made all variable declarations explicit (2026-11-10 21:39:03)
+ implicit none
+ integer :: LEVEL
+ integer :: NERR
+ integer :: NMESSG
CHARACTER*(*) MESSG
!***FIRST EXECUTABLE STATEMENT XERROR
CALL X8ERRWV(MESSG,NMESSG,NERR,LEVEL,0,0,0,0,0.,0.)
The agent reviews the preview before asking for your go-ahead, since AutoFix output is not always ready to compile (for example, lines that are too long, or comments that move):
- `LEVEL`, `NERR` and `NMESSG` start with `L` and `N`, so they were implicit
integers: the declarations keep their types. `MESSG` was already declared.
- Plain `implicit none` is standard Fortran 90. The call to `X8ERRWV` needs no
declaration with it.
- <...> the interface does not change, AutoFix comment kept, no adjustments
needed.
Shall I apply this diff?
The agent never changes your code without first showing you the diff and getting your go-ahead, and a go-ahead covers only the diff it was given for.
If you'd rather not let an agent edit your code at all, ask it for a report instead. The skill still uses Codee to find the issues and prepares the fixes as previews, but you review and apply them yourself:
/codee-analyzer-quality-workflow Don't change any source file. For PWR007 in
s8gefs.F90, write a Markdown report to ~/codee-work/pwr007-report.md with
Codee's findings, a plain-language explanation of each, and the AutoFix
previews as unified diffs that I can review and apply myself.
6. Apply the fix
Yes, apply it.
With your go-ahead, the agent runs the AutoFix command exactly as the report gave it:
codee rewrite --check-id pwr007 --in-place s8gefs.F90:X8ERROR --db ~/codee-work/hycom.db -p compile_commands.json
Date: 2026-11-10 Codee version: 2026.1.2 License type: Team
Searching Incremental Static Analysis database... Enabled
Dependency processing... Done (0 ms)
[1/1] s8gefs.F90 ... Done
Results for file '/home/user/codee-demos/Fortran/HYCOM/src/s8gefs.F90':
Successfully applied AutoFix to the procedure at 's8gefs.F90:600:7' [using insert implicit none]:
[INFO] Inserted implicit none:
- s8gefs.F90:600:7
Successfully updated /home/user/codee-demos/Fortran/HYCOM/src/s8gefs.F90
The change in the repository is the diff you approved; only the time in the Codee comment differs:
diff --git a/Fortran/HYCOM/src/s8gefs.F90 b/Fortran/HYCOM/src/s8gefs.F90
index 98adb33..124f5a6 100644
--- a/Fortran/HYCOM/src/s8gefs.F90
+++ b/Fortran/HYCOM/src/s8gefs.F90
@@ -643,6 +643,11 @@
! 1982.
!***ROUTINES CALLED XERRWV
!***END PROLOGUE XERROR
+ ! Codee: Made all variable declarations explicit (2026-11-10 21:40:33)
+ implicit none
+ integer :: LEVEL
+ integer :: NERR
+ integer :: NMESSG
CHARACTER*(*) MESSG
!***FIRST EXECUTABLE STATEMENT XERROR
CALL X8ERRWV(MESSG,NMESSG,NERR,LEVEL,0,0,0,0,0.,0.)
7. Verify the fix
First, the agent repeats the baseline on the changed file, and saves its text summary too:
codee checks --only-quality --db ~/codee-work/hycom.db -p compile_commands.json s8gefs.F90 --json=$HOME/codee-work/tmp/after.json > ~/codee-work/tmp/after.txt
<...>
[1/1] s8gefs.F90 ... Done: input file changed
0 file analyses reused from cache, 1 file analyzed from scratch
1 target file, 19 functions, 40 loops, 601 SLOCs successfully analyzed (93 checkers) and 0 non-analyzed files in 4145 ms
Then it compares both reports with the script that comes with the skill. The script fails if Codee could not analyze the file, if the target check did not go down, or if any other check got more findings:
python3 ~/.claude/skills/codee-analyzer-quality-workflow/scripts/compare_checks.py ~/codee-work/tmp/before.json ~/codee-work/tmp/after.json --summary ~/codee-work/tmp/after.txt --check-id PWR007
file check before after delta
s8gefs.F90 PWR007 19 18 -1
total findings: 94 -> 93
PWR007: 19 -> 18
OK
Finally, it builds the project with its usual flags, since Codee can report a
finding as gone while the code no longer compiles. A plain make is enough
here; bear -- make would overwrite compile_commands.json with only the
files it recompiles:
make
If your project has tests, the agent runs them too.
8. Review the report
The agent ends with a report of what changed, how it was verified, what it could not verify, and what remains:
**What remains:** 18 PWR007 findings in `s8gefs.F90` (21 in the project).
**Next step, your choice:**
1. The same check in the same file: the other routines where the AutoFix writes
plain `implicit none` (`S8GEFS`, `S8GECO`, `S8GEFA`, `S8GESL`, `X8ERRWV`,
`X8ERSAV`, `X8ERPRT`). <...>
2. The 3 PWR007 findings in other files (`machine.F90`, `mod_pipe.F90`,
`mod_barotp.F90`), which have no AutoFix: I would write those edits by hand,
as a diff for you to approve.
3. The next check from the screening, such as PWR008 or PWR069 (L2, with
AutoFixes).
Keep iterating
This demo stops after one check in one file, to keep each step visible. In real use, keep going: fix the remaining findings of the same check in the same file, then the next file with that check, then the next check from the screening report, until every relevant issue is solved. The agent suggests the next step at the end of each round, but it never starts one on its own, so you stay in control of the pace and the scope.