I am getting warnings regarding my claims and claim proofs along the lines of:
pdfTeX warning (ext4): destination with the same identifier (name{claimcount.1}) has been already use d, duplicate ignored
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox \fi \fi l.38 \end{document} ] (./duplicate identifier.aux) ) (see the transcript file for additional information)<
Everything compiles well, but I'd nevertheless like to get rid of the warnings. For reference, the above is the result of the code (MWE)
\documentclass[a4paper,hidelinks,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsthm,chngcntr,csquotes,hyperref}
\newcounter{theorem} \numberwithin{theorem}{chapter}
\newcounter{claimcount}
\setcounter{claimcount}{0}
\newtheorem{claim}[claimcount]{Claim}
{\AtBeginEnvironment{proof}{\setcounter{claimcount}{0}}
\theoremstyle{remark}
\newcounter{cproofcount}
\setcounter{cproofcount}{0}
\AtBeginEnvironment{proof}{\setcounter{cproofcount}{0}}
\newtheorem{cproof/}[cproofcount]{Proof of Claim}}
\newenvironment{cproof}
{\renewcommand{\qedsymbol}{$\dashv$}%
\pushQED{\qed}\begin{cproof/}}
{\popQED\end{cproof/}}
%
\title{}
\author{}
\date{}
\begin{document}
\begin{claim} \end{claim}
\begin{cproof} \end{cproof}
\begin{proof}
\begin{claim}
\end{claim}
\end{proof}
\end{document}
I want to count claims and their proofs within each proof environment, so that the numbering does not continue throughout different theorems. Now, the above works, but I get a number of warnings equal to the number of claims within proofs. How can I achieve this while avoiding the warning?

claimoutside of a proof as well as inside? – moewe May 29 '18 at 14:44cproofandproofsupposed to work? In particular I don't quite understand why there are so many\AtBeginEnvironmentin the group(!) after the definition ofclaim. – moewe May 29 '18 at 14:46